Jump to content

How to call the function? (iOS jailbreak)


nngot44
Go to solution Solved by Saitama,

10 posts in this topic

Recommended Posts

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? :(

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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)
 

Link to comment
Share on other sites

  • Solution

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
Link to comment
Share on other sites

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
Link to comment
Share on other sites

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
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

    • My Fantasy: Choose Your Story v2.9.3 +3 Jailed Cheats [ Unlimited Currencies ]
      Modded/Hacked App: My Fantasy: Choose Your Story By GM UNICORN CORPORATION LIMITED
      Bundle ID: gmem.episode
      iTunes Store Link: https://apps.apple.com/us/app/my-fantasy-choose-your-story/id1491717191


      Hack Features:
      - Unlimited Tickets -> Use some.
      - Unlimited Diamonds -> Use some.
      - Premium Enabled


      Jailbreak required hack(s): [Mod Menu Hack] My Fantasy: Choose Your Story v2.2.5 +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/
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 130 replies
    • My Fantasy: Choose Your Story v2.9.3 +3 Cheats [ Unlimited Currencies ]
      Modded/Hacked App: My Fantasy: Choose Your Story By GM UNICORN CORPORATION LIMITED
      Bundle ID: gmem.episode
      iTunes Store Link: https://apps.apple.com/us/app/my-fantasy-choose-your-story/id1491717191
       

      Hack Features:
      - Unlimited Tickets -> Use some.
      - Unlimited Diamonds -> Use some.
      - Premium Enabled


      Non-Jailbroken & No Jailbreak required hack(s): [Non-Jailbroken Hack] My Fantasy: Choose Your Story v2.2.5 +2 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
      • 79 replies
    • Zombie Idle Defense v2.5.4 +3 Jailed Cheats [ Unlimited Currencies ]
      Modded/Hacked App: Zombie Idle Defense By THAI DONG COMPANY LIMITED
      Bundle ID: com.tdcgame.idle.zombie
      iTunes Store Link: https://apps.apple.com/us/app/zombie-idle-defense/id1509441400?uo=4


      Hack Features:
      - Unlimited Cash -> Spend some.
      - Unlimited Coins -> Will increase instead of decrease.
      - Free In-App Purchases -> Toggle on via iGMenu.


      Jailbreak required hack(s): [Mod Menu Hack] Zombie Idle Defense ( All Versions ) +3 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
      • 25 replies
    • Zombie Idle Defense ( All Versions ) +3 Cheats [ Unlimited Currencies ]
      Modded/Hacked App: Zombie Idle Defense By THAI DONG COMPANY LIMITED
      Bundle ID: com.tdcgame.idle.zombie
      iTunes Store Link: https://apps.apple.com/us/app/zombie-idle-defense/id1509441400?uo=4


      Hack Features:
      - Unlimited Cash -> Spend some.
      - Unlimited Coins -> Will increase instead of decrease.
      - Free In-App Purchases


      Non-Jailbroken & No Jailbreak required hack(s): [Non-Jailbroken Hack] Zombie Idle Defense v2.4.1 +3 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/
        • Haha
        • Thanks
        • Like
      • 20 replies
    • MeChat v4.20.0 +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.


      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/
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 615 replies
    • Good Pizza, Great Pizza v5.11.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/
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 68 replies
    • Good Pizza, Great Pizza v5.11.0 +2 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


      Non-Jailbroken & No Jailbreak required hack(s): [Non-Jailbroken Hack] Good Pizza, Great Pizza v5.5.6 +2 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
      • 38 replies
    • [ VIP ] MeChat ( All Versions ) +1 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 -> Earn some then uninstall this hack. DO NOT SPEND ANY GEMS WHILST THIS FEATURE IS ENABLED!


      Non-Jailbroken & No Jailbreak required hack(s): [Non-Jailbroken Hack] MeChat - Love Secrets v3.3.2 +1 Jailed Cheat [ Unlimited Gems ] - Free Non-Jailbroken IPA Cheats - iOSGods
      Free Jailbreak required hack(s): [Mod Menu Hack] [Free] MeChat - Love Secrets v3.3.2 +1 Cheat [ Unlimited Gems ] - 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
      • 91 replies
    • [ FREE ] MeChat ( All Versions ) +1 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.


      Non-Jailbroken & No Jailbreak required hack(s): [Non-Jailbroken Hack] MeChat - Love Secrets v3.3.2 +1 Jailed Cheat [ Unlimited Gems ] - Free Non-Jailbroken IPA 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/
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 234 replies
    • BIG NAME: City Lovin v0.30.1 +3 Jailed Cheats [ Unlimited Currencies ]
      Modded/Hacked App: BIG NAME: City Lovin By Shanghai zhuomian Network Technology Co., Ltd
      Bundle ID: com.facetgame.citylovin
      iTunes Store Link: https://apps.apple.com/us/app/big-name-city-lovin/id6443984911?uo=4


      Hack Features:
      - Unlimited Cash -> Earn some.
      - Unlimited Diamonds -> Earn some.
      - Unlimited Lives -> Will not decrease.


      Jailbreak required hack(s): [Mod Menu Hack] BIG NAME: City Lovin v0.29.3 +3 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/
        • Winner
        • Like
      • 4 replies
    • BIG NAME: City Lovin v0.30.1 +3 Cheats [ Unlimited Currencies ]
      Modded/Hacked App: BIG NAME: City Lovin By Shanghai zhuomian Network Technology Co., Ltd
      Bundle ID: com.facetgame.citylovin
      iTunes Store Link: https://apps.apple.com/us/app/big-name-city-lovin/id6443984911?uo=4


      Hack Features:
      - Unlimited Cash -> Earn some.
      - Unlimited Diamonds -> Earn some.
      - Unlimited Lives -> Will not decrease.


      Non-Jailbroken & No Jailbreak required hack(s): [Non-Jailbroken Hack] BIG NAME: City Lovin v0.29.3 +3 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/
        • Thanks
        • Winner
        • Like
      • 5 replies
    • Cash Masters: Billionaire Life v1.5.8 +2 Jailed Cheats [ Unlimited Cash ]
      Modded/Hacked App: Cash Masters: Billionaire Life By USPEX ARASTIRMA GELISTIRME YAZILIM BILGISAYAR SANAYI VE TICARET ANONIM SIRKETI
      Bundle ID: com.uspex.hts
      iTunes Store Link: https://apps.apple.com/us/app/cash-masters-billionaire-life/id1636818775
       

      Hack Features:
      - Unlimited Cash -> Will increase instead of decrease.
      - Free In-App Purchases -> Toggle on via iGMenu.


      Jailbreak required hack(s): [Mod Menu Hack] Cash Masters: Billionaire Life v1.0.0 +2 Cheats [ Unlimited Cash ] - 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
      • 44 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