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

    • Crunchyroll: Gift v1.0.2 +5 Jailed Cheats [ Unlocked ]
      Modded/Hacked App: Crunchyroll: Gift By Crunchyroll, LLC
      Bundle ID: com.crunchyroll.gv.gift
      App Store Link: https://apps.apple.com/us/app/crunchyroll-gift/id6747459734?uo=4

       
       

      🤩 Hack Features

      - God Mode
      - Unlock All Tools -> Head into Settings in-game and toggle the License button.*
      - Unlock All Passengers -> Head into Settings in-game and toggle the License button.*
      - Unlock All Memories -> Head into Settings in-game and toggle the License button.*
      -- Full Game Unlocked

      * - Only use 1 feature at a time.
      • 0 replies
    • Crunchyroll: Gift v1.0.2 +5 Cheats [ Unlocked ]
      Modded/Hacked App: Crunchyroll: Gift By Crunchyroll, LLC
      Bundle ID: com.crunchyroll.gv.gift
      App Store Link: https://apps.apple.com/us/app/crunchyroll-gift/id6747459734?uo=4

       
       

      🤩 Hack Features

      - God Mode
      - Unlock All Tools -> Head into Settings in-game and toggle the License button.*
      - Unlock All Passengers -> Head into Settings in-game and toggle the License button.*
      - Unlock All Memories -> Head into Settings in-game and toggle the License button.*
      -- Full Game Unlocked

      * - Only use 1 feature at a time.
      • 0 replies
    • Kingdom Rush Battles: TD Game v1.1.0 +4 Jailed Cheats [ No Tower Cost ]
      Modded/Hacked App: Kingdom Rush Battles: TD Game By Ironhide S.A.
      Bundle ID: com.ironhidegames.kingdomrush.mp
      App Store Link: https://apps.apple.com/ph/app/kingdom-rush-battles-td-game/id6746510979?uo=4

       
       

      🤩 Hack Features

      - Dumb Enemy -> Disables your enemy from buying towers.
      - No Tower Build Cost -> Use with Dumb Enemy.
      - No Tower Upgrade Cost -> Use with Dumb Enemy.
      - No Tower Skill Upgrade Cost -> Use with Dumb Enemy.
        • Informative
        • Winner
        • Like
      • 20 replies
    • Kingdom Rush Battles: TD Game v1.1.0 +4 Cheats [ No Tower Cost ]
      Modded/Hacked App: Kingdom Rush Battles: TD Game By Ironhide S.A.
      Bundle ID: com.ironhidegames.kingdomrush.mp
      App Store Link: https://apps.apple.com/ph/app/kingdom-rush-battles-td-game/id6746510979?uo=4

       


      🤩 Hack Features

      - Dumb Enemy -> Disables your enemy from buying towers.
      - No Tower Build Cost -> Use with Dumb Enemy.
      - No Tower Upgrade Cost -> Use with Dumb Enemy.
      - No Tower Skill Upgrade Cost -> Use with Dumb Enemy.
        • Agree
        • Haha
        • Winner
        • Like
      • 12 replies
    • World Conqueror 4 v3.0.1 +5 Jailed Cheats [ Unlimited Currencies ]
      Modded/Hacked App: World Conqueror 4 By 悦 张
      Bundle ID: com.zhangyue.wc4
      iTunes Store Link: https://apps.apple.com/us/app/world-conqueror-4/id1258468290?uo=4


      Hack Features:
      - Unlimited Gold -> Earn or spend some.
      - Unlimited Medals -> Earn or spend some.
      - Unlimited Energy -> Earn or spend some.
      - Unlimited Industry Points -> Earn or spend some.
      - Unlimited Technology Points -> Earn or spend some.


      Jailbreak required hack(s): [Mod Menu Hack] World Conqueror 4 v2.5.0 +5 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/
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 81 replies
    • World Conqueror 4 v3.0.1 +5 Cheats [ Unlimited Currencies ]
      Modded/Hacked App: World Conqueror 4 By 悦 张
      Bundle ID: com.zhangyue.wc4
      iTunes Store Link: https://apps.apple.com/us/app/world-conqueror-4/id1258468290?uo=4


      Hack Features:
      - Unlimited Gold -> Earn or spend some.
      - Unlimited Medals -> Earn or spend some.
      - Unlimited Energy -> Earn or spend some.
      - Unlimited Industry Points -> Earn or spend some.
      - Unlimited Technology Points -> Earn or spend some.


      Non-Jailbroken & No Jailbreak required hack(s): [IPA Mod Menu] World Conqueror 4 v2.5.0 +5 Jailed Cheats [ Unlimited Currencies ] - 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/
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 61 replies
    • Monster Hunter Puzzles v2.21.01 +7 Jailed Cheats [ Unlimited Currencies ]
      Modded/Hacked App: Monster Hunter Puzzles By CAPCOM Co., Ltd
      Bundle ID: jp.co.capcom.mhpuzzle
      iTunes Store Link: https://apps.apple.com/us/app/monster-hunter-puzzles/id1591864714?uo=4


      Mod Requirements:
      - Non-Jailbroken/Jailed or Jailbroken iPhone/iPad/iPod Touch.
      - Sideloadly / Cydia Impactor or alternatives.
      - A Computer Running Windows/macOS/Linux with iTunes installed.


      Hack Features:
      - Unlimited Acorns -> Earn or spend some.
      - Unlimited Gems -> Earn or spend some.
      - Unlimited Tickets -> Earn or spend some.
      - Unlimited Lives -> Will not decrease.
      - Unlimited Boosters -> Will not decrease.
      - Unlimited Moves -> Will not decrease.
      - Auto Win


      Jailbreak required hack(s): [Mod Menu Hack] Monster Hunter Puzzles v2.01.02 +7 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/
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 63 replies
    • Disney Emoji Blitz Game v73.1.0 +1++ Jailed Cheat [ Unlimited Currencies ]
      Modded/Hacked App: Disney Emoji Blitz Game By Jam City, Inc.
      Bundle ID: com.disney.emojimatch
      iTunes Store Link: https://apps.apple.com/us/app/disney-emoji-blitz-game/id1017551780
       

      Hack Features:
      - Unlimited Currencies -> Earn some.


      Jailbreak required hack(s): https://iosgods.com/topic/168886-disney-emoji-blitz-game-all-versions-1-cheats-unlimited-currencies/
      Modded Android APK(s): https://iosgods.com/forum/68-android-section/
      For more fun, check out the Club(s): https://iosgods.com/clubs/
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 217 replies
    • Disney Emoji Blitz Game v73.1.0 +1++ Cheat [ Unlimited Currencies ]
      Modded/Hacked App: Disney Emoji Blitz Game By Jam City, Inc.
      Bundle ID: com.disney.emojimatch
      iTunes Store Link: https://apps.apple.com/us/app/disney-emoji-blitz-game/id1017551780
       

      Hack Features:
      - Unlimited Currencies -> Earn some.


      Non-Jailbroken & No Jailbreak required hack(s): https://iosgods.com/topic/168888-disney-emoji-blitz-game-v5320-1-jailed-cheat-unlimited-currencies/
      Modded Android APK(s): https://iosgods.com/forum/68-android-section/
      For more fun, check out the Club(s): https://iosgods.com/clubs/
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 68 replies
    • Monster Hunter Puzzles v2.21.01 +7 Cheats [ Unlimited Currencies ]
      Modded/Hacked App: Monster Hunter Puzzles By CAPCOM Co., Ltd
      Bundle ID: jp.co.capcom.mhpuzzle
      iTunes Store Link: https://apps.apple.com/us/app/monster-hunter-puzzles/id1591864714?uo=4


      Hack Features:
      - Unlimited Acorns -> Earn or spend some.
      - Unlimited Gems -> Earn or spend some.
      - Unlimited Tickets -> Earn or spend some.
      - Unlimited Lives -> Will not decrease.
      - Unlimited Boosters -> Will not decrease.
      - Unlimited Moves -> Will not decrease.
      - Auto Win


      Non-Jailbroken & No Jailbreak required hack(s): [Non-Jailbroken Hack] Monster Hunter Puzzles v2.01.02 +5 Jailed Cheats [ Unlimited Currencies ] - 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/
        • Informative
        • Haha
        • Thanks
        • Winner
        • Like
      • 39 replies
    • Good Pizza, Great Pizza v5.38.0 +8 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
      - Unlimited Ad Tickets

      VIP
      -̶ ̶U̶n̶l̶i̶m̶i̶t̶e̶d̶ ̶P̶i̶z̶z̶a̶ ̶P̶a̶s̶s̶ ̶T̶o̶k̶e̶n̶s̶
      ̶-̶ ̶C̶h̶e̶f̶ ̶P̶a̶s̶s̶ ̶U̶n̶l̶o̶c̶k̶e̶d̶
      ̶-̶ ̶M̶a̶x̶ ̶P̶i̶z̶z̶a̶ ̶P̶a̶s̶s̶ ̶L̶e̶v̶e̶l̶
       ̶-̶ ̶S̶t̶a̶r̶t̶e̶r̶ ̶B̶u̶n̶d̶l̶e̶ ̶U̶n̶l̶o̶c̶k̶e̶d̶
      - Unlimited Paint Tickets
      - Unlimited Event Currency
      - Max Event Level
      - Unlimited Event Score
      - All Achievements Completed
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 427 replies
    • Good Pizza, Great Pizza v5.38.0 +8 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
      - Unlimited Ad Tickets

      VIP
      -̶ ̶U̶n̶l̶i̶m̶i̶t̶e̶d̶ ̶P̶i̶z̶z̶a̶ ̶P̶a̶s̶s̶ ̶T̶o̶k̶e̶n̶s̶
      ̶-̶ ̶C̶h̶e̶f̶ ̶P̶a̶s̶s̶ ̶U̶n̶l̶o̶c̶k̶e̶d̶
      ̶-̶ ̶M̶a̶x̶ ̶P̶i̶z̶z̶a̶ ̶P̶a̶s̶s̶ ̶L̶e̶v̶e̶l̶
       ̶-̶ ̶S̶t̶a̶r̶t̶e̶r̶ ̶B̶u̶n̶d̶l̶e̶ ̶U̶n̶l̶o̶c̶k̶e̶d̶
      - Unlimited Paint Tickets
      - Unlimited Event Currency
      - Max Event Level
      - Unlimited Event Score
      - All Achievements Completed
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 214 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