Jump to content

How to call the function? (iOS jailbreak)


Go to solution Solved by Saitama,

10 posts in this topic

Recommended Posts

Posted

Hi I'm trying to call a function in the game Hide N Seek : Mini Games.

Here is my code, (I just need to call any function):

function dump:

//RVA: 0x11FE288 Offset: 0x11FE288 VA: 0x11FE288
   private void Update() { }


#include <unistd.h>
#include <dispatch/dispatch.h>
#include <mach-o/dyld.h>

uintptr_t getExecAddr(uintptr_t addr)
{
 const struct mach_header* header = _dyld_get_image_header(341); // this is the library index, it's so big because I'm              using a debugger so far.
 if (header == NULL){return 0;}

 uintptr_t libLoadAddr = (uintptr_t)header;
 uintptr_t exec_addr = libLoadAddr + addr;

 return exec_addr;
}

void (*Update)();

%ctor { 

 dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{

  sleep(15); // wait for all libraries to load

  Update = (void(*)())getExecAddr(0x11FE288);

  Update();

 });
 
}

The game crashes when the moment comes to call the function. What am I doing wrong? :(

Posted

Keep It Simple - using this one


u dont need header index etc
u need library name
 

[menu setFrameworkName:"UnityFramework"];


next is

void (*Update)(void *inst) = (void(*)(void *))getRealOffset(0x11FE288);

and call of this is

Update(inst);


Why inst?
Because its not static function - and this function is called from some class
*inst is a class that has this function and the first arg is for call

  • Informative 1
Posted

Thanks for the answer! but i did not understand where to call the function, if this is done in the same place where the pointer is declared, the compiler will gile the error "use of undeclared identifier 'inst'' for Update(inst);

Posted
20 hours ago, nngot44 said:

Thanks for the answer! but i did not understand where to call the function, if this is done in the same place where the pointer is declared, the compiler will gile the error "use of undeclared identifier 'inst'' for Update(inst);

because u dont declare this variable and dont get the pointer of object created by this class

also dont know why u need to call exact this function 
in Unity games this function basically called automatically each frame (if the class inherits MonoBehaviour class)
 

  • Solution
Posted (edited)

the main logic is
var someClass = new SomeClass(); //or other c# initialisation 
someClass.SomeMethod();

SomeMethod() cant be called from no where

Example #1

public class SomeClass : MonoBehaviour 
{
	// Fields
	...

	// Properties
	...

	// Methods
	...
	// RVA: 0x100400 Offset: 0x100400 VA: 0x100400
	public static SomeClass get_Instance() { }

	// RVA: 0x100500 Offset: 0x100500 VA: 0x100500
	public void SomeMethod() // address 0x100500

	// RVA: 0x100600 Offset: 0x100600 VA: 0x100600
	public static void SomeStaticMethod() // address 0x100600
	...
}

 

void* (*SomeClass$$get_Instance)() = (void(*)())getRealOffset(0x100400);
void (*SomeClass$$SomeMethod)(void *SomeClass) = (void(*)(void *))getRealOffset(0x100500);

void* SomeClassInstance = SomeClass$$get_Instance();
SomeClass$$SomeMethod(SomeClassInstance);

 

void (*SomeClass$$SomeStaticMethod)() = (void(*)())getRealOffset(0x100600);

SomeClass$$SomeStaticMethod();

Example #2

public class SomeOtherClass : MonoBehaviour 
{
	// Fields
	...

	// Properties
	...

	// Methods
	...
	// RVA: 0x100300 Offset: 0x100300 VA: 0x100300
	public void InitWithSomeClass(SomeClass someClassInstance) { }
	...
}

 

void* SomeClassInstance = NULL;
void (*SomeOtherClass$$InitWithSomeClass_original)(void *SomeOtherClassInstance, void* someClassInstance);
void _SomeOtherClass$$InitWithSomeClass_hook(void *SomeOtherClassInstance, void* someClassInstance) 
{
	SomeClassInstance = someClassInstance;
	SomeOtherClass$$InitWithSomeClass_original(SomeOtherClassInstance, someClassInstance);
}

HOOK(0x100300, _SomeOtherClass$$InitWithSomeClass_hook, SomeOtherClass$$InitWithSomeClass_original);

 

Updated by Saitama
  • Winner 1
Posted (edited)

Example #3

public class SomeThirdClass : MonoBehaviour 
{
	// Fields
	...
	public SomeClass SomeClassField // 0x100
	...

	// Properties
	...

	// Methods
	...
	// RVA: 0x100200 Offset: 0x100200 VA: 0x100200
	public void Update() { }
	...
}

 

void* SomeClassInstance = NULL;
void (*SomeThirdClass$$Update_original)(void *SomeThirdClassInstance);
void _SomeThirdClass$$Update_hook(void *SomeThirdClassInstance) 
{
	void* someClassInstance = *(void **)((uint64_t)SomeThirdClassInstance + 0x100);
	if(someClassInstance != NULL)
    {
		SomeClassInstance = someClassInstance;
    }
	SomeThirdClass$$Update_hook(SomeThirdClassInstance);
}

HOOK(0x100200, _SomeThirdClass$$Update_hook, SomeThirdClass$$Update_original);

 

 

Updated by Saitama
  • Winner 1
Posted

Thanks for these examples, I'm new and still learning how to make dylib libraries for games. I tried to call the Update function because I thought it would be the easiest to call :)

Posted (edited)

I used your advice and wrote this code (i hope my method returns the correct address) :

#include <unistd.h>
#include <dispatch/dispatch.h>
#include <mach-o/dyld.h>

uintptr_t getExecAddr(uintptr_t addr)
{
    const struct mach_header* header = _dyld_get_image_header(341);
    if (header == NULL){return 0;}

    uintptr_t libLoadAddr = (uintptr_t)header;
    uintptr_t exec_addr = libLoadAddr + addr;

    return exec_addr;
}

%ctor 
{

	dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{

		sleep(150);

		void* (*VELights$$get_Instance)() = (void* (*)())getExecAddr(0x12FD104);
		void (*VELights$$ResetMainSunLightAngle)(void *VELights) = (void(*)(void *))getExecAddr(0x12FD4B8);

		void* VELightsInstance = VELights$$get_Instance();
		VELights$$ResetMainSunLightAngle(VELightsInstance);
		
	});	

}	

 

