Jump to content

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


180 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

No problem, DiDA. :) Happy to help.

Thanks EG! :)

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

    • 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
      • 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
      • 0 replies
    • 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/
        • 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
        • 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/
      • 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/
      • 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/
      • 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/
      • 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/
        • Agree
      • 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
        • Winner
      • 2,783 replies
    • Dummynation Cheats v3.3.3 +3
      Modded/Hacked App: Dummynation By ALEJANDRO HERNANDEZ FERRERO
      Bundle ID: ahf.dummynation
      iTunes Store Link: https://apps.apple.com/us/app/dummynation/id6444295551?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

      - Premium + No Ads
      - Infinite Research Point
      - Infinite Liquidity (Gold)


      🍏 For Non-Jailbroken & No Jailbreak required hacks: https://iosgods.com/topic/191828-dummynation-v313-jailed-cheats-3/

       

      ⬇️ iOS Hack Download Link: https://iosgods.com/topic/191829-dummynation-cheats-v313-3/
      • 17 replies
    • Demon Squad: Idle RPG Cheats v1.82 +2
      Modded/Hacked App: Demon Squad: Idle RPG By SuperPlanet corp.
      Bundle ID: com.superplanet.demonsquad
      iTunes Store Link: https://apps.apple.com/us/app/demon-squad-idle-rpg/id6504470907?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

      - Multiply Attack
      - Multiply Defense

       

      Non-Jailbroken Hack: https://iosgods.com/topic/188363-demon-squad-idle-rpg-v170-jailed-cheats-2/

       

      ⬇️ iOS Hack Download Link: https://iosgods.com/topic/185576-demon-squad-idle-rpg-cheats-v171-2/
        • Like
      • 85 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