How can i handle Chat Message Strings

Vincent

New member
Messages
98
Points
0
Hello,

i want to know where and how the Server handle the Chatmessages that came from the Client?

For Example:

I captured with Wireshark the traffic from a Client to a Server.

String that was send to the server:

902b34522904744401960d1008004500003811db40003206234655d6fc1ac0a801061401c32e33bfb60599b028c2501800e5885e00008e001000436865636b6572203a203100
Then i try to decode it from hexadecimal to Text:

+4R)tD–E8Û@2#FUÖüÀ¨Ã.3¿¶™°(ÂPåˆ^ŽChecker : 1
As you can see only the Playername "Checker" and the Message "1" can be decode. The rest dont work. In what way the server decode the strings?

 
It's packet based.
 

<header><packet length (only if packet size is dynamic)><packet data>
 
So currently, yours is at the end:

8e001000436865636b6572203a203100
Where :

  • 8e00 is the packet id (0x8e)
  • 1000 is the packet size (0x10)
  • the rest is the message data.

 
Why did the server know that this is a Chatmessage? If i want to filter strings for the messagestring in what way i can do this? For what have i to look for at the strings?

 
It's know the packet based on it's packet id.

So if you want to parse it, you have at least to parse all packets to know where a packet start and end (or you need at least to know all packets size.

Basically in pseudo code:

function recv(buffer){ offset = 0; while (offset < length(buffer)) { packet_id = readshort( buffer, offset ); packet_size = packetsize[packet_id]; // store all packet size here // if packet length is -1, the packet size is dynamic // and the next short is the packet length. if (packet_size == -1) { packet_size = readshort( buffer, offset + 2 ); } // Want only the message packet if (packet_id === 0x8e) { message = readString( buffer, packet_size - 4); // (minus header + length) // do what you want with message } offset += packet_size; }}

It's a little more complex in fact, need to check if there is no overflow while parsing data, store the buffer and wait for the next buffer to arrive to join them.

Hope it help.

 
Last edited by a moderator:
yea thanks.

Last think how did the server know the string comes from the exe? I can also create a tool that send for example a string wher the player pick a MVP card?!

 
Last edited by a moderator:
The server know based on the socket id the client logged in authenticated by keys. So to use it, you have to hook the client.

About the mvp card. No.

The client ask to pick an id linked to a structure where is stored the item info and its position. You don't have access to this data in the packet.

Do not worry there is no known possible hack currently in the protocole.

There was hack in the past : teleportation, crash, buffer overflow. But currently no interesting things to do.

 
Back
Top