Jump to content

[TUTORIAL] How To Hack Using Mobile Substrate (Method Hooking)


179 posts in this topic

Recommended Posts

Updated

✻ Requirements
✔ Mobile Substrate
✔ Mobile Terminal
✔ BigBoss Recommended Tools
✔ Theos
✔ iOS SDK

✻ Setup Variants
From my experience, setting up theos is a *****. My 3 iDevices all have different theos/SDK variants because while something may work on one device, it may not work on another. In the future I may write a theos/SDK error list with solutions, but right now I really don’t have the expertise to talk about that, especially considering I have a broken theos now that I can’t seem to fix. :p If you are having similar issues, I recommend following this guide: https://iosgods.com/topic/62343-new-2021-ios-1213-how-to-install-theos-sdk-on-your-idevice/

 

✻ Setting Up a Project
Launch Mobile Terminal and sign in as root. Then type this command:

$THEOS/bin.nic.pl
/* If that results in error, type /var/theos/bin/nic.pl */

This command starts up the New Instance Creator (nic). Next, choose iphone/tweak by typing the number associated with it. Lastly, name your project (herein myhack), bundle ID, and author. The last too are only important if you plan on publishing your tweak to Cydia. If you’re not, feel free to leave them blank.

Note this puts myhack in /var/mobile. If you want it in a different directory, cd it before starting up nic.

In /myhack, there are 3 files of interest. The Makefile, myhack.plist, and Tweak.xm. The Makefile is where you would add frameworks or instructions for the installation process. myhack.plist contains a list of app bundle IDs the hack will target. To fetch a bundle ID, go into /Library/Preferences of your app and copy the com.companyName.appName.plist (exclude the .plist extension). That is the bundle ID. If you’re app doesn’t have that file in /Preferences, go to /appName.app and open up Info.plist. The bundle ID will be in <string>Bundle Identifier</string>. If you want the hack to work on all apps, delete the myhack.plist.

 

✻ Tweak.xm
This is where the code is written. The file already has an example written for you. Since it is commented out, feel free to keep it there for reference - it will not affect your code.

The way MS hook hacks are made is by calling both a header and a method, and altering them. I recommend using Flex to find headers and methods. It’s by far the most convenient program to use, considering you can search all headers at once and you don’t need to crack the app. If you prefer a command-line program, use class dump. If you notice a lack of unique headers/methods, the app is sub_X. MS hooking will not work with this app and you’ll either need to use symbol hooking or code injection.

Here are some examples on how to return each method type:

int, double, and long long

-(int)coins {
return 999999;
}
/* doubles and long longs are returned the same way, just replace (int) with (double) or (long long).
The return value must be an integer - no decimals */

float

-(float)coins {
return 999.9f;
}

bool

-(bool)hasCoins {
return TRUE;
}
/* must be true/false value. Can also be written as yes/no */

id

-(id)coins {
return [NSNumber numberWithInteger:999999];
}
/* id’s can be anything - a number, bool, string, etc. You have to call the correct NSClass to hack it correctly.
These are very rare - I myself have never had to hack one */

void

-(void)showCoins {
}
/* This is a nulled method. Standalone-voids cannot be returned */

void with argument

-(void)setCoins:(int)argument {
argument = 999999;
}
-(void)setHasCoins:(bool)argument {
argument = TRUE;
}
-(void)setCoins:(id)argument {
argument = [NSNumber numberWithInteger:999999];
}
/* “argument” can be named anything. This is similar to returning non-void counterparts,
except you name the argument and remove “return” */

 

✻ Adding UI Popup
This is really handy against leechers. Adding a popup is relatively simple, and requires changes to both the Makefile and Tweak.xm. First, use Flex (or class dump) to find method -(void)applicationDidBecomeActive:(id). It's usually in a header file called AppDelegate. Now add this to your Tweak.xm (remember to edit the header accordingly):

 

%hook AppDelegate
-(void)applicationDidBecomeActive:(id)argument {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"This is the Title" message:@"This is the Message" delegate:nil cancelButtonTitle:@"This is the Button Text" otherButtonTitles:nil];
[alert show];
[alert release];
}
%end
/* Sometimes attaching the popup to this method results in a crash.
You can attach the popup to any void you want,
but attaching it to the launch method is the most convenient for both you and the user */

If you were to compile myhack now, the compiler would not understand what UIAlertView is and would return an error. To fix this, import the UIKit framework in your Makefile. Add this line below the myhack_FILES line:

myhack_FRAMEWORKS = UIKit

You can now compile. :)

 

✻ Compiling
In MobileTerminal, cd to your project folder. Then, type any of these commands:

make
/* Makes the .dylib */
make package
/* Makes a .deb for easy install */
make package install
/* Makes a .deb and installs it for you */

The .dylib will appear in /myhack/obj. The .deb will appear in /myhack and install to /Library/MobileSubstrate/DynamicLibraries.
 
