Skip to content
Guest Big Announcement

Arm to hex conversion then back to arm instruction seems weird

Featured Replies

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

Solved by xiaov

  • Author
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

  • Author

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
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

Featured Content

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.