Packets

01/01/2011 08:39 PrototypeGaming#1
A few minutes ago, I decided to log the incoming packets in Project Manifest Source. This is my first time working with these packets, but I wanted to learn just incase I decide to downgrade/upgrade the source.

I created a character and looked at the character creation packet below. According to [Only registered and activated users can see links. Click Here To Register...] looking at version 4267's structure, the first two bytes' (Are they called bytes? Just want to make sure.) value is 60, but if I did my calculation correctly using the packet printed in the console its value is 104. 112 (104 + 8) should be the length of the packet. For the next two bytes, I got 1001 then after that I'm confused.

My questions are:
Quote:
-Why were the first two bytes' values different? Did it use a different structure that was not in the wiki?
-Using the character creation packet, can you break it down and show me how you get the values?
Account ID: test5
Password: test
Character Name: Hello

Code:
Loading... Please wait...
        Loaded 190 Lottery Items.
        Loaded 170 Compressed Data Maps.
        Loaded 357 Npcs Spawns.
        Loaded 18652 Monsters.
        Loaded 297 Monster Families.
Finished loading.
1C 00 1C 04 77 8E E3 EA 45 42 0F 00 7C 00 45 6E             ....w...EB..|.En
2C 81 58 FF 84 73 00 00 0A 00 00 00 54 51 53 65             ,.X..s......TQSe
72 76 65 72                                                 rver

68 00 E9 03 00 00 00 00 00 00 00 00 00 00 00 00             h...............
00 00 00 00 48 65 6C 6C 6F 00 00 00 00 00 00 00             ....Hello.......
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00             ................
00 00 00 00 EB 03 0A 00 77 8E E3 EA 32 43 38 31             ........w...2C81
35 38 46 46 38 34 37 33 00 00 00 00 00 00 00 00             58FF8473........
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00             ................
00 00 00 00 00 00 00 00 54 51 53 65 72 76 65 72             ........TQServer

1C 00 1C 04 77 8E E3 EA 45 42 0F 00 7C 00 45 6E             ....w...EB..|.En
2C 81 58 FF 84 73 00 00 0A 00 00 00 54 51 53 65             ,.X..s......TQSe
72 76 65 72                                                 rver

20 00 1A 27 45 42 0F 00 EA 03 00 00 8B B3 3C 06              ..'EB........<.
4A 00 00 00 B7 01 83 01 00 00 00 00 00 00 00 00             J...............
54 51 53 65 72 76 65 72                                     TQServer

20 00 1A 27 45 42 0F 00 FF FF FF FF D9 BF 3C 06              ..'EB........<.
68 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00             h...............
54 51 53 65 72 76 65 72                                     TQServer

20 00 1A 27 45 42 0F 00 00 00 00 00 D9 BF 3C 06              ..'EB........<.
4B 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00             K...............
54 51 53 65 72 76 65 72                                     TQServer

20 00 1A 27 45 42 0F 00 00 00 00 00 9D C9 3C 06              ..'EB........<.
4C 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00             L...............
54 51 53 65 72 76 65 72                                     TQServer

20 00 1A 27 45 42 0F 00 03 00 00 00 F7 C9 3C 06              ..'EB........<.
60 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00             `...............
54 51 53 65 72 76 65 72                                     TQServer

20 00 1A 27 45 42 0F 00 00 00 00 00 08 CB 3C 06              ..'EB........<.
4D 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00             M...............
54 51 53 65 72 76 65 72                                     TQServer

20 00 1A 27 45 42 0F 00 00 00 00 00 53 CB 3C 06              ..'EB......S.<.
4E 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00             N...............
54 51 53 65 72 76 65 72                                     TQServer

20 00 1A 27 45 42 0F 00 00 00 00 00 A5 CB 3C 06              ..'EB........<.
61 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00             a...............
54 51 53 65 72 76 65 72                                     TQServer

20 00 1A 27 45 42 0F 00 00 00 00 00 E7 CB 3C 06              ..'EB........<.
84 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00             ................
54 51 53 65 72 76 65 72                                     TQServer

20 00 1A 27 45 42 0F 00 FF FF FF FF 74 CD 3C 06              ..'EB......t.<.
68 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00             h...............
54 51 53 65 72 76 65 72                                     TQServer

20 00 1A 27 45 42 0F 00 B2 01 7E 01 60 F3 3C 06              ..'EB....~.`.<.
89 00 00 00 AE 01 7C 01 00 00 00 00 FF FF FF FF             ......|.........
54 51 53 65 72 76 65 72                                     TQServer