Extra info by @castix (post😞

So because this tutorials is already awesome (big shoutout to evilg00d there) I will just add some notes
 
As he already mentioned in the main topic here, you can't override void but you can NULL them = disable them

- (void)enemiesShoots {    //This is the method that calls your opponents to shoot so if we disable this, they can't anymore
}

if you want to add this in a patcher, you can simply write it like this

- (void)enemyShoots {                              //Easy isn't it ?
   if(GetPrefBool(@"kEnemyShooting")) {
   return; 
   }
   return %orig;
   }

Moving on there are some more value classes, which can be modified

- (long long)Coins {    //This can obviously be treated like int
return 2222;
}
- (double)Coins {     //You can also see here that it can be overwritten really easy
return 2222;
}

Those are just a few more function methods , so if you find something like them in FLEX/Headers/Binaries you know what do do.

 

Step-by-step tutorial on how to make a Preference Bundle (Patcher with on/off settings) here: http://iosgods.com/topic/444-tutorial-how-to-make-a-preference-bundle/

  • Like 13
  • Thanks 2
  • Informative 3
Posted

Very helpful!

 

Thanks for posting! :)

 

Pinned.

  • Like 1
Posted
  On 7/22/2014 at 4:58 PM, EvillyG00d said:

No problem, DiDA. :) Happy to help.

Thanks EG! :)

Posted (edited)
  On 7/22/2014 at 5:14 PM, EvillyG00d said:

Whoops - forgot about that.Added, thank you. :)

Np :)

