I am trying to reverse a simple code that gets a string and calculates it's checksum. I've been trying to understand every instruction, but they look different from what is said in arm documentation. Here's the full code(Using no$gba debugger)
I've reached the code knowing that once the checksum has been calculated it is stored in the r0 register. Docs specify that EOR receives 2 args, while here is taking 4. eor r3,r3,r0,asr 8h I've figured out that this will be something like r3 = (r3^r0)>>8 but I'm not really sure. In addition, C/C++ doesn't specify if the >> operator performs arithmetical or logical shifts (asr)
Same confusion is created with the mov's instructions. The sub inst. would be reversed in something like r2--; or r2=r2-1;
Thanks for your time.
EDIT: The checksum is 2 bytes long, and I am giving some examples:
String: AAAAAAB -- Checksum: 0xB649 (While debugging, write in little endian)
String: AAAAAAA -- Checksum: 0x68BC (NOTE: Checksum can't be worked out by performing operations with different checksum samples)