|
You last visited: Today at 08:20
Advertisement
[HELP] - De/Encoding packets
Discussion on [HELP] - De/Encoding packets within the Nostale forum part of the MMORPGs category.
04/09/2016, 15:31
|
#1
|
elite*gold: 0
Join Date: Jan 2016
Posts: 36
Received Thanks: 0
|
[HELP] - De/Encoding packets
Hi, i am trying clientless bot for nostale in C#, and i have problem with encoding and decoding packets, can anyone give me some functions? (de/encode login packet, de/encode game packet, encode password ). I was searching these functions and i found only some old funcs and funcs in c++ wich is like if u hit keyboard. Login in PHP is working for me, but if i send another packet, no response come to me. This is my code:
Code:
public TcpClient client = new TcpClient();
public string tempString = "";
public NetworkStream stream;
const string HASH = "529D12EF5699E29548A9914C7B2AB6DFA735FA8053A6B0EDFF75E607FF3EBBED";
private string id="somethink";
private string password="somethink";
private void buttonLogin_Click(object sender, EventArgs e)
{
try
{
client.Connect("79.110.84.75", 4006);
stream = client.GetStream();
print("Connected to server!");
}
catch (SocketException err)
{
print("Cannot connect to server! Error: "+err.ToString());
}
id = labelNickname.Text;
password = labelPassword.Text;
password = PASSWORD_ENCODING_FUNC(password); - This isnt working i know
string loginMessage = "NoS0575 597064 " + id + " " + password + " 008B8CF9";
loginMessage +=((char)11).ToString();
loginMessage +="0.9.3.3055 0 "+md5(hash+id).ToUpper();
loginMessage= LOGIN_PACKET_ENCODING_FUNC(loginMessage);
client.Write(loginMessage,0,loginMessage.Length);
|
|
|
04/09/2016, 16:16
|
#2
|
elite*gold: 0
Join Date: Apr 2016
Posts: 52
Received Thanks: 19
|
1- Its Encryption, not Encoding < no! not the same thing!! >
2- You have here all functions you need in C++
( nobody will convert it for you, stop be lazy and start doing things by yourself )
|
|
|
04/09/2016, 16:55
|
#3
|
elite*gold: 0
Join Date: Jan 2016
Posts: 36
Received Thanks: 0
|
I from that make dll and insert it into my program but, bigger problem is, if i send packet and then try to read, it always lag..
Quote:
Originally Posted by YouAreTarded
1- Its Encryption, not Encoding < no! not the same thing!! >
2- You have here all functions you need in C++
( nobody will convert it for you, stop be lazy and start doing things by yourself )

|
Ok  i was sending raw packet, now only find some method to encrypt password, i never saw c++ and i dont know how to translate it into c# i am not so lazy i only dont know it.
|
|
|
04/09/2016, 17:49
|
#4
|
elite*gold: 0
Join Date: Apr 2016
Posts: 52
Received Thanks: 19
|
Quote:
Originally Posted by lika85
I from that make dll and insert it into my program but, bigger problem is, if i send packet and then try to read, it always lag..
Ok  i was sending raw packet, now only find some method to encrypt password, i never saw c++ and i dont know how to translate it into c# i am not so lazy i only dont know it.
|
 - This website exists to be used!
|
|
|
04/09/2016, 17:52
|
#5
|
elite*gold: 0
Join Date: Oct 2011
Posts: 4,608
Received Thanks: 675
|
Quote:
Originally Posted by YouAreTarded
 - This website exists to be used! 
|
Cryless is that u?
|
|
|
04/09/2016, 18:53
|
#6
|
elite*gold: 0
Join Date: Sep 2013
Posts: 161
Received Thanks: 93
|
Quote:
Originally Posted by Bombasticx3
Cryless is that u?
|
pfff... stahp just look at this nick XD
|
|
|
04/09/2016, 21:21
|
#7
|
elite*gold: 0
Join Date: Jan 2016
Posts: 36
Received Thanks: 0
|
Please guys, have anyone encryption and decryption functions in C#? I am trying to translate it from php and c++ and its still not working..
Code:
public string packet_enc(string packet)
{
byte[] ret = new byte[packet.Length];
for (int i = 0; i < packet.Length; i++) { ret[i] = (byte)((int)packet[i] + 15); }
return ByteArrayToString(ret);
}
public string packet_dec(byte[] packet, int bytes)
{
string dec = string.Empty;
char[] chars = new char[bytes];
int test = 0;
for (int i = 0; i < bytes; i++)
{
chars[(int)i] = (char)(packet[(int)i]);
test = (((int)chars[i] - 15) ^ 195);
if (test < 0) test = (test % 256) + 256;
dec += (char)test;
}
return dec;
}
public string password_enc(string password)
{
Random rnd = new Random();
string str_hex=ToHex(password).ToUpper();
int pos = rnd.Next(0, 22);
pos = 3;
byte[] secondtable = { 0x2E, 0x2A, 0x17, 0x4F, 0x20, 0x24, 0x47, 0x11, 0x5B, 0x37, 0x53,
0x43, 0x15, 0x34, 0x45, 0x25, 0x4B, 0x1D, 0x2F, 0x58, 0x2B, 0x32, 0x63 };
string pw_enc = ToHex(((char)secondtable[pos]).ToString()).ToUpper();
for (int i = 0; i < str_hex.Length;i+=2 )
{
pw_enc += ToHex(((byte)((secondtable[pos] + 240) / 4)).ToString()).ToUpper();
pw_enc += str_hex[i];
pw_enc += ToHex(((byte)(secondtable[pos] + 15)).ToString()).ToUpper();
pw_enc += str_hex[i + 1];
return pw_enc;
}
public string md5( string input)
{
MD5 md5Hash = MD5.Create();
byte[] data = md5Hash.ComputeHash(Encoding.UTF8.GetBytes(input));
StringBuilder sBuilder = new StringBuilder();
for (int i = 0; i < data.Length; i++)
{
sBuilder.Append(data[i].ToString("x2"));
}
return sBuilder.ToString();
}
|
|
|
04/09/2016, 22:09
|
#8
|
elite*gold: 0
Join Date: Jun 2013
Posts: 29
Received Thanks: 9
|
Edit..
|
|
|
 |
Similar Threads
|
[PHP] Encoding, chr, ord
05/20/2013 - Web Development - 2 Replies
Hi epvp!
Ich habe in PHP einen String,
Gwujw¢M}{p}¨Sƒvƒ®
die Unicode/Ascii-repräsentation des Strings ist
71|119|117|106|119|162|77|125|123|112|125|168|83| 402|129|118|402|174
|
[Release] +5500 Packets structure , client/packets constants
10/07/2012 - CO2 PServer Guides & Releases - 10 Replies
edit : if u know nothing about packets go to this post first
explaining what is packets , and explaining a packet with details and everything
http://www.elitepvpers.com/forum/co2-pserver-disc ussions-questions/2162344-packets-packets-packets. html#post19074533
i start making my very own packet structure to use them on my new proxy but i thought of ripping them from the source
so yeah the following packets is ripped of trinity base source
right now im just providing the packets structure...
|
[Packets] Wie änder ich flyff packets?
07/16/2011 - Flyff Private Server - 19 Replies
HeyHo,
Ich würde sehr gerne wissen wie man die Flyff Packets ändert...
ich denke mal Zahlen ändern werden nicht ausreichen oder?
|
AFX H.264 Encoding
08/10/2009 - Video Art - 4 Replies
Hallo,
Also das Encoden ist bei AFX von den Einstellungen her ja ziemlich eingeschränkt...
Gibt es eine Möglichkeit diese Einstellungen zu erweitern?
Am besten wär jedoch ein AviSynth Plugin :p, um extern zu encoden.
Gibt es sowas?
Bedanke mich schonmal im Voraus.
|
Encoding problem :(
05/19/2008 - General Coding - 1 Replies
I have a problem with encoding when installing PostreSQL, when im choosing a encoding it says "It doesnt belong to my location! :mad: :mad:"
Can someone help me finding a encoding for my language, Norwegian!
Well, thats about it? Please respond quickly
:)
Thanks
|
All times are GMT +1. The time now is 08:20.
|
|