In the debugger, I always get rather strange errors, for example, from the libobjc.A.dylib'objc_retain library. 

I thought it would be easier for me if it was possible to disable ASLR for this game. Is it possible to do this on iOS 13?

 

Updated by nngot44
Posted

basically start from doing some easier things
for example change values from 
public int get_someGold();
and setter
public void set_someGold(int goldVal);

its will be easier to understand that call some function

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

    • Honkai Impact 3rd Cheats v8.3.0 +2 [ Multiply Attack & Defense ]
      Modded/Hacked App: Honkai Impact 3rd By COGNOSPHERE PTE. LTD.
      Bundle ID: com.miHoYo.bh3global
      iTunes Store Link: https://apps.apple.com/us/app/honkai-impact-3rd/id1336342304?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

       

      ⬇️ iOS Hack Download Link: https://iosgods.com/topic/134276-honkai-impact-3rd-cheats-v810-2-multiply-attack-defense/
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 624 replies
    • Toy Blast Cheats v20229 +6
      Modded/Hacked App: Toy Blast By Peak Games
      Bundle ID: net.peakgames.amy
      iTunes Store Link: https://itunes.apple.com/us/app/toy-blast/id890378044?mt=8&uo=4&at=1010lce4



      Hack Features:
      - Infinite Hearts
      - Infinite Coins
      - Infinite Boosters
      - Never Lose
      - High Score
      - Always 3 Stars


      Non-Jailbroken & No Jailbreak required hack(s): https://iosgods.com/topic/73056-arm64-toy-blast-v5431-jailed-cheats-3/


      Hack Download Link: https://iosgods.com/topic/73037-arm64-toy-blast-cheats-v5475-6/



      Credits:
      - @Laxus
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 638 replies
    • Angry Birds Dream Blast Cheats v1.88.0 +3
      Modded/Hacked App: Angry Birds Dream Blast By Rovio Entertainment Oyj
      Bundle ID: com.rovio.dream
      iTunes Store Link: https://apps.apple.com/us/app/angry-birds-dream-blast/id1432579280?uo=4


      Hack Features:
      - Infinite Moves
      - Infinite Lives
      - Infinite Boosters


      Non-Jailbroken & No Jailbreak required hack(s): https://iosgods.com/topic/149687-angry-birds-dream-blast-v1340-jailed-cheats-3/


      iOS Hack Download Link: https://iosgods.com/topic/149684-angry-birds-dream-blast-cheats-all-versions-3/
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 103 replies
    • Idle MoonRabbit: AFK RPG Cheats v1.122.0 +4
      Modded/Hacked App: Idle MoonRabbit: AFK RPG By Able Games Co. ,Ltd.
      Bundle ID: com.TheAbleGames.DalToKi
      iTunes Store Link: https://apps.apple.com/us/app/idle-moonrabbit-afk-rpg/id1599684924?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

      - Multiply Attack
      - Multiply Defense
      - Infinite Mana
      - Instant Skills


      🍏 For Non-Jailbroken & No Jailbreak required hacks: https://iosgods.com/topic/190116-idle-moonrabbit-afk-rpg-v11130-jailed-cheats-4/

       

      📥 iOS Hack Download Link: https://iosgods.com/topic/167497-idle-moonrabbit-afk-rpg-cheats-v11130-4/
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 235 replies
    • Prison Empire Tycoon-Idle Game Cheats v3.8.2 +2
      Modded/Hacked App: Prison Empire Tycoon-Idle Game by Digital Things Sociedad Limitada
      Bundle ID: com.codigames.idle.prison.empire.manager.tycoon
      iTunes Store Link: https://apps.apple.com/us/app/prison-empire-tycoon-idle-game/id1508490923?uo=4&at=1010lce4


      Hack Features:
      - Infinite Cash
      - No Ads


      Non-Jailbroken & No Jailbreak required hack(s):  https://iosgods.com/topic/128324-arm64-prison-empire-tycoon%EF%BC%8Didle-game-v102-jailed-cheats-2/

       
      iOS Hack Download Link: https://iosgods.com/topic/128322-arm64-prison-empire-tycoon%EF%BC%8Didle-game-cheats-all-versions-2/
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 1,159 replies
    • Shadow Hunter: Premium v11.125.2 +9 Cheats
      Modded/Hacked App: Shadow Hunter: Premium By ENIGMA SOFTWARE JOINT STOCK COMPANY
      Bundle ID: com.enigma.shadowhunter.paid
      iTunes Store Link: https://apps.apple.com/us/app/shadow-hunter-premium/id1588843797?uo=4


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


      Hack Features:
      - Free Equipment Level Up*
      - Free Merchant Shop*
      - Free Mystic Store*
      - Free Fragment Shop*
      - Free Video Shop*
      - No Awaken Dust Cost
      - No Ascend Requirements
      - No Evolve Requirements
      - 1 Item = 100 Items

      Notes:
      * under one switch. Do not purchase stuff that cost diamond, or your game becomes invalid. So, save from time to time to revert back if anything happens.
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 650 replies
    • Shadow Hunter: Offline Games v10.125.2 +9 Cheats
      Modded/Hacked App: Shadow Hunter: Lost Worlds By ENIGMA SOFTWARE JOINT STOCK COMPANY
      Bundle ID: com.enigma.shadowhunter.free
      iTunes Store Link: https://apps.apple.com/us/app/shadow-hunter-lost-worlds/id1559150590?uo=4


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


      Hack Features:
      - Free Equipment Level Up*
      - Free Merchant Shop*
      - Free Mystic Store*
      - Free Fragment Shop*
      - Free Video Shop*
      - No Awaken Dust Cost
      - No Ascend Requirements
      - No Evolve Requirements
      - 1 Item = 100 Items

      Notes:
      * under one switch. Do not purchase stuff that cost diamond, or your game becomes invalid. So, save from time to time to revert back if anything happens.
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 805 replies
    • Kick The Buddy v1.22.4 Jailed Cheats +5
      Modded/Hacked App: Kick the Buddy By Playgendary Limited
      Bundle ID: com.chillfleet.buddy
      iTunes Store Link: https://apps.apple.com/us/app/kick-the-buddy/id1278869953?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

      - Infinite Golds (Spend some/ Get some)
      - Infinite Bucks (Spend some/ Get some)
      - All Items Owned
      - No Ads
      - Premium

       

      ⬇️ iOS Hack Download IPA Link: https://iosgods.com/topic/84162-kick-the-buddy-v1224-jailed-cheats-5/
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 314 replies
    • Kick the Buddy: Forever v1.8.3 Jailed Cheats +3
      Modded/Hacked App: Kick the Buddy: Forever By Playgendary Limited
      Bundle ID: com.playgendary.ktb2
      iTunes Store Link: https://apps.apple.com/us/app/kick-the-buddy-forever/id1435346021?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

      - Inifnite Currencies
      - No Ads
      - Blood Mode



      ⬇️ iOS Hack Download IPA Link: https://iosgods.com/topic/85569-kick-the-buddy-forever-v183-jailed-cheats-3/
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 150 replies
    • Gangstar Vegas Cheats v8.5.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,010 replies
    • Idle Theme Park - Tycoon Game Cheats v7.5.2 +1
      Modded/Hacked App: Idle Theme Park - Tycoon Game by Digital Things Sociedad Limitada
      Bundle ID: com.codigames.idle.theme.park.tycoon
      iTunes Store Link: https://apps.apple.com/us/app/idle-theme-park-tycoon-game/id1460772578?uo=4&at=1010lce4


      Hack Features:
      - Infinite Cash


      iOS Hack Download Link: https://iosgods.com/topic/116320-arm64-idle-theme-park-tycoon-game-cheats-v210-1/
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 564 replies
    • BitLife - Life Simulator Cheats v3.19.4 +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/
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 3,612 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