need help with checksum

12/24/2009 13:57 zzany#1
Saweet a long time ago posted this on the forum

[Only registered and activated users can see links. Click Here To Register...]

now,im an old fashion guy.it's a lot easer for me to calculate hex numbers with a pen&paper(and claculetor if needed) then using C+ or VB.(i never wrote a single file in them..mybe 1 or 2).
so if any1 can just explain to me .what is the mathematical fonction he used to find the checksum in his post.ill be greatfull.(i couldn't follow his command lines). at first it sound like he just sumed the numbers,but the total is wrong if u do that.
12/24/2009 14:28 Scotticus#2
Google is your friend :)
12/27/2009 19:21 saweet#3
# infraction and ban request for cnjumpstart

The code for generating a checksum is very basic and simple. Like you said, it just sums every byte against the previous except the last 2. It then inserts that value into buffer[0] - 2, remember buffer[0] contains the length of the packet. It is not modifying buffer[0] - 1. Because that is where the client sent index gets put.

Where to get the client sent index? You get the client sent index by sniffing the server packet ID 0x0. The client sent index will be the 3rd byte if the packet length is 4 bytes.
12/28/2009 01:47 zzany#4
ok thx.got it now :)