• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

CM_MOVE decrypt to big number randomly

Initiate Mage
Joined
Nov 28, 2021
Messages
3
Reaction score
0
hi ^^ i have player in game and when i move i get 0xF2 opcode for CM_MOVE but with little of jumping and moving around it change from 0xF2 to big number like 0xD2C4 and scrambles all opcode onward until it disconnected me

do you know what is the cause for this? I look at my code for more than 3 month and never have I figured this problem :scared:
 
Experienced Elementalist
Joined
Aug 6, 2021
Messages
220
Reaction score
55
Essentially there are two keys you encrypt with, one is for the server packets to send to the client and the other is to decrypt the client packets the server receives.

These keys are changed each time a game server/client packet is encrypted or decrypted. If done incorrectly it will create a cascading effect where-by the offset is not correct and that means the key is then modified differently and ultimately the packet data becomes jumbled as you've experienced.

You mentioned moving around when it happens which is a possible indicator that your array offset used in the decryption function is short lived. This is purely a guess based on my experience with rebuilding the encryption in my own project. There is an array offset that will start at 2 and a position that will start at 0. as you encrypt and decrypt the packet data, dependent on the size, the offset will increase and decrease.

Motion type packets are 20-40 bytes offset but some packets such as SM_INVENTORY_INFO or whatever its called can be upwards of 2-4k+ bytes offset which is more than enough to throw off your decryption and will cause this type of problem. This is an educated guess, without seeing your code I can't tell you what it is definitively. I'd say go check the offset first, if it's static, it won't work.

If you want further help, post some code snippets of the decryption function, maybe I can spot something obvious.
 
Upvote 0
Initiate Mage
Joined
Nov 28, 2021
Messages
3
Reaction score
0
Essentially there are two keys you encrypt with, one is for the server packets to send to the client and the other is to decrypt the client packets the server receives.

These keys are changed each time a game server/client packet is encrypted or decrypted. If done incorrectly it will create a cascading effect where-by the offset is not correct and that means the key is then modified differently and ultimately the packet data becomes jumbled as you've experienced.

You mentioned moving around when it happens which is a possible indicator that your array offset used in the decryption function is short lived. This is purely a guess based on my experience with rebuilding the encryption in my own project. There is an array offset that will start at 2 and a position that will start at 0. as you encrypt and decrypt the packet data, dependent on the size, the offset will increase and decrease.

Motion type packets are 20-40 bytes offset but some packets such as SM_INVENTORY_INFO or whatever its called can be upwards of 2-4k+ bytes offset which is more than enough to throw off your decryption and will cause this type of problem. This is an educated guess, without seeing your code I can't tell you what it is definitively. I'd say go check the offset first, if it's static, it won't work.

If you want further help, post some code snippets of the decryption function, maybe I can spot something obvious.

oh yes i see index set to 0 i do some testing this is something with the backing array for the nio byte buffers
this help me ty :)
 
Upvote 0
Back
Top