Jump to content

[IDA Tutorial] How to Disable Memory Checks


1,078 posts in this topic

Recommended Posts

Updated (edited)

When developers make a game, sometimes they include memory checks to make things harder to hack. But what are memory checks? Memory checks are checks to make sure that a certain value, for example, money has been hacked. If it has been hacked, the memory check will kick in and set it back to its original, unhacked value. This is why when you test in iGameGuardian, GDB, LLDB, etc. your hack will not work. But we want our hacks to work, so here is how to disable them :snoop: This is also only an example function :snoop:

Hidden Content

    General background info: R0 holds your previous value of money. R5 holds the cost. R10 holds the new value of money after you bought something. The IDA offset for money will be 0xA99F8: STR R10, [R6, #32].

    Here is the example function that I came up with:

    0xA99C0 CMP R0, R10 //compare R10 with R0
    0xA99C4 BLE 0xA99E8 //branch to 0xA99E8 if it is less than or equal to
    0xA99C8 LDR R0, [R6, #32] //load R6+32 into R0
    0xA99CC SUB R5, R0, R10 //subtract R0 (previous money value) with R5 (cost) and put that value into R10
    0xA99D0 MOV R0, R6 //move R6 into R0
    0xA99D4 BL 0x30E7B0 //branch with link to 0x30E7B0
    0xA99D8 ADD R1, R0, R5 //add R0 with R1 and put that value into R5
    0xA99DC MOV R0, R6 //move R6 into R0
    0xA99E0 BL 0x30E7C0 //branch with link to 0x30E7C0
    0xA99E4 MOV R0, R6 //move R6 into R0
    0xA99E8 BL 0x30E7D0 //branch with link to 0x30E7D0
    0xA99EC ADD R1, R0, R5 //add R0 with R1 and put that value into R5
    0xA99F0 MOV R0, R6 //move R6 into R0
    0xA99F8 STR R10, [R6, #32] //IDA offset, store R10 (new money value) into R6+32
    

              I'm sure you know that the equivalent of spending in a game is subtracting. Knowing that, logically you would change 0xA99CC to MOV R10, R7. And you are right for thinking that (y), but it won't work because of the memory check. Earlier you read that R0 holds the previous value of money, R5 holds cost, and R10 holds the new value after spending.

              So you want to look for a "CMP" (compare) instruction that compares the previous value of money with the new value of money that is followed by a branch to somewhere. If the branch is BGT (branch if greater than), BLT (branch if less than), BNE (branch if not equal), or BLE (branch if less than or equal to), you usually have found the memory check. And there is one, at the beginning of the function: 0xA99C0: CMP R0, R10 followed by 0xA99C4: BLE 0xA99F8, or our IDA offset. That is telling the game to compare R10 with R0 and branch to 0xA99C4, or our IDA offset, and store the unhacked money value into R6+32 if R10 is less than or equal to R0.

              To defeat the memory check, you can NOP the branch to 0xA99F8 (our IDA offset) or change CMP R0, R10 to CMP R0, R0 or CMP R10, R10 so that the memory check (the CMP R0, R10) occurs but has no effect because the branch is NOP'ed or it is comparing itself to itself. And now you can change the SUB R5, R0, R10 (0xA99CC) to MOV R10, R7, and it will work! :)

    Recap:
    - R0 holds our previous value of money, R5 holds cost, and R10 holds the new value of money.
    - Our IDA offset is 0xA99F8, STR R10, [R6, #32].
    - Memory checks usually compare an old value of something with a new value of something, followed by a branch. They usually are BNE's (branch if not equal), BGT's (branch if greater than), BLT (branch if less than), or BLE's (branch if less than or equal to)
    - You can NOP the branch after the CMP to disable memory checks, or you can change CMP RX, RY to CMP RX, RX or CMP RY, RY to compare values to itself rather than comparing values to another value.

    Extra info:
    - Never NOP a CMP before a branch because a branch is literally a true or false type of instruction, and by doing that it the game will write both true and false, which will result in a crash.
    - Breakpoints really help with memory checks, if you set a breakpoint on what you think is a memory check, you will know if you got it if it hits or not.
    - If a breakpoint for what you think is a memory check hits, type "info r" for GDB or "reg re" in LLDB. That will let you see what registers hold what, and you can determine if you found the memory check or not. For example, if what you think you've found the memory check for a CMP R0, R3 followed by a BNE (branch if not equal), and the registers R0 and R3 are equal to each other, you have probably found the memory check.
    - This only applies to you if NOP'ing the branch does not work, or if you just decide to hack the CMP. Always check if the CMP is in ARM or thumb, and patch accordingly. If you patch a thumb instruction with an ARM instruction the game will crash. But how will you know if it is in thumb or in ARM? What you have to do it highlight the hex in IDA then go to "Hex View 1". If the hex is like this:

    00 00 00 00
    

    it is in ARM, but if the hex is like this:

    00 00
    

    it is in thumb. Think of it like this: an arm is longer than a thumb, so logically hex in ARM will be longer than hex in thumb.



I hope this helped! Also be sure to ask any questions if you have any :)

Updated by Guest
Posted (edited)

let me see (y)

 

e ...

 

0xA99C0 CMP R0, R10 //compare R10 with R0
0xA99C4 BLE 0xA99E8 //branch to 0xA99E8 if it is less than or equal to

 

 

 

if R10 less or eq  R0,then branch to 0xA99E8..

so why you wrote 0xA99F8

 

is it wrong ?

Updated by zzmutu
  • Like 3
  • Thanks 3
  • Agree 2
  • Informative 1
Posted

let me see (y)

 

e ...

 

0xA99C0 CMP R0, R10 //compare R10 with R0

0xA99C4 BLE 0xA99E8 //branch to 0xA99E8 if it is less than or equal to

 

 

 

if R10 less or eq  R0,then branch to 0xA99E8..

so why you wrote 0xA99F8

 

is it wrong ?

It's not wrong, it should be like that :) 

 

You don't always have to branch to a function, you can also branch directily to offsets. 

Posted (edited)

lets see what took you over 1 hour to patch  :wallbash:


cant see any checks but anyway there are 3 ways to do what you want:

rGpKGk8.png

change cost to 0 

change your money on the load 

change the final money

Updated by iOSv64
  • Like 1
Posted (edited)

lets see what took you over 1 hour to patch :wallbash:

cant see any checks but anyway there are 3 ways to do what you want:

rGpKGk8.png

change cost to 0

change your money on the load

change the final money

Well it took me an hour because I was doing x/i in GDB because my SSH is screwed up, and yeah I knew that. I just wanted to hack the SUB because it was quicker

 

edit: actually, as a challenge for myself I could time myself and see how long it takes me to make the cost 0, thanks for that idea :)

Updated by Guest
Posted

Well it took me an hour because I was doing x/i in GDB because my SSH is screwed up, and yeah I knew that. I just wanted to hack the SUB because it was quicker

 

edit: actually, as a challenge for myself I could time myself and see how long it takes me to make the cost 0, thanks for that idea :)

there is also a 4th solution , just mov r0 #0 bx lr the whole function ahah
  • Like 2
  • Agree 1
Posted

there is also a 4th solution , just mov r0 #0 bx lr the whole function ahah

Oh yeah I forgot about that, I'm guessing that's how free store was done in FG: Quest for Stuff? (never tried it myself)

 

00207047

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
  • Our picks

    • Smoq Games 25 v5.01 +1 Cheat [ Unlimited Coins ]
      Modded/Hacked App: Smoq Games 25 By Edyta Smoktunowicz
      Bundle ID: com.fivedragonsgames.smoqgames25
      App Store Link: https://apps.apple.com/us/app/smoq-games-25/id6605931332?uo=4

       
       

      🤩 Hack Features

      - Unlimited Coins -> Earn some.
        • Winner
      • 0 replies
    • Tiny Reaper: Reborn v1.0.2 +4 Jailed Cheats [ God Mode + More ]
      Modded/Hacked App: Tiny Reaper: Reborn By DAERI SOFT
      Bundle ID: com.daerigame.babysasin
      App Store Link: https://apps.apple.com/us/app/tiny-reaper-reborn/id6739761698?uo=4

       


      🤩 Hack Features

      - God Mode
      - One-Hit Kill
      - No Skill Cooldown
      - Dumb Enemies
        • Haha
        • Winner
      • 1 reply
    • Thronefall - A Little Kingdom v2.12.7 +5 Jailed Cheats [ Damage & Defence ]
      Modded/Hacked App: Thronefall - A Little Kingdom By Doghowl Games Ltd
      Bundle ID: com.doghowlgames.thronefall
      App Store Link: https://apps.apple.com/us/app/thronefall-a-little-kingdom/id6744029320?uo=4

       


      🤩 Hack Features

      - Damage Multiplier
      - Defence Multiplier
      - God Mode
      - Unlimited Coins -> Will increase instead of decrease.
      - Free In-App Purchases
        • Informative
        • Agree
        • Thanks
        • Winner
        • Like
      • 19 replies
    • Thronefall - A Little Kingdom v2.12.7 +5 Cheats [ Damage & Defence ]
      Modded/Hacked App: Thronefall - A Little Kingdom By Doghowl Games Ltd
      Bundle ID: com.doghowlgames.thronefall
      App Store Link: https://apps.apple.com/us/app/thronefall-a-little-kingdom/id6744029320?uo=4

       


      🤩 Hack Features

      - Damage Multiplier
      - Defence Multiplier
      - God Mode
      - Unlimited Coins -> Will increase instead of decrease.
      - Free In-App Purchases
        • Agree
        • Thanks
        • Winner
        • Like
      • 16 replies
    • Subway Surfers City v1.24.0 +10 Jailed Cheats [ Unlimited Currencies ]
      Modded/Hacked App: Subway Surfers City By Sybo Games ApS
      Bundle ID: com.sybogames.subway.surfers.game
      iTunes Store Link: https://apps.apple.com/ca/app/subway-surfers-city/id6504188939?uo=4


      Mod Requirements:
      - Non-Jailbroken/Jailed or Jailbroken iPhone/iPad/iPod Touch.
      - Sideloadly / Cydia Impactor or alternatives.
      - A Computer Running Windows/macOS/Linux with iTunes installed.


      Hack Features:
      - Unlimited Coins -> Earn or spend some.
      - Unlimited Keys -> Earn or spend some.
      - Unlimited Revives - Earn or spend some.
      - Unlimited Tokens -> Earn or spend some.
      - All Boards Unlocked
      - All Surfers Unlocked
      - Max Level -> Earn some XP.
      - God Mode
      - Unlimited Score
      - Unlimited Jumps


      Jailbreak required hack(s): [Mod Menu Hack] Subway Surfers City v1.13.2 +7 Cheats [ Unlimited Currencies ] - Free Jailbroken Cydia Cheats - iOSGods
      Modded Android APK(s): https://iosgods.com/forum/68-android-section/
      For more fun, check out the Club(s): https://iosgods.com/clubs/
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 198 replies
    • Subway Surfers City v1.24.0 +10 Cheats [ Unlimited Currencies ]
      Modded/Hacked App: Subway Surfers City By Sybo Games ApS
      Bundle ID: com.sybogames.subway.surfers.game
      iTunes Store Link: https://apps.apple.com/ca/app/subway-surfers-city/id6504188939?uo=4


      Hack Features:
      - Unlimited Coins
      - Unlimited Keys
      - Unlimited Revives
      - All Boards Unlocked
      - All Surfers Unlocked
      - Max Level -> Earn some XP.
      - God Mode


      Non-Jailbroken & No Jailbreak required hack(s): [Non-Jailbroken Hack] Subway Surfers City v1.13.2 +5 Jailed Cheats [ Unlimited Currencies ] - Free Non-Jailbroken IPA Cheats - iOSGods
      Modded Android APK(s): https://iosgods.com/forum/68-android-section/
      For more fun, check out the Club(s): https://iosgods.com/clubs/
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 61 replies
    • Tiny Reaper: Reborn v1.0.2 +4 Cheats [ God Mode + More ]
      Modded/Hacked App: Tiny Reaper: Reborn By DAERI SOFT
      Bundle ID: com.daerigame.babysasin
      App Store Link: https://apps.apple.com/us/app/tiny-reaper-reborn/id6739761698?uo=4

       


      🤩 Hack Features

      - God Mode
      - One-Hit Kill
      - No Skill Cooldown
      - Dumb Enemies
        • Winner
        • Like
      • 3 replies
    • Star Wars™: Galaxy of Heroes Cheats v0.36.7 +8
      Modded/Hacked App: Star Wars™: Galaxy of Heroes By Electronic Arts
      Bundle ID: com.ea.starwarscapital.bv
      iTunes Link: https://itunes.apple.com/us/app/star-wars-galaxy-of-heroes/id921022358?mt=8&uo=4&at=1010lce4


      Mod Requirements
      - Jailbroken iPhone/iPad/iPod Touch.
      - iFile / Filza / iFunBox / iTools or any other file managers for iOS.
      - Cydia Substrate (from Cydia).
      - PreferenceLoader (from Cydia).


      Hack Features
      - No Skill Cooldown time / Skill Always Available. Linked with enemy. Enable when it's your turn, disable when it's enemies turn. Timing is key.
      - One Hit Kill / Very High Damage. This is linked with you and the enemy, use with Skip Enemy Turn feature or enable disable when you attack via the In-Game Mod Menu! Do not kill the last enemy with OHK otherwise the game will crash. This feature is only for x64 or ARM64 iDevices: iPhone 5s, 6, 6 Plus, 6s, 6s Plus, 7, 7 Plus, iPod Touch 6G, iPad Air, Air 2, Pro & iPad Mini 2, 3, 4 and later.
      - Always Your Turn / Skip Enemy Turn. It's always your turn, you're always attacking.
      - Auto Win. You must use this with One Hit Kill in order for it to work. Kill 1 Enemy and you will auto win the battle.
      - Only 1 Encounter on All Missions.
      -- God Mode / Never Die thanks to the features above.

      This hack is now an In-Game Mod Menu. This means you can toggle switches on/off while in a fight. Since God Mode is linked, turn it off when you're attacking and turn it on when the enemy is attacking to do damage but not receive damage. Same goes for the other features.
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 3,128 replies
    • CSR 2 Drag Racing Car Games v5.8.0 - [ Gold, Cash, Keys & More ]
      Modded/Hacked App: CSR 2 - Realistic Drag Racing By Zynga Inc.
      Bundle ID: com.naturalmotion.customstreetracer2
      iTunes Store Link: https://apps.apple.com/us/app/csr-2-realistic-drag-racing/id887947640?uo=4

       

      📌 Mod Requirements

      - Jailbroken iPhone or iPad.
      - iGameGod / Filza / iMazing.
      - Cydia Substrate, ElleKit, Substitute or libhooker depending on your jailbreak (from Sileo, Cydia or Zebra).

       

      🤩 Hack Features

      - Custom Gold Amount -> Enter the amount of gold you want inside the iOSGods Mod Menu!
      - Custom Cash Amount -> Enter the amount of cash you want inside the iOSGods Mod Menu!
      - Custom Keys Amount -> Enter the amount of keys you want inside the iOSGods Mod Menu!
      - Anti-Ban -> Also unbans previously banned accounts and lets you play online according to feedback.
      - No Fuel Consumption
      - Instant Part Delivery
      - Instant Car Delivery
      - Gold Increase
      - Cash Increase
      - Keys Increase
      - Buy Anything For 1 Gold
      - Buy Anything For 1 Cash

       

      Non-Jailbroken Hack: https://iosgods.com/topic/168529-csr-2-drag-racing-car-games-v551-4-jailed-cheats/

       

      ⬇️ iOS Hack Download Link: https://iosgods.com/topic/73095-csr-2-drag-racing-car-games-v561-gold-cash-keys-more/.
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 5,728 replies
    • Genshin Impact Cheats v5.7.0 +3
      Modded/Hacked App: Genshin Impact by miHoYo Limited
      Bundle ID: com.miHoYo.GenshinImpact
      iTunes Store Link: https://apps.apple.com/us/app/genshin-impact/id1517783697?uo=4&at=1010lce4


      Hack Features:
      - Instant Skill
      - Instant Special Skill (Elemental Burst)
      - Infinite Stamina
        + Infinite Sprint Time
        + Infinite Swim Time
        + Infinite Fly Time


      iOS Hack Download Link: https://iosgods.com/topic/134035-genshin-impact-cheat-v101-3-instant-skill-more/
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 3,637 replies
    • Modern Strike Online: War FPS Cheats v1.76.6 +10
      Modded/Hacked App: Modern Strike Online: War FPS By AZUR INTERACTIVE GAMES LIMITED
      Bundle ID: com.gamedevltd.modernstrikeonline
      iTunes Store Link: https://apps.apple.com/us/app/modern-strike-online-war-fps/id1197441484?uo=4


      Hack Features:
      - Radar Hack
      - Increase FireRate
      - Unlimited Ammo
      - No Spread
      - Night Vision Enabled
      - Instant Kill
      - God Mode
      - No FlashBang
      - Super Speed
      - No MedKit CoolDown

      Note:
      Not Responsible For Any Bans


      Non-Jailbroken & No Jailbreak required hack(s): https://iosgods.com/topic/186634-modern-strike-online-war-fps-v1687-jailed-cheats-10/


      iOS Hack Download Link: https://iosgods.com/topic/186633-modern-strike-online-war-fps-cheats-v1693-10/
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 89 replies
    • Township: Farm & City Building v28.1.0 Jailed Cheats +2
      Modded/Hacked App: Township by PLR Worldwide Sales Limited
      Bundle ID: com.playrix.township-ios
      iTunes Store Link: https://apps.apple.com/us/app/township/id638689075?uo=4&at=1010lce4


      Hack Features:
      - Freeze Currencies

      EDIT: Please be aware that this maybe cause your account banned, please use with caution and don’t abuse


      iOS Hack Download Link: https://iosgods.com/topic/116584-arm64-township-farm-city-building-v852-jailed-cheats-2/
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 1,692 replies
×
  • 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