Jump to content
  • 0
Sign in to follow this  
Vincent

How can i handle Chat Message Strings

Question

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?

Share this post


Link to post
Share on other sites

5 answers to this question

Recommended Posts

  • 0

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.

Share this post


Link to post
Share on other sites
  • 0

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?

Share this post


Link to post
Share on other sites
  • 0

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.

Edited by KeyWorld

Share this post


Link to post
Share on other sites
  • 0

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?!

Edited by Vincent

Share this post


Link to post
Share on other sites
  • 0

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.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.