- Joined
- May 29, 2007
- Messages
- 2,167
- Reaction score
- 898
Point Blanks / Project Blackout / Piercing blow uses binary packets with a header of 4 bytes.
This header contains the information of the packet data length and packet opcode (id). Both of these values are ushorts, which are both 2 bytes each. The rest of the packet is the content, the length of the content is based on the length that set inside the header. So the packet content's length is equal to the ushort value of the first 2 bytes.
Server packets are not encrypted at all, they are send directly without encryption. The client packets are 'encrypted' with a bit shift function. The bits of the packet are moved by x bits based on the offset that was sent in the first packet. The packet gets shifted with maximum 8 bits. I'm still not 100% sure of the offset so I use a static 'key' offset to calculate the bit shifting size.
The you can calculate the poop size by doing the following math:
There is always a bit shift of at least 1 bit. 8 bits at max. The last (or overflowing) bits are moved to the beginning.
This header contains the information of the packet data length and packet opcode (id). Both of these values are ushorts, which are both 2 bytes each. The rest of the packet is the content, the length of the content is based on the length that set inside the header. So the packet content's length is equal to the ushort value of the first 2 bytes.
Server packets are not encrypted at all, they are send directly without encryption. The client packets are 'encrypted' with a bit shift function. The bits of the packet are moved by x bits based on the offset that was sent in the first packet. The packet gets shifted with maximum 8 bits. I'm still not 100% sure of the offset so I use a static 'key' offset to calculate the bit shifting size.
The you can calculate the poop size by doing the following math:
Code:
shiftSize = ((offset) % 7) + 1
There is always a bit shift of at least 1 bit. 8 bits at max. The last (or overflowing) bits are moved to the beginning.