Jump to content

Debugging apps on iOS 13 with LLDB (watchpoints supported)


64 posts in this topic

Recommended Posts

Hi, I looked at the tutorials section here and saw that the only tutorial about debugging was a tutorial by Ted22 without support for watchpoints. This does support wp and is you don't need to download stuff from unofficial sources. But I do recommend reading his tutorial as it covers other stuff.

For this you need Xcode & Homebrew. (on macOS). Probably works on GNU/Linux if you get debugserver and the right iOS SDK some other way, or you could run macOS in a VM.

Run this to get ldid:

brew install ldid

Then you need to get the right debugserver. Run 

cd /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/ (iPadOS if you're using an iPad, I guess)

Then do an ls to list all available versions. In my case "13.3" since I run iOS 13.3.1 on an iPhone X.

Run this to mount the DeveloperDiskImage of your version. 13.3 in my case.

open ./13.3/DeveloperDiskImage.dmg

Then open your mounted disk image and go to DeveloperDiskImage/usr/bin. There you'll find debugserver. Copy that to your computer somewhere. I used ~/Documents/debugserver

To thin your binary, run 

lipo -thin arm64 ./debugserver -output ./debugserverthin (if using arm64)
lipo -thin arm64e ./debugserver -output ./debugserverthin (if using arm64e, iPhone XS and above, haven't tried though, maybe arm64 will work fine aswell)

Next, sign debugserver with this xml file (save as ent.xml):

<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
        <key>com.apple.springboard.debugapplications</key>
        <true/>
        <key>get-task-allow</key>
        <true/>
        <key>task_for_pid-allow</key>
        <true/>
        <key>run-unsigned-code</key>
        <true/>
</dict>
</plist>

Using ldid as such: 

ldid -Sent.xml ./debugserverthin

Copy it to your phone using sftp.

sftp root@yourphoneip

then 

put debugserverthin

now SSH into your phone and run

mv ./debugserverthin /usr/bin/debugserver (/usr/local/bin is more standard but /usr/bin just worked for me so I'll go with that, doesn't really matter).

 

Run this to find all running processes.  I'll use Hill Climb Racing as an example:

ps -A

Example output: 51523 ??         0:34.60 /var/containers/Bundle/Application/72FDFED4-16FB-47FE-999D-1CD53CF16B8C/Hill Climb Racing.app/Hill Climb Racing

Run debugserver to start the debugging server. To specify which process to attach on, do it like this:

debugserver 0.0.0.0:1234 -a "Hill Climb Racing"

To attach LLDB from your Mac, run this (ON MAC, not phone).

lldb
(lldb) platform select remote-ios
(lldb) process connect connect://yourphoneip:1234

To set watchpoints (got addr from iGG, gold value):

(lldb) process interrupt
Process 51523 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
    frame #0: 0x00000001b7044634 libsystem_kernel.dylib`mach_msg_trap + 8
libsystem_kernel.dylib`mach_msg_trap:
->  0x1b7044634 <+8>: ret

libsystem_kernel.dylib`mach_msg_overwrite_trap:
    0x1b7044638 <+0>: mov    x16, #-0x20
    0x1b704463c <+4>: svc    #0x80
    0x1b7044640 <+8>: ret
Target 0: (Hill Climb Racing) stopped.
(lldb) w s e -s 4 -- 0x106128024
Watchpoint created: Watchpoint 1: addr = 0x106128024 size = 4 state = enabled type = w
    new value: 148742069
(lldb) c
Process 51523 resuming

When your watchpoints gets triggered you'll see disassembled code that ran some instruction on your data. Example (when buying from store):

Watchpoint 1 hit:
old value: 148742069
new value: 148642069
Process 51523 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = watchpoint 1
    frame #0: 0x0000000104a38a74 Hill Climb Racing`___lldb_unnamed_symbol5830$$Hill Climb Racing + 276
Hill Climb Racing`___lldb_unnamed_symbol5830$$Hill Climb Racing:
->  0x104a38a74 <+276>: mov    x0, x19
    0x104a38a78 <+280>: mov    x1, x20
    0x104a38a7c <+284>: bl     0x104a38d94               ; ___lldb_unnamed_symbol5832$$Hill Climb Racing
    0x104a38a80 <+288>: add    x8, sp, #0x30             ; =0x30
Target 0: (Hill Climb Racing) stopped.

I have literally no idea how to write ARM assembly but I'd guess that you could replace the instructions at 0x104a38a74 with NOP's to get free-buy, or write a jmp to your own function for mid-function hooks. I suggest watching other tutorials for that, I'm only good at Windows hacking but I may learn some iOS soon :D.

 

For moderators who review: can I wrap everything in hide-tags without messing up everything? I don't really care but a few more likes is cool 😛

I'll make a follow-up some day when I actually create a fully featured cheat with this, iGG, Theos and a disassembler like Ghidra or Binary Ninja.

Secret:

Hidden Content

React or reply to this topic to see the hidden content & download link.

Updated by Affe2626
  • Like 114
  • Winner 14
  • Thanks 7
  • Haha 4
  • Agree 2
  • Informative 8
Link to comment
https://iosgods.com/topic/123544-debugging-apps-on-ios-13-with-lldb-watchpoints-supported/
Share on other sites

1 hour ago, Rook said:

Thank you for sharing this with us!

I think adding hide here will ruin the topic. :)

Yep, that's fine, I attached a hidden meme instead. I may do a video next time when I make a cheat with this. Let's see how that goes

On 4/16/2020 at 6:08 AM, K_K said:

So this has to done on a mac?..

I haven't tried anything else. If you get LLDB to run with an iOS SDK on another OS then probably. The remote-ios platform maybe only exists on the macOS version of LLDB (but you can always try). Search for how to set SDK path. It does that automatically if you have Xcode installed for macOS. 

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

    • Immortal Rising Cheats v2.4.9 +4
      Modded/Hacked App: Immortal Rising By MOBIRIX
      Bundle ID: com.badbeans.DarkIdle
      iTunes Store Link: https://apps.apple.com/us/app/immortal-rising/id1588863558?uo=4


      Hack Features:
      - God Mode
      - One Hit Kill
      - PREMIUM
      - Freeze Currencies*

      *Abuse = Ban


      iOS Hack Download Link: https://iosgods.com/topic/178921-immortal-rising-cheats-v222-4/
      • 163 replies
    • Travel Town - Merge Adventure Cheats v2.12.852 +1
      Modded/Hacked App: Travel Town By Magmatic Games Ltd
      Bundle ID: io.randomco.travel
      iTunes Store Link: https://apps.apple.com/us/app/travel-town/id1521236603?uo=4


      Hack Features:
      - Infinite Currencies


      Non-Jailbroken & No Jailbreak required hack(s): https://iosgods.com/topic/148953-travel-town-v231-jailed-cheats-1/

      iOS Hack Download Link: https://iosgods.com/topic/148951-travel-town-cheats-all-versions-1/
      • 120 replies
    • BitLife - Life Simulator Cheats v3.17.1 +2
      Modded/Hacked App: BitLife - Life Simulator by Candywriter, LLC
      Bundle ID: com.wtfapps.apollo16
      iTunes Store Link: https://apps.apple.com/us/app/bitlife-life-simulator/id1374403536?uo=4&at=1010lce4


      Hack Features:
      - Infinite Cash
      - Free Bitizen Purchase (Press Cancle) - Work for All Versions


      Non-Jailbroken & No Jailbreak required hack(s): https://iosgods.com/topic/84167-arm64-bitlife-life-simulator-v1412-jailed-cheats-2/


      Hack Download Link: https://iosgods.com/topic/84223-arm64-bitlife-life-simulator-cheats-all-versions-2/
      • 3,344 replies
    • Otherworld Three Kingdoms Cheats v1.0.22 +4
      Modded/Hacked App: Otherworld Three Kingdoms By SuperPlanet corp.
      Bundle ID: com.superplanet.samworld
      iTunes Store Link: https://apps.apple.com/us/app/otherworld-three-kingdoms/id6496345383?uo=4


      Hack Features:
      - Multiply Attack
      - Multiply Defense
      - Instant Skills


      iOS Hack Download Link: https://iosgods.com/topic/183743-otherworld-three-kingdoms-cheats-v103-3/
      • 97 replies
    • Delusion: Tactical Idle RPG Cheats v2.3.1 +3
      Modded/Hacked App: Delusion: Tactical Idle RPG By SuperPlanet corp.
      Bundle ID: com.superplanet.delusion
      iTunes Store Link: https://apps.apple.com/us/app/delusion-tactical-idle-rpg/id6496342351?uo=4


      Hack Features:
      - Multiply Attack
      - God Mode
      - Freeze Currencies

      NOTE: Do not abuse or buy ViP just for this cheats


      iOS Hack Download Link: https://iosgods.com/topic/183614-delusion-tactical-idle-rpg-cheats-v1027-3/
      • 58 replies
    • The Seven Deadly Sins: Idle Cheats v1.8.1 +4
      Modded/Hacked App: The Seven Deadly Sins: Idle By Netmarble Corporation
      Bundle ID: com.netmarble.nanarise
      iTunes Store Link: https://apps.apple.com/us/app/the-seven-deadly-sins-idle/id6469305531?uo=4


      Hack Features:
      - Multiply Attack
      - Multiply Defense
      - Modify Range


      iOS Hack Download Link: https://iosgods.com/topic/185131-the-seven-deadly-sins-idle-cheats-v101-3/
      • 86 replies
    • Hill Climb Racing 2 v1.64.2 Cheats +3
      Modded/Hacked App: Hill Climb Racing 2 By Fingersoft
      Bundle ID: com.fingersoft.hillclimbracing2
      iTunes Store Link: https://apps.apple.com/us/app/hill-climb-racing-2/id1146465836?uo=4


      Hack Features:
      - Freeze Coins
      - Freeze Gems
      - Freeze Scraps


      Non-Jailbroken & No Jailbreak required hack(s): https://iosgods.com/topic/108295-hill-climb-racing-2-v1611-jailed-cheats-2/


      iOS Hack Download Link: https://iosgods.com/topic/108298-hill-climb-racing-2-v1612-cheats-3/
      • 2,153 replies
    • Monster Super League By Four Thirty Three v3.8.7 - [ x Player Damage & More ]
      Modded/Hacked App: Monster Super League By Four Thirty Three
      Bundle ID: com.ftt.msleague
      iTunes Store Link: https://itunes.apple.com/us/app/monster-super-league/id1092463295


      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:
      - x Player Damage - x1 - 100
      - x Player Defense - x1 - 100
      - Inf.Skills

      All features are unlinked and only for you player, you!
      • 1,262 replies
    • MARVEL Puzzle Quest: Hero RPG v317.0.696394 +2 Jailed Cheats [ One-Hit Kill ]
      Modded/Hacked App: MARVEL Puzzle Quest: Hero RPG By D3PA
      Bundle ID: com.d3p.yorkMPQ
      iTunes Store Link: https://apps.apple.com/us/app/marvel-puzzle-quest-hero-rpg/id618349779


      Hack Features:
      - God Mode -> Linked. Wait until it's the enemies turn then enable this feature.
      - One-Hit Kill -> Linked. Wait until it's your turn then enable this feature.


      Jailbreak required hack(s): [Mod Menu Hack] MARVEL Puzzle Quest: Hero RPG v264.0.617994 +2 Cheats [ One-Hit Kill ] - 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/
      • 91 replies
    • MARVEL Puzzle Quest: Hero RPG v317.0.696394 +2 Cheats [ One-Hit Kill ]
      Modded/Hacked App: MARVEL Puzzle Quest: Hero RPG By D3PA
      Bundle ID: com.d3p.yorkMPQ
      iTunes Store Link: https://apps.apple.com/us/app/marvel-puzzle-quest-hero-rpg/id618349779


      Hack Features:
      - God Mode -> Linked. Wait until it's the enemies turn then enable this feature. This feature will auto update itself once a new version of the app is released!
      - One-Hit Kill -> Linked. Wait until it's your turn then enable this feature. This feature will auto update itself once a new version of the app is released!


      Non-Jailbroken & No Jailbreak required hack(s): [Non-Jailbroken Hack] MARVEL Puzzle Quest: Hero RPG v264.0.617994 +1 Jailed Cheat [ One-Hit Kill ] - 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/
      • 52 replies
    • MeChat v4.29.1 +1 Jailed Cheat [ Unlimited Gems ]
      Modded/Hacked App: MeChat By PlayMe Studio
      Bundle ID: world.playme.mechat
      iTunes Store Link: https://apps.apple.com/us/app/mechat/id1536157979
       

      Hack Features:
      - Unlimited Gems -> Will increase instead of decrease.
      - Unlimited Gems -> Earn some then uninstall this hack. DO NOT SPEND ANY GEMS WHILST THIS FEATURE IS ENABLED! [ VIP ]


      Free Jailbreak required hack(s): [Mod Menu Hack] [Free] MeChat - Love Secrets v3.3.2 +1 Cheat [ Unlimited Gems ] - Free Jailbroken Cydia Cheats - iOSGods
      ViP Jailbreak required hack(s): [Mod Menu Hack] MeChat - Love Secrets v3.3.2 +1 Cheat [ Unlimited Gems ] - ViP 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
      • 707 replies
    • Good Pizza, Great Pizza v5.20.0 +2 Jailed Cheats [ Unlimited Currencies ]
      Modded/Hacked App: Good Pizza, Great Pizza By TAPBLAZE, LLC
      Bundle ID: com.tapblaze.pizzabusiness
      iTunes Store Link: https://apps.apple.com/us/app/good-pizza-great-pizza/id911121200?uo=4


      Hack Features:
      - Unlimited Cash
      - Unlimited Diamonds


      Jailbreak required hack(s): [Mod Menu Hack] Good Pizza, Great Pizza v5.5.6 +2 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/
      • 211 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