Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Generate packet Header from client

Junior Spellweaver
Joined
Mar 16, 2013
Messages
167
Reaction score
19
I'm trying to generate packets from client to send it to the server, and I'm stuck at the algorithm to generate the packet's header.
The following code works to generate packet's header at server-side:
Code:
var a = sequence[2] | sequence[3] << 8;

a ^= -(_mapleVersion + 1);
var b = a ^ length;

data[0] = a & 0xFF;

data[1] = (a >>> 8) & 0xFF;

data[2] = b & 0xFF;

data[3] = (b >>> 8) & 0xFF;

Sadly, this code doesn't work with client-side..
Browsing the source code of a packet sender by @Diamondo25, he currently have a different function to generate client and server headers, and his code to do the client-side is:
Code:
public byte[] getHeaderToServer(intsize)        {
    byte[] header = new byte[4];
    int a = IV[3] * 0x100 + IV[2];
    a = a ^ (_mapleVersion);
    int b = a ^ size;
    header[0] = Convert.ToByte(a % 0x100);
    header[1] = Convert.ToByte(a / 0x100);
    header[2] = Convert.ToByte(b % 0x100);
    header[3] = Convert.ToByte(b / 0x100);
    return header;

}
I tried to convert this to js, but didn't worked well.
How can this be done? (javascript)
 
Last edited:
Everything is possible~
Loyal Member
Joined
Jan 9, 2008
Messages
818
Reaction score
847
Oh man, using DPS tool i made years ago, which was based of MapleLib, is not the best source for this nowdays.
I think this is more related to what you are doing:
 
Upvote 0
Back
Top