Jump to content

Arm to hex conversion then back to arm instruction seems weird


Go to solution Solved by xiaov,

6 posts in this topic

Recommended Posts

Posted (edited)

I'm trying to hack the number of saves in a game so it doesn't increment. It appears I found the right instruction, which originally read,

ADDS R0, #1 at text: 000520FA

I wanted to get offset, original value, and hacked value, so I highlighted entire instruction, hit "patch program/change word" in IDA, and it gave me offset, original value, then I entered my hacked hex that armconverter gave me when I entered

ADDS R0, #0 (Trying to add value of zero into Register 0 instead of incrementing 1)

Armconverter gave me the hex: 

0xE2911000 for that instruction

After entering that change, the resulting instruction in IDA (The ASRS that's highlighted) is totally different.  Any help would be greatly appreciated.

SWcT6pZ_d.jpg?maxwidth=640&shape=thumb&f

Edited to add: I'm using an arm64 binary, IDA x64, but used the 32 bit segment of armconverter because it's a 32 bit instruction.

Updated by i0s_tweak3r
img
Posted

Is that a thumb or arm binary?

 

Posted (edited)
37 minutes ago, DiDA said:

Is that a thumb or arm binary?

 

I think I see where I messed up. The thumb hex output is 0x0030, which is closer to original value.  It's thumb-2 I guess. That changes instruction to

MOVS R0, R6

If whatever's in R6=0, or the same value as before incrementing, it may be correct.

 

To answer question,

When I loaded binary it said it had both arm and thumb instructions. I thought maybe since the game was old that's why it didn't look like a typical arm64 binary.  

Also when trying to thin binary it gave "must be fat file" error typical of apps I download and crack on my arm64 device.

Going to test binary patch to see if it works...

Updated by i0s_tweak3r
Answering question better
Posted

Instead of trying to change instruction to ADDS R0, #0 would it be better to just NOP it? I prolly should've done that in the first place... (Since the instruction is telling it to do something I don't want to happen, and it should keep the R0 at same value then.)

  • Solution
Posted
1 hour ago, i0s_tweak3r said:

Instead of trying to change instruction to ADDS R0, #0 would it be better to just NOP it? I prolly should've done that in the first place... (Since the instruction is telling it to do something I don't want to happen, and it should keep the R0 at same value then.)

Mov r0,#0 = 0020

nop = c046

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...

Important Information

We would like to place cookies on your device to help make this website better. The website cannot give you the best user experience without cookies. You can accept or decline our cookies. You may also adjust your cookie settings. Privacy Policy - Guidelines