Updated by Guest

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

    • Ace Fishing: Wild Catch v9.7.0 +4 Cheats
      Modded/Hacked App: Ace Fishing: Wild Catch By Com2uS Corp.
      Bundle ID: com.com2us.acefishing.normal.freefull.apple.global.ios.universal
      iTunes Store Link: https://apps.apple.com/us/app/ace-fishing-wild-catch/id694972182?uo=4


      Hack Features:
      - No Line Break
      - Set Tension Gauge [ 1 = low, 2 = center, 3 = high ]
      - Set Fish HP
      - Set Damage


      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
        • Like
      • 407 replies
    • Poker Hero - Joker Legend v1.8.0 [ +6 Cheats ] Easy Win
      Modded/Hacked App: Poker Hero - Joker Legend By Gemini Network
      Bundle ID: com.gemini.dash.deck
      iTunes Store Link: https://apps.apple.com/us/app/poker-hero-joker-legend/id6498983199?uo=4


      Hack Features:
      - Energy Freeze 

      - ATK Power [ Choose 1 Card Only Win Battle ]

      - Spell Power 

      - Always FullHouse [ Select Any Cards ]

      - Always Flush [ Select Any Cards ]

      - Always Straight [ Select Any Cards ]


      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/
        • Agree
      • 63 replies
    • Poker Hero - Joker Legend v1.8.0 [ +6 Jailed ] Easy Win
      Modded/Hacked App: Poker Hero - Joker Legend By Gemini Network
      Bundle ID: com.gemini.dash.deck
      iTunes Store Link: https://apps.apple.com/us/app/poker-hero-joker-legend/id6498983199?uo=4



      Hack Features:

      - Energy Freeze 

      - ATK Power [ Choose 1 Card Only Win Battle ]

      - Spell Power 

      - Always FullHouse [ Select Any Cards ]

      - Always Flush [ Select Any Cards ]

      - Always Straight [ Select Any Cards ]


      Jailbreak required hack(s): https://iosgods.com/forum/5-game-cheats-hack-requests/
      Modded Android APK(s): https://iosgods.com/forum/68-android-section/
      For more fun, check out the Club(s): https://iosgods.com/clubs/
      • 26 replies
    • Yukon: Family Adventure v1.57.1 [ +4++ Cheats ] Everything Unlimited
      Modded/Hacked App: Yukon: Family Adventure By Enixan Europe Limited
      Bundle ID: com.enixan.yukon.family.adventure
      iTunes Store Link: https://apps.apple.com/us/app/yukon-family-adventure/id6455041311?uo=4


      🤩 Hack Features

      - Gems

      - Energy

      - Items

      - EXP
      • 10 replies
    • Yukon: Family Adventure v1.57.1 [ +4++ Jailed ] Everything Unlimited
      Modded/Hacked App: Yukon: Family Adventure By Enixan Europe Limited
      Bundle ID: com.enixan.yukon.family.adventure
      iTunes Store Link: https://apps.apple.com/us/app/yukon-family-adventure/id6455041311?uo=4


      🤩 Hack Features

      - Gems

      - Energy

      - Items

      - EXP
      • 12 replies
    • Car Simulator 2 Cheats v1.55.7 +2
      Modded/Hacked App: Car Simulator 2 by Pavel Gavrilyuk
      Bundle ID: com.oppanagames.car.simulator
      iTunes Store Link: https://apps.apple.com/us/app/car-simulator-2/id1456091972?uo=4&at=1010lce4


      Hack Features:
      - Infinite Coins
      - Free iAP (Use with LocaliAPPStore or iOSGods iAP)
       

      iOS Hack Download Link: https://iosgods.com/topic/119157-arm64-car-simulator-2-cheats-all-versions-2/
        • Haha
      • 109 replies
    • The Seven Deadly Sins Cheats v2.77.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/
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 2,038 replies
    • Kritika: The White Knights v5.14.2 +3 [God Mode & Damage Multiplier]
      Modded/Hacked App: Kritika: The White Knights By GAMEVIL Inc.
      Bundle ID: com.gamevil.kritikam.ios.apple.global.normal
      iTunes Store Link: https://itunes.apple.com/us/app/kritika-the-white-knights/id865958296
       

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


      Hack Features:
      - God Mode Works Everywhere
      - Set Damage Multiplier - Do not set it too high, you will get kicked out if you do.
      - No Skill Cooldown 

      All features are unlinked!
        • Agree
        • Like
      • 1,980 replies
    • Injustice: Gods Among Us v3.5 +6++ Jailed Cheats [Unlimited Currencies + More]
      Modded/Hacked App: Injustice: Gods Among Us by Warner Bros. Entertainment
      Bundle ID: com.wb.Injustice.Brawler2013
      iTunes Store Link: https://itunes.apple.com/us/app/injustice-gods-among-us/id575658129?mt=8&uo=4&at=1010lce4


      Mod Requirements:
      - Non-Jailbroken/Jailed or Jailbroken iPhone/iPad/iPod Touch.
      - Cydia Impactor.
      - A Computer Running Windows/Mac/Linux.


      Hack Features:
      - Unlimited Currencies - Earn some to receive an unlimited amount of that specific currency.
      - Unlimited Stamina - Will increase instead of decrease.
      - Godmode
      - One-Hit Kill
      - Max Player Level - Play a battle with that specific character to get it max level.
      - Anti-Ban - Untested. Might be useless since the game's old now, and I wasn't banned testing this hack without this enabled anyway.
        • Winner
      • 1,971 replies
    • Injustice: Gods Among Us v3.5 - [ Unlimited Currencies & More ]
      Modded/Hacked App: Injustice: Gods Among Us by Warner Bros. Entertainment
      Bundle ID: com.wb.Injustice.Brawler2013
      iTunes Store Link: https://itunes.apple.com/us/app/injustice-gods-among-us/id575658129?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:
      - Unlimited Currencies - Earn some to receive an unlimited amount of that specific currency.
      - Unlimited Stamina - Will increase instead of decrease.
      - Godmode
      - One-Hit Kill
      - Increased Critical Chance
      - Increased Critical Damage
      - Unlimited Gear Score
      - Max Player Level - Play a battle with that specific character to get it max level.
      - Survival Mode Unlocked
      - Hacked Saved Data Check Bypassed
      - Anti-Ban - Untested. Might be useless since the game's old now, and I wasn't banned testing this hack without this enabled anyway.

      This hack is an In-Game Mod Menu (iGMM). In order to activate the Mod Menu, tap on the iOSGods button found inside the app. This hack works on the latest x64 or ARM64 iDevices: iPhone 5s, 6, 6 Plus, 6s, 6s Plus, 7, 7 Plus, 8, 8 Plus, X, Xr, Xs, Xs Max, SE, iPod Touch 6G, iPad Air, Air 2, Pro & iPad Mini 2, 3, 4 and later.
        • Informative
        • Agree
        • Thanks
        • Like
      • 2,991 replies
    • [ViP Hack] WarFriends v5.11.0 +6 Cheats
      Modded/Hacked App: WarFriends: PvP Shooter Game By Chillingo Ltd
      Bundle ID: com.chillingo.warfriends
      iTunes Link: https://itunes.apple.com/us/app/warfriends-pvp-shooter-game/id979873043


      Hack Features:
      - Debug Menu -> Most/Everything from previous hack has been patched/removed. However, it will still show you some in-game stuff.
      - Free Weapon Upgrades. Instant Weapon Upgrade Delivery Times!
      - Unlimited Clips/Ammo -> Works online & offline
      - No Weapon Reload / Unlimited Ammo in Clip -> Works online & offline
      - One Hit Kill Enemies / High Damage -> Buggy Online, works well offline. Linked with enemy, so hit them first.
      - Gun Fire Rate x1000 -> Shoot bullets really, really fast. Works online too, linked to enemy. One Hit Kill Alternative if you can aim.
      This hack is an In-Game Mod Menu (iGMM). In order to activate the Mod Menu, tap your screen with 3 fingers simultaneously.

       

      Non-Jailbroken Version of this hack: https://iosgods.com/topic/44193-warfriends-v140-3-cheats-ios-10/
        • Agree
        • Like
      • 1,767 replies
    • Fishing Clash v1.0.358 +3 Cheats
      Modded/Hacked App: Fishing Clash: Fish Game 2019 by Ten Square Games S.A.
      Bundle ID: com.tensquaregames.letsfish2
      iTunes Store Link: https://apps.apple.com/us/app/fishing-clash-fish-game-2019/id1151811380


      Hack Features:
      - Combo Always Active
      - Centered Line -> The line is always in the center zone. I didn't test enough but worked for 20 games. Duels too.
      - Line Never Breaks
        • Informative
        • Like
      • 1,334 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