20 00 1A 27 45 42 0F 00 00 00 00 00 1F FC 3C 06              ..'EB........<.
60 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00             `...............
54 51 53 65 72 76 65 72                                     TQServer

20 00 1A 27 45 42 0F 00 B3 01 7C 01 28 00 3D 06              ..'EB....|.(.=.
89 00 00 00 B2 01 7E 01 00 00 00 00 FF FF FF FF             ......~.........
54 51 53 65 72 76 65 72                                     TQServer

20 00 FE 03 0F 04 3D 06 45 42 0F 00 D1 BB 0D 00              .....=.EB......
B3 01 7C 01 02 00 00 00 00 00 00 00 00 00 00 00             ..|.............
54 51 53 65 72 76 65 72                                     TQServer

0C 00 20 04 45 42 0F 00 02 00 00 00 54 51 53 65             .. .EB......TQSe
72 76 65 72                                                 rver

20 00 1A 27 45 42 0F 00 00 00 00 00 5A 12 3D 06              ..'EB......Z.=.
91 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00             ................
54 51 53 65 72 76 65 72                                     TQServer

30 00 EC 03 FF FF FF 00 DD 07 00 00 6F 00 00 00             0...........o...
00 00 00 00 00 00 00 00 04 05 48 65 6C 6C 6F 04             ..........Hello.
41 6C 6C 20 00 07 40 72 65 76 69 76 65 00 00 00             All ..@revive...
54 51 53 65 72 76 65 72                                     TQServer

30 00 EC 03 FF FF FF 00 DD 07 00 00 70 00 00 00             0...........p...
00 00 00 00 00 00 00 00 04 05 48 65 6C 6C 6F 04             ..........Hello.
41 6C 6C 20 00 07 40 72 65 76 69 76 65 00 00 00             All ..@revive...
54 51 53 65 72 76 65 72                                     TQServer

20 00 1A 27 45 42 0F 00 00 00 00 00 B5 5B 3D 06              ..'EB.......[=.
5E 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00             ^...............
54 51 53 65 72 76 65 72                                     TQServer

20 00 1A 27 45 42 0F 00 FF FF FF FF E6 5C 3D 06              ..'EB.......\=.
68 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00             h...............
54 51 53 65 72 76 65 72                                     TQServer
01/01/2011 12:57 Korvacs#2
Your looking at the 4267 client version packet, and compairing it to a 5135 client version packet, that answers all your questions, they arnt the same packet.
01/01/2011 17:54 pro4never#3
To expand on that just a little bit...

The first two bytes in the packet are the length value for the packet. They count how many bytes (it's bytes, not bits, they are different but w/e. Lots of ppl mix them up, myself included) the packet contains (without the 8 byte seal). As such the first two bytes will change VERY often for a few reasons.

#1: the packet changes... new values are added which means you need more bytes to send this new data and as such the packet length increases

#2: the packet size is variable (it has a count of objects being sent such as in an update packet or multi target spell packet) or it contains a variable length string (generally contains a byte preceding the string listing how long the string will be).

If you want some more info on packets I've provided some links in my packets/proxy thread which might help some. If not I can do my best to help with any questions you have on them (packets aren't tooo difficult to grasp... just takes a bit to think about them in the right way)