Jump to content

Hacking with GDB Breakpoints


25 posts in this topic

Recommended Posts

Updated (edited)

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
Posted

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?

 

 

 

 

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

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

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

    • Call of Antia: Match 3 RPG v4.0.21 +2 Jailed Cheats
      Modded/Hacked App: Call of Antia: Match 3 RPG By FunPlus International AG
      Bundle ID: com.funplus.coa
      App Store Link: https://apps.apple.com/us/app/call-of-antia-match-3-rpg/id1583719419?uo=4

       

       

      📌 Mod Requirements

      - Non-Jailbroken/Jailed or Jailbroken iPhone or iPad.
      - Sideloadly or alternatives.
      - Computer running Windows/macOS/Linux with iTunes installed.

       

      🤩 Hack Features

      - Damage Multiplier
      - Defense Multiplier

       

      ⬇️ iOS Hack Download IPA Link


      Hidden Content
      React or reply to this topic to see the <a href='https://iosgods.com/topic/3762-info-how-to-unlockview-the-hidden-content-on-iosgods/#findComment-78119'>hidden content & download link</a>. 👀







       

      📖 PC Installation Instructions

      STEP 1: Download the pre-hacked .IPA file from the link above to your computer. To download from the iOSGods App, see our iOSGods App IPA Download Tutorial which includes a video example.
      STEP 2: Download Sideloadly and install it on your Windows or Mac.
      STEP 3: Open Sideloadly on your computer, connect your iOS device, and wait until your device name appears in Sideloadly.
      STEP 4: Once your iDevice is recognized, drag the modded .IPA file you downloaded and drop it into the Sideloadly application.
      STEP 5: Enter your Apple Account email, then press “Start.” You’ll then be asked to enter your password. Go ahead and provide the required information.
      STEP 6: Wait for Sideloadly to finish sideloading/installing the hacked IPA. If there are issues during installation, please read the note below.
      STEP 7: Once the installation is complete and you see the app on your Home Screen, you will need to go to Settings -> General -> Profiles / VPN & Device Management. Once there, tap on the email you entered from step 6, and then tap on 'Trust [email protected]'.
      STEP 8: Now go to your Home Screen and open the newly installed app and everything should work fine. You may need to follow further per app instructions inside the hack's popup in-game.

      NOTE: iOS/iPadOS 16 and later, you must enable Developer Mode. For free Apple Developer accounts, you will need to repeat this process every 7 days. If you have any questions or problems, read our Sideloadly FAQ section of the topic and if you don't find a solution, please post your issue below and we'll do our best to help! If the hack does work for you, post your feedback below and help out other fellow members that are encountering issues.

       

      🙌 Credits

      - AlyssaX64

       

      📷 Cheat Video/Screenshots

      N/A
        • Informative
        • Like
      • 7 replies
    • Call of Antia: Match 3 RPG v4.0.21 +2 Cheats
      Modded/Hacked App: Call of Antia: Match 3 RPG By FunPlus International AG
      Bundle ID: com.funplus.coa
      App Store Link: https://apps.apple.com/us/app/call-of-antia-match-3-rpg/id1583719419?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

      - Damage Multiplier
      - Defense Multiplier

       

      ⬇️ iOS Hack Download Link


      Hidden Content
      React or reply to this topic to see the <a href='https://iosgods.com/topic/3762-info-how-to-unlockview-the-hidden-content-on-iosgods/#findComment-78119'>hidden content & download link</a>. 👀







       

      📖 iOS Installation Instructions

      STEP 1: Download the .deb 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 needed, tap on the downloaded file again, then select ‘Normal Install’ from the options on your screen.
      STEP 4: Let iGameGod/Filza finish the cheat installation. If it doesn’t install successfully, see the note below.
      STEP 5: Open the game, log in to your iOSGods account when asked, then toggle on the features you want and enjoy!

       

      NOTE: If you have any questions or problems, read our Jailbreak iOS Hack Troubleshooting & Frequently Asked Questions & Answers topic. If you still haven't found a solution, post your issue 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

       

      More iOS App Hacks
      If you’re looking for Non-Jailbroken & No Jailbreak required iOS IPA hacks, visit the iOS Game Cheats & Hacks or the iOSGods App for a variety of modded games and apps for non-jailbroken iOS devices.

      Modded Android APKs
      Need modded apps or games for Android? Check out the latest custom APK mods, cheats & more in our Android Section.
        • Agree
        • Like
      • 8 replies
    • Superhero Idle: Strike League v0.11.2 [+6 Jailed Cheats]
      Modded/Hacked App: Superhero Idle: Strike League By Midnite SRL
      Bundle ID: games.midnite.sid
      App Store Link: https://apps.apple.com/us/app/superhero-idle-strike-league/id6449540121?uo=4



      🤩 Hack Features

      - Never Die
      - One Hit Kill
      - Freeze Currency (Always Will Increase Cash, Gem)
      - Unlimited Skip Ads
      - Activate ViP
      - No Ads
        • Like
      • 0 replies
    • Superhero Idle: Strike League v0.11.2 [+6 Cheats]
      Modded/Hacked App: Superhero Idle: Strike League By Midnite SRL
      Bundle ID: games.midnite.sid
      App Store Link: https://apps.apple.com/us/app/superhero-idle-strike-league/id6449540121?uo=4



      🤩 Hack Features

      - Never Die
      - One Hit Kill
      - Freeze Currency (Always Will Increase Cash, Gem)
      - Unlimited Skip Ads
      - Activate ViP
      - No Ads
        • Like
      • 1 reply
    • Smash Hit v1.5.6 Jailed Cheats +2
      Modded/Hacked App: Smash Hit By Mediocre AB
      Bundle ID: com.mediocre.smashhit
      iTunes Store Link: https://apps.apple.com/us/app/smash-hit/id603527166?uo=4


      Hack Features:
      - Unlimited Balls
      - Free iAP (Turn on inside iOSGods Mod Menu first)


      Jailbreak required hack(s): https://iosgods.com/topic/74991-smash-hit-cheats-v142-1/


      Hack Download Link: https://iosgods.com/topic/74993-smash-hit-v150-jailed-cheats-2/
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 297 replies
    • Gangstar Vegas Cheats v8.4.0 +4
      Modded/Hacked App: Gangstar Vegas - Mafia action By Gameloft
      Bundle ID: com.gameloft.gangstar4
      iTunes Store Link: https://apps.apple.com/us/app/gangstar-vegas-mafia-action/id571393580?uo=4

       

      📌 Mod Requirements

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

       

      🤩 Hack Features

      - Infinite Currencies
      - Infinite Run ( To stop running turn off in menu then click run again )
      - Infinite Ammo / No Reload ( Required re-launching the game after purchasing new gun and enabled in menu before load into the game )
      - No Cops


      NOTE: Turn off wifi before playing


      🍏 For Non-Jailbroken & No Jailbreak required hacks: https://iosgods.com/topic/166702-gangstar-vegas-mafia-action-v791-jailed-cheats-3/

       

      ⬇️ iOS Hack Download Link: https://iosgods.com/topic/147734-gangstar-vegas-cheats-v800-4/
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 1,003 replies
    • Into The Dead 2 Cheats v1.78.0 +11
      Modded/Hacked App: Into the Dead 2 By Prodigy Design Limited T/A Sidhe Interactive
      Bundle ID: com.pikpok.dr2.iosstore
      iTunes Store Link: https://itunes.apple.com/us/app/into-the-dead-2/id1151220243?mt=8&uo=4&at=1010lce4



      Hack Features:
      - Infinite Ammo
      - No Reload
      - One Shot Kill
      - Infinite Grenade
      - No Grenade Cooldown
      - Insane Explotion Radius after Throw Grenade
      - No Collision (God Mode)
      - Infinite Stamnia
      - ViP Services
      - Infinite Silver
      - Infinite Gold


      Hack Download Link: https://iosgods.com/topic/73337-arm64-into-the-dead-2-cheats-v1141-11/
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 1,576 replies
    • Candy Crush Soda Saga Cheats v1.294.2 +3
      Modded/Hacked App: Candy Crush Soda Saga By King.com Limited
      Bundle ID: com.midasplayer.apps.candycrushsodasaga
      iTunes Store Link: https://apps.apple.com/us/app/candy-crush-soda-saga/id850417475?uo=4

       

      🔧 Mod Requirements

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

       

      🚀 Hack Features

      - Freeze Moves
      - Freeze Lives
      - Freeze Boosters


      🍏 For Non-Jailbroken & No Jailbreak required hacks: https://iosgods.com/topic/191667-candy-crush-soda-saga-v12861-jailed-cheats-3/

       

      📥 iOS Hack Download Link: https://iosgods.com/topic/191666-candy-crush-soda-saga-cheats-v12873-3/
        • Agree
        • Haha
        • Winner
        • Like
      • 15 replies
    • My Hot Pot Story Cheats v4.7.3 +1
      Modded/Hacked App: My Hotpot Story By 冲 于
      Bundle ID: com.lxqd.hotpotiver
      iTunes Store Link: https://apps.apple.com/us/app/my-hotpot-story/id1623328997?uo=4


      Hack Features:
      - Infinite Currencies


      Non-Jailbroken & No Jailbreak required hack(s): https://iosgods.com/topic/166067-my-hotpot-story-v145-jailed-cheats-1/


      iOS Hack Download Link: https://iosgods.com/topic/166065-my-hotpot-story-cheats-all-versions-1/
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 150 replies
    • Nonstop Knight 2 Cheats v3.2.9 +7 [ God Mode & More ]
      Modded/Hacked App: Nonstop Knight 2 - Action RPG By Flaregames GmbH
      Bundle ID: com.koplagames.kopla02
      iTunes Store Link: https://apps.apple.com/us/app/nonstop-knight-2-action-rpg/id1444887980?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

      - God Mode
      - One Hit Kill
      - Custom Move Speed
      - Custom Attack Speed
      - Custom Attack Range
      - Instant Skill
      - Infinite MP

       

      Non-Jailbroken Hack: https://iosgods.com/topic/99785-nonstop-knight-2-v323-jailed-cheats-2/

       

      ⬇️ iOS Hack Download Link: https://iosgods.com/topic/99783-nonstop-knight-2-cheats-v324-7-god-mode-more/
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 1,606 replies
    • Hollywood Story: Fashion Star Cheats v13.2 +4
      Modded/Hacked App: Hollywood Story®: Fashion Star By Nanobit d.o.o.
      Bundle ID: com.nanobitsoftware.hollywoodstory
      iTunes Store Link: https://apps.apple.com/us/app/hollywood-story-fashion-star/id876656488?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

      - Infinite Cash
      - Infinite Gems
      - Infinite Golden Tickets
      - Infinite Stars Point

       

      ⬇️ iOS Hack Download Link: https://iosgods.com/topic/73408-hollywood-story-fashion-star-cheats-v1211-4/
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 790 replies
    • Duolingo - Language Lessons v7.77.0 Jailed Mod +1
      Modded/Hacked App: Duolingo By Duolingo
      Bundle ID: com.duolingo.DuolingoMobile
      iTunes Store Link: https://itunes.apple.com/us/app/duolingo/id570060128?mt=8&uo=4&at=1010lce4


      Hack Features:
      - PREMIUM
       

      Hack Download Link: https://iosgods.com/topic/78624-arm64-duolingo-v5248-jailed-mod-2/


      Credits:
      - @Laxus
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 2,783 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