CM_MOVE decrypt to big number randomly

Results 1 to 3 of 3
  1. #1
    Novice aiondeveloper is offline
    MemberRank
    Nov 2021 Join Date
    3Posts

    angry CM_MOVE decrypt to big number randomly

    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


  2. #2
    Proficient Member StingerOne is offline
    MemberRank
    Aug 2021 Join Date
    AltgardLocation
    176Posts
    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.

  3. #3
    Novice aiondeveloper is offline
    MemberRank
    Nov 2021 Join Date
    3Posts
    Quote Originally Posted by StingerOne View Post
    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 :)



Advertisement