Jump to content

Hacking with GDB Breakpoints


Ted2

25 posts in this topic

Recommended Posts

Hi! :D

This tutorial is gonne be hacking with GDB Breakpoints.

Read & study this tutorial by @shmoo about strings first, cause it's really necessarily.
https://iosgods.com/topic/26584-ida-tutorialhow-to-hack-with-strings/

 

Breakpoints are extremely useful, once your breakpoint gets hit the game will freeze.

You probably think, why the f*** is that useful you stupid b****

Well, now you can read which registers hold what value, you can see back traces (functions/places that are also called once breakpoint was hit), you can read memory & allot more.
They are also useful if you aren't sure if you're at the right place, for example you had a string called Coins & did some xReffing & you end up somewhere but you're not sure if it's anything useful. What you can do now, is set a breakpoint on the offset you are in IDA & make a change in the coins.
If the place where you were in IDA has anything to do with coins, the game should freeze when you make a change in coins.

Requirements
- GDB, repo: https://shmoo419.github.io/
- IDA, get it from the forum.
- A Game (or use my example game):
https://itunes.apple.com/nz/app/war-heroes-top-strategy-games/id1142744199?mt=8
- Some experience with strings & ARM

Crack the binary & load the binary into IDA & wait till it's done.

This game I'm hacking is some sort of game like Clash Of Royale.
You have 3 towers, or whatever they're called.
The middle one, is the most important one. If that one is broken aka dead, you win.
You have 4 cards you can make use of, each has it's own damage amount.

So, what we're going to try is hack the damage of a card.
There's not really a specific way of finding such a thing.
Some games have obvious strings & some games have not.

To open strings window in IDA, you go to: View - Open Sub Views - Strings
If I search for the word "damage", I'm getting 50 results, not that much but still a struggle to read.
I like to click on the "Length" button in IDA, so it sorts the results & it's much cleaner:

Spoiler

5qc5CN8.png

 

I like to go from top through bottom, so let's double click the first string & xRef it:

Spoiler

2mQI10i.png

 

If you don't know what xRef means, please read shmoo's tutorial on strings & come back later.

When I click the first result, I've some sub_x functions around the string

The ones with a straight red line are from the damageReduction string, the other are from damage string:

Spoiler

Amv2mfZ.png

 

I like to think sub_x functions with more than 70 xRefs are useless. (XRefs is just to see where the function is getting used by other functions)
However, sometimes function look interesting & you might want to try them out anyways.
It's really just experience that will tell your brain whether the function can be useful or no.

The sub_10000F7F0 & sub_100012158 have too many xRefs, first one above 300 & the other above 900.
You don't wanna modify a function that is getting used/called in another 300 functions.
Neither would a developer code a damage function that is getting used in another 300 functions, cause that would likely cause instability.

However, the sub_100190A78 has only one xRef & sub_100190A8C has only one xRef too.
sub_100190A8C seems to be for the damage_reduction string (sounds useful too tho).
But let's focus on sub_100190A78:

Spoiler

adLJknq.png

 

It's a really short function.
 

