I always wondered how could a game generate a packet like this:
22 00 11 00 6D 79 75 73 65 72 6E 61 6D 65 00 00 00 00 00 00 6D 79 70 61 73 73 77 6F 72 64 00 00 00 00 00 00
LENGTH-HEADER-USERNAME-PASSWORD
In the game code what should be their function or how do they write something like that? Is it simply Encoding.ASCII.GetBytes("Some String Values")? Although I doubt it is written that way.
Every time I try to ask someone that, he thinks that I want to analyze packet. I don’t – I want to know what I need to do in order to create a packet like the one above, in C#.
Of course using a string builder is very far from packet structuring, you must use byte[] and append values to it by index.