STR W1, [X0,#0x2C] // Store whatever value W1 is holding into X0+0x2C
RET               // RETurn the function (end it).

 

Alright, we aren't sure whether this function is the right one for damage or not.
We have two options:
1. Try modify the function & see what happens
2. Set a breakpoint on the function & see if it hits.

While some people may recommend option 1 because they don't know how to use a debugger, I don't.
Cause if you keep trying without debugging it CAN be a LONG LONG night, however sometimes you just find it in the first try :p

So we are going to set a breakpoint on the function.
First you need to know this about arm64 binaries:
arm64 binaries have a ASLR Slide which can't be removed.
You have to make calculations in order to get the right offset.
IDA Offset + ASLR Slide with a Hex Calculator would do.

But since Shmoo has it's built in feature in gdb, you don't have to make any calculations.
Just this command in GDB & it will do it for you: set add-aslr-bp on

We need to actually start GDB first, open Putty & SSH into your device.
Then type "gdb" & hit enter & it should start.

Then you have to attach to the game, I recommend attaching with the PID but I think binary names are also supported.
How to find your PID: You can find it with GamePlayer, iGameGuardian etc or type this into your putty window: "ps ax | grep 'binary name'"
Attach command: attach "PID"

It will attach, it may show scary lines of "code" but that's normal. Aslong as your game froze, it's fine.
Type "continue" or "c" in short to unfreeze the game.

How to set a breakpoint:
Before you do, enter this command first: set add-aslr-bp on
Breakpoint command: break *0xoffset / b *0xofffset

For me that would be: break *0x100190A78. (see picture above, the sub_x functions is 100190A78)
Now let me play a match & see whether it hits or no.

So the game froze when the tower was hit, this is a good thing!
From here you can do multiply things:
- you can read registers (reading what for example W0, W1, W20 is holding at the time of the breakpoint being hit)
- you can read back traces to see which places where also called when the breakpoint was hit
- you can read memory

So let's read the registers by typing this command: "info registers" --> this will show all normal registers, "info all-registers" will also show float values.
Remember: X & W is basically the same, they'll hold the same value.
My X1 shows me it's 162, which is correct cause the enemies tower's health went down with 162.

Alright, so now we have to hack the damage amount.
If you may know, W23 & W29 hold huge ass values that never change.
If we store that value instead of our orignal value X1, we'll have a One Hit Kill :)

// ------- Original: -------
STR             W1, [X0,#0x2C]
RET

// ------- Hacked: ------
STR             W23, [X0,#0x2C]
RET

So I'm going to do this with code injection, I assumed you know how to do that, if not do research on the forum.

I compiled it with theos, installed it & I got a One Hit Kill :)

However, this function had only one instruction that could be hacked, so the part where we read the register wasn't really needed.

I'll make a video soon enough with an longer function example.

 

I hope you learned how to work with breakpoints & how you can read the registers.

Understand that this tutorial is absolutely noob, some games require allot of back tracing etc etc

 

Useful GDB Commands:

Auto Add Aslr To Breakpoint: add aslr-bp on
Breakpoint: break *0xIDAOffset or b *0xIDAOffset
Reading Normal Registers: info registers
Reading All Registers: info all-registers (usefull for floats, damage, health etc are most of times float)

Find more here: https://lldb.llvm.org/lldb-gdb.html

 

Updated by RudePerson
  • Like 7
  • Winner 4
Link to comment
Share on other sites

Quote from aforementioned tutorial: So we are going to set a breakpoint on the function.
First you need to know this about arm64 binaries:
arm64 binaries have a ASLR Slide which can't be removed, while armv7 can have it removed.

So that means while loading binary in IDA we have to load armv7 binary instead of arm64?

 

 

 

 

Link to comment
Share on other sites

3 minutes ago, MeSailesh7 said:

Quote from aforementioned tutorial: So we are going to set a breakpoint on the function.
First you need to know this about arm64 binaries:
arm64 binaries have a ASLR Slide which can't be removed, while armv7 can have it removed.

So that means while loading binary in IDA we have to load armv7 binary instead of arm64?

 

 

 

 

Nope! Armv7 is outdated, iOS 11 can't even run it anymore which means hacking armv7 is useless. I took armv7 as a example that you could remove aslr in the past. But maybe I should remove that sentences.

Link to comment
Share on other sites

14 minutes ago, RudePerson said:

Nope! Armv7 is outdated, iOS 11 can't even run it anymore which means hacking armv7 is useless. I took armv7 as a example that you could remove aslr in the past. But maybe I should remove that sentences.

Sentence removed as well haha....anyway thanks a lot mate....will try it today and I think if you are free we need some videos on ted2 youtube channel as well, it’s just an request from a subscriber ?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below. For more information, please read our Posting Guidelines.
Reply to this topic... Posting Guidelines

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Our picks

    • War Robots Multiplayer Battles v10.2.2 +1 Cheat
      Modded/Hacked App: War Robots Multiplayer Battles By PIXONIC GAMES LTD
      Bundle ID: com.pixonic.wwr
      iTunes Store Link: https://apps.apple.com/us/app/war-robots-multiplayer-battles/id806077016?uo=4


      Hack Features:
      - high jump height


      Non-Jailbroken & No Jailbreak required hack(s): https://iosgods.com/forum/79-no-jailbreak-section/
      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
      • 238 replies
    • Otherworld Mercenary Corps v1.1.7 +2 Cheats
      Modded/Hacked App: Otherworld Mercenary Corps By baobob lab
      Bundle ID: com.blb.ios.Mercenary
      iTunes Store Link: https://apps.apple.com/us/app/otherworld-mercenary-corps/id6471457105?uo=4


      Mod Requirements:
      - Jailbroken iPhone/iPad/iPod Touch.
      - iGameGod / Filza / iMazing or any other file managers for iOS.
      - Cydia Substrate, ElleKit, Substitute or libhooker depending on your jailbreak.
      - PreferenceLoader (from Cydia, Sileo or Zebra).


      Hack Features:
      - Damage Multiplier
      - Never Die


      Non-Jailbroken & No Jailbreak required hack(s): https://iosgods.com/forum/79-no-jailbreak-section/
      Modded Android APK(s): https://iosgods.com/forum/68-android-section/
      For more fun, check out the Club(s): https://iosgods.com/clubs/


      iOS Hack Download Link:

      Hidden Content
      Download Hack







      Installation Instructions:
      STEP 1: Download the .deb Cydia hack file from the link above. Use Safari/Google Chrome or other iOS browsers to download.
      STEP 2: Once the file has downloaded, tap on it and then you will be prompted on whether you want to open the deb with iGameGod or copy it to Filza.
      STEP 3: If necessary, tap on the downloaded file, and then, you will need to press 'Install' from the options on your screen.
      STEP 4: Let iGameGod/Filza finish the cheat installation. Make sure it successfully installs, otherwise see the note below.
      STEP 5: If the hack is a Mod Menu — which is usually the case nowadays — the cheat features can be toggled in-game. Some cheats have options that can be enabled from your iDevice settings.
      STEP 6: Turn on the features you want and play the game. You may need to follow further instructions inside the hack's popup in-game.

       

      NOTE: If you have any questions or problems, read our Troubleshooting topic & Frequently Asked Questions & Answers topic. If you still haven't found a solution, post your issue down below and we'll do our best to help! If the hack does work for you, please post your feedback below and help out other fellow members that are encountering issues.


      Credits:
      - AlyssaX64


      Cheat Video/Screenshots:

      N/A
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 77 replies
    • Three Kingdoms Dynasty Archer v1.0.105 +4 Cheats
      Modded/Hacked App: Three Kingdoms Dynasty Archer By Suga Pte. Ltd.
      Bundle ID: co.imba.dynasty.archers
      iTunes Store Link: https://apps.apple.com/us/app/three-kingdoms-dynasty-archer/id6478194090?uo=4


      Mod Requirements:
      - Jailbroken iPhone/iPad/iPod Touch.
      - iGameGod / Filza / iMazing or any other file managers for iOS.
      - Cydia Substrate, ElleKit, Substitute or libhooker depending on your jailbreak.
      - PreferenceLoader (from Cydia, Sileo or Zebra).


      Hack Features:
      - Damage Multiplier
      - Defense Multiplier
      - Enemies Don't Attack
      - Enemies Don't Move


      Non-Jailbroken & No Jailbreak required hack(s): https://iosgods.com/forum/79-no-jailbreak-section/
      Modded Android APK(s): https://iosgods.com/forum/68-android-section/
      For more fun, check out the Club(s): https://iosgods.com/clubs/


      iOS Hack Download Link:

      Hidden Content
      Download Hack







      Installation Instructions:
      STEP 1: Download the .deb Cydia hack file from the link above. Use Safari/Google Chrome or other iOS browsers to download.
      STEP 2: Once the file has downloaded, tap on it and then you will be prompted on whether you want to open the deb with iGameGod or copy it to Filza.
      STEP 3: If necessary, tap on the downloaded file, and then, you will need to press 'Install' from the options on your screen.
      STEP 4: Let iGameGod/Filza finish the cheat installation. Make sure it successfully installs, otherwise see the note below.
      STEP 5: If the hack is a Mod Menu — which is usually the case nowadays — the cheat features can be toggled in-game. Some cheats have options that can be enabled from your iDevice settings.
      STEP 6: Turn on the features you want and play the game. You may need to follow further instructions inside the hack's popup in-game.

       

      NOTE: If you have any questions or problems, read our Troubleshooting topic & Frequently Asked Questions & Answers topic. If you still haven't found a solution, post your issue down below and we'll do our best to help! If the hack does work for you, please post your feedback below and help out other fellow members that are encountering issues.


      Credits:
      - AlyssaX64


      Cheat Video/Screenshots:

      N/A
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 58 replies
    • Kingdom Defender Idle RPG Game v1.1.14 +3 Cheats
      Modded/Hacked App: Kingdom Defender Idle RPG Game By Pitado Viet Nam JSC
      Bundle ID: com.zitga.kingdom.defender.idle.rpg.games
      iTunes Store Link: https://apps.apple.com/us/app/kingdom-defender-idle-rpg-game/id6480389471?uo=4


      Mod Requirements:
      - Jailbroken iPhone/iPad/iPod Touch.
      - iGameGod / Filza / iMazing or any other file managers for iOS.
      - Cydia Substrate, ElleKit, Substitute or libhooker depending on your jailbreak.
      - PreferenceLoader (from Cydia, Sileo or Zebra).


      Hack Features:
      - Damage Multiplier
      - Never Die
      - Unlimited Currencies -> Increase When Use


      Non-Jailbroken & No Jailbreak required hack(s): https://iosgods.com/forum/79-no-jailbreak-section/
      Modded Android APK(s): https://iosgods.com/forum/68-android-section/
      For more fun, check out the Club(s): https://iosgods.com/clubs/


      iOS Hack Download Link:

      Hidden Content
      Download Hack







      Installation Instructions:
      STEP 1: Download the .deb Cydia hack file from the link above. Use Safari/Google Chrome or other iOS browsers to download.
      STEP 2: Once the file has downloaded, tap on it and then you will be prompted on whether you want to open the deb with iGameGod or copy it to Filza.
      STEP 3: If necessary, tap on the downloaded file, and then, you will need to press 'Install' from the options on your screen.
      STEP 4: Let iGameGod/Filza finish the cheat installation. Make sure it successfully installs, otherwise see the note below.
      STEP 5: If the hack is a Mod Menu — which is usually the case nowadays — the cheat features can be toggled in-game. Some cheats have options that can be enabled from your iDevice settings.
      STEP 6: Turn on the features you want and play the game. You may need to follow further instructions inside the hack's popup in-game.

       

      NOTE: If you have any questions or problems, read our Troubleshooting topic & Frequently Asked Questions & Answers topic. If you still haven't found a solution, post your issue down below and we'll do our best to help! If the hack does work for you, please post your feedback below and help out other fellow members that are encountering issues.


      Credits:
      - AlyssaX64


      Cheat Video/Screenshots:

      N/A
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 25 replies
    • Age of Magic Cheats v2.22.2 +2 Cheats
      Modded/Hacked App: Age of Magic: Turn-Based RPG by Playkot Ltd
      Bundle ID: com.playkot.ageofmagic
      iTunes Store Link: https://apps.apple.com/us/app/age-of-magic-turn-based-rpg/id1175370741?uo=4&at=1010lce4


      Hack Features:
      - God Mode
      - Auto-Win


      Hack Download Link: https://iosgods.com/topic/98670-arm64-age-of-magic-cheats-v1236-2/
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 1,662 replies
    • The Seven Deadly Sins Cheats v2.55.0 +5
      Modded/Hacked App: The Seven Deadly Sins by Netmarble Corporation
      Bundle ID: com.netmarble.nanagb
      iTunes Store Link: https://apps.apple.com/us/app/the-seven-deadly-sins/id1475440231?uo=4&at=1010lce4


      Hack Features:
      - God Mode
      - OHK
      - Infinite MP


      iOS Hack Download Link: https://iosgods.com/topic/131686-arm64-the-seven-deadly-sins-cheats-v117-3/
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 1,922 replies
    • Tanks A Lot - 3v3 Brawls Cheats v6.800 +6
      Modded/Hacked App: Tanks A Lot - 3v3 Brawls by BoomBit, Inc.
      Bundle ID: com.boombitgames.TanksALot
      iTunes Store Link: https://apps.apple.com/us/app/tanks-a-lot-3v3-brawls/id1344713773?uo=4&at=1010lce4


      Hack Features:
      - God Mode
      - Infinite Ammo
      - No Reload
      - Speed Hacks
      - Disable Enemy Shield
      - No Skill Cooldown


      Hack Download Link: https://iosgods.com/topic/76001-arm64-tanks-a-lot-3v3-brawls-cheats-v190-6/
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 2,012 replies
    • Tap Tap Fish - AbyssRium v1.73.0 Jailed Cheats +3
      Modded/Hacked App: Tap Tap Fish - AbyssRium By SangHeon Kim
      Bundle ID: com.idleif.abyssrium
      iTunes Store Link: https://apps.apple.com/us/app/tap-tap-fish-abyssrium/id1068366937?uo=4


      Hack Features:
      - Infinite Vitality, Gem, etc ... (Increase When Used) / Untested with Pearl
      - Infinite Gems
      - Infinite Candy


      Hack Download Link: https://iosgods.com/topic/81389-tap-tap-fish-abyssrium-v1670-jailed-cheats-3/
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 235 replies
    • Zooba: Zoo Battle Royale Game v4.43.1 Jailed Cheats +2
      Modded/Hacked App: Zooba: Zoo Battle Royale Games By Wildlife Studios Limited
      Bundle ID: com.fungames.battleroyale
      iTunes Store Link: https://apps.apple.com/us/app/zooba-zoo-battle-royale-games/id1459402952?uo=4


      Hack Features:
      - Map Hacks
      - Allow Shoot in Water


      Jailbreak required hack(s): https://iosgods.com/topic/131104-arm64-zooba-zoo-battle-royale-game-cheats-all-versions-2/


      iOS Hack Download Link: https://iosgods.com/topic/131134-arm64-zooba-zoo-battle-royale-game-v320-jailed-cheats-2/
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 1,086 replies
    • Dragons: Rise of Berk v1.86.9 +6 Cheats
      Modded/Hacked App: Dragons: Rise of Berk By Jam City, Inc.
      Bundle ID: com.ludia.dragons
      iTunes Store Link: https://apps.apple.com/us/app/dragons-rise-of-berk/id667461862?uo=4


      Hack Features:
      - Free Shopping (shows original cost but able to purchase regardless)
      - Free Skipping
      - Free Odin's Market Shopping
      - Odin's Market Packs Never Reduce
      - Currency Hack [Spend to Gain - reverts to zero on next launch]
      - Enable Rider's Club


      Non-Jailbroken & No Jailbreak required hack(s):  https://iosgods.com/topic/79228-dragons-rise-of-berk-v1794-4-cheats-for-jailed-idevices/


      iOS Hack Download Link: https://iosgods.com/topic/139612-dragons-rise-of-berk-v1794-6-cheats/
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 598 replies
    • Chapters: Interactive Stories v1.9.8 +1 Cheats
      Modded/Hacked App: Chapters: Interactive Stories By Crazy Maple Studio, Inc.
      Bundle ID: com.mars.avgchapters
      iTunes Store Link: https://apps.apple.com/us/app/chapters-interactive-stories/id1277029359?uo=4



      Hack Features:
      - Freeze Tickets [read chapter for free]


      Non-Jailbroken & No Jailbreak required hack(s): https://iosgods.com/topic/138328-chapters-interactive-stories-v193-1-cheats-for-jailed-idevices/


      iOS Hack Download Link: https://iosgods.com/topic/137489-chapters-interactive-stories-v193-1-cheats/
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 334 replies
    • Minion Rush Cheats v10.1.0 +2 [ Free Store & Infinite Cards ]
      Modded/Hacked App: Minion Rush By Gameloft
      Bundle ID: com.gameloft.despicableme2
      iTunes Store Link: https://apps.apple.com/us/app/minion-rush/id596402997?uo=4


      Hack Features:
      - Free Store ( not Free iAP )
      * Allow purchase stuffs without having enough bananas or tokens


      iOS Hack Download Link: https://iosgods.com/topic/147752-minion-rush-cheats-v791-1/
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 530 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