Jump to content

LF help with hooking function calls with latest mod menu template (Unity)


n1ce0n3

2 posts in this topic

Recommended Posts

Hi there guys,

 

It's been a while since I did mod something for iOS, please, let me know what I'm doing wrong here.

Below is the top of my Tweak.xm

#import "Macros.h"

/***********************************************************
  INSIDE THE FUNCTION BELOW YOU'LL HAVE TO ADD YOUR SWITCHES!
***********************************************************/


void(*Load)(void *this_) = (void(*) (void *))getRealOffset("0x101D46508");
void(*ctor0)(void *this_) = (void(*) (void *))getRealOffset("0x101DFA0B4");
void(*ctor1)(void *this_) = (void(*) (void *))getRealOffset("0x101D4752C");
void(*ctor2)(void *this_) = (void(*) (void *))getRealOffset("0x101D475C0");
void(*ctor3)(void *this_) = (void(*) (void *))getRealOffset("0x10247B024");
void(*ctor4)(void *this_) = (void(*) (void *))getRealOffset("0x10247B610");
void(*ctor5)(void *this_) = (void(*) (void *))getRealOffset("0x101B75B94");
void(*ctor6)(void *this_) = (void(*) (void *))getRealOffset("0x101E26324");
void(*OnGui)(void *this_) = (void(*) (void *))getRealOffset("0x101D46B6C");

void (*oldBattle)(void *e);
void onBattle(void *e){
  if (e != NULL) {
  if ([switches isSwitchOn:NSSENCRYPT("onBattle")]) {
      ctor0(e);
      ctor1(e);
      ctor2(e);
      ctor3(e);
      ctor4(e);
      ctor5(e);
      ctor6(e);
      Load(e);
      OnGui(e);
      return oldBattle(e);
  }
  else
    return oldBattle(e);
  } 
}


void setup()
{


  [switches addSwitch:NSSENCRYPT("onBattle")
    description:NSSENCRYPT("onBattle")
  ];


HOOK(ENCRYPTOFFSET("0x101C6B714"), onBattle, oldBattle);
}

 

I'm not C guy, so I don't completely understand the 'void(*ctor5)(void *this_) = (void(*) (void *))getRealOffset("0x101B75B94");' structure, but it used to work pretty much like that in the old days.

The mod menu I'm using is this one: https://github.com/joeyjurjens/iOS-Mod-Menu-Template-for-Theos

It is mentioned in the repo's readme that

A quick note before showing all the switch examples; You can and should encrypt offsets, hexes, c-strings and NSStrings. Below you can find the proper syntax per string-type.

ENCRYPTOFFSET("0x10047FD90")

However, the template tweak.xm doesn't have any "HOOK's" or getting void from an existing pointer into a variable (?not sure if that makes sense)

Basically, what I'm trying to do is:

There is a function, e.g. killAll with the address 0x1337FFFF and a Battle Update function on another address.

First I need to get the killAll function from an address.

 

Earlier, I would do something like that (void(*killAll)(void *instance)  = (void (*)(void*))getRealOffset(0x1337FFFF);

Nowadays, I'm not sure about these things and would love you to help me figure:

1.Whether that is going to work  or not

2. Should I do getRealOffset(0x1337FFFF) or getRealOffset(ENCRYPTOFFSET("0x1337FFFF"));

3. Should I add the ENCRYPTOFFSET part in the HOOK at the very end of my code

4. Anything else I'm missing or doing wrong.

 

Also, according to my logic - these two codes below should result in the same

if ([switches isSwitchOn:NSSENCRYPT("onBattle")]) {
      ctor0(e);
      ctor1(e);
      ctor2(e);
      ctor3(e);
      ctor4(e);
      ctor5(e);
      ctor6(e);
      Load(e);
      OnGui(e);
      return oldBattle(e);
  }
  else
    return oldBattle(e);
  } 

or 


if ([switches isSwitchOn:NSSENCRYPT("onBattle")]) {
      ctor0(e);
      ctor1(e);
      ctor2(e);
      ctor3(e);
      ctor4(e);
      ctor5(e);
      ctor6(e);
      Load(e);
      OnGui(e);
  }
     return oldBattle(e);
  } 

Just wanted to make sure about the last one too.

 

Thanks in advance

 
Link to comment
Share on other sites

On 12/20/2021 at 12:36 AM, n1ce0n3 said:

1.Whether that is going to work  or not

2. Should I do getRealOffset(0x1337FFFF) or getRealOffset(ENCRYPTOFFSET("0x1337FFFF"));

3. Should I add the ENCRYPTOFFSET part in the HOOK at the very end of my code

4. Anything else I'm missing or doing wrong.

1- it depends on the game
2- doesn't matter
3- no need for that " i recommend use it for strings & bytes"
4- 👇

 

if ([switches isSwitchOn:NSSENCRYPT("onBattle")]) {
      ctor0(e);
      ctor1(e);
      ctor2(e);
      ctor3(e);
      ctor4(e);
      ctor5(e);
      ctor6(e);
      Load(e);
      OnGui(e);
  }
     oldBattle(e);
  } 

 

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

    • Little Piggy Defense v1.04.31 +1 Jailed Cheat [ God Mode ]
      Modded/Hacked App: Little Piggy Defense By Game Duo Co.,Ltd.
      Bundle ID: net.gameduo.tbd
      iTunes Store Link: https://apps.apple.com/us/app/little-piggy-defense/id6467606457?uo=4


      Hack Features:
      - God Mode


      Jailbreak required hack(s): [Mod Menu Hack] Little Piggy Defense v1.00.11 +3 Cheats [ Damage & Defence ] - 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/
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 32 replies
    • Little Piggy Defense v1.04.31 +3 Cheats [ Damage & Defence ]
      Modded/Hacked App: Little Piggy Defense By Game Duo Co.,Ltd.
      Bundle ID: net.gameduo.tbd
      iTunes Store Link: https://apps.apple.com/us/app/little-piggy-defense/id6467606457?uo=4


      Hack Features:
      - Damage Multiplier
      - Defence Multiplier
      - Tower Defence Multiplier


      Non-Jailbroken & No Jailbreak required hack(s): [Non-Jailbroken Hack] Little Piggy Defense v1.00.11 +1 Jailed Cheat [ God Mode ] - 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/
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 61 replies
    • MARVEL Puzzle Quest: Hero RPG v301.0.676403 +1 Jailed Cheat [ One-Hit Kill ]
      Modded/Hacked App: MARVEL Puzzle Quest: Hero RPG By D3PA
      Bundle ID: com.d3p.yorkMPQ
      iTunes Store Link: https://apps.apple.com/us/app/marvel-puzzle-quest-hero-rpg/id618349779


      Hack Features:
      - One-Hit Kill


      Jailbreak required hack(s): [Mod Menu Hack] MARVEL Puzzle Quest: Hero RPG v264.0.617994 +2 Cheats [ One-Hit Kill ] - 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
      • 76 replies
    • MARVEL Puzzle Quest: Hero RPG ( All Versions ) +2 Cheats [ One-Hit Kill ]
      Modded/Hacked App: MARVEL Puzzle Quest: Hero RPG By D3PA
      Bundle ID: com.d3p.yorkMPQ
      iTunes Store Link: https://apps.apple.com/us/app/marvel-puzzle-quest-hero-rpg/id618349779


      Hack Features:
      - God Mode -> Linked. Wait until it's the enemies turn then enable this feature. This feature will auto update itself once a new version of the app is released!
      - One-Hit Kill -> Linked. Wait until it's your turn then enable this feature. This feature will auto update itself once a new version of the app is released!


      Non-Jailbroken & No Jailbreak required hack(s): [Non-Jailbroken Hack] MARVEL Puzzle Quest: Hero RPG v264.0.617994 +1 Jailed Cheat [ One-Hit Kill ] - 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
      • 41 replies
    • [ VIP ] Zombie State: Rogue-like FPS v1.0.1 +9 Jailed Cheats [ God Mode & O-HK ]
      Modded/Hacked App: Zombie State: Rogue-like FPS By MY.GAMES B.V.
      Bundle ID: games.my.zombie.shooter
      iTunes Store Link: https://apps.apple.com/gb/app/zombie-state-rogue-like-fps/id6451382835?uo=4


      Hack Features:
      - Unlimited Ammo -> Will not decrease.
      - No Recoil
      - No Spread
      - God Mode
      - One-Hit Kill
      - Unlimited Currencies -> Will not decrease.
      - Unlock All Heroes
      - Unlock All Weapons
      - Battle Pass Purchased


      Jailbreak required hack(s): [Mod Menu Hack] [ VIP ] Zombie State: Rogue-like FPS +13 Cheats [ Damage & Defence ] - 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
        • Haha
        • Thanks
        • Like
      • 35 replies
    • [ VIP ] Zombie State: Rogue-like FPS v1.0.1 +13 Cheats [ Damage & Defence ]
      Modded/Hacked App: Zombie State: Rogue-like FPS By MY.GAMES B.V.
      Bundle ID: games.my.zombie.shooter
      iTunes Store Link: https://apps.apple.com/gb/app/zombie-state-rogue-like-fps/id6451382835?uo=4


      Hack Features:
      - Unlimited Ammo -> Will not decrease.
      - No Recoil
      - No Spread
      - Increased Fire Rate
      - Damage Multiplier
      - Defence Multiplier
      - Currency Hack -> Input a value then spend some to gain that much.
      - Move Speed Multiplier
      - Kill All Enemies
      - Become Invisible
      - Unlock All Heroes
      - Unlock All Weapons
      - Battle Pass Purchased


      Non-Jailbroken & No Jailbreak required hack(s): [No Jailbreak Required] [ VIP ] Zombie State: Rogue-like FPS +9 Jailed Cheats [ God Mode & O-HK ] - ViP Non-Jailbroken Hacks & 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/
        • Agree
        • Thanks
        • Winner
        • Like
      • 56 replies
    • [ FREE ] Zombie State: Rogue-like FPS v1.0.1 +3 Jailed Cheats [ Unlimited Ammo ]
      Modded/Hacked App: Zombie State: Rogue-like FPS By MY.GAMES B.V.
      Bundle ID: games.my.zombie.shooter
      iTunes Store Link: https://apps.apple.com/gb/app/zombie-state-rogue-like-fps/id6451382835?uo=4


      Hack Features:
      - Unlimited Ammo -> Will not decrease.
      - No Recoil
      - No Spread


      Jailbreak required hack(s): [Mod Menu Hack] [ FREE ] Zombie State: Rogue-like FPS +4 Cheats [ Unlimited Ammo ] - 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/
        • Agree
        • Thanks
        • Winner
        • Like
      • 23 replies
    • [ FREE ] Zombie State: Rogue-like FPS v1.0.1 +4 Cheats [ Unlimited Ammo ]
      Modded/Hacked App: Zombie State: Rogue-like FPS By MY.GAMES B.V.
      Bundle ID: games.my.zombie.shooter
      iTunes Store Link: https://apps.apple.com/gb/app/zombie-state-rogue-like-fps/id6451382835?uo=4


      Hack Features:
      - Unlimited Ammo -> Will not decrease.
      - No Recoil
      - No Spread
      - Increased Fire Rate


      Non-Jailbroken & No Jailbreak required hack(s): [Non-Jailbroken Hack] [ FREE ] Zombie State: Rogue-like FPS +3 Jailed Cheats [ Unlimited Ammo ] - 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/
        • Agree
        • Thanks
        • Winner
        • Like
      • 22 replies
    • Mini Tennis: Perfect Smash v1.7.2 +1 Jailed Cheat [ Dumb Opponents ]
      Modded/Hacked App: Mini Tennis: Perfect Smash By Miniclip.com
      Bundle ID: com.miniclip.minitennis
      iTunes Store Link: https://apps.apple.com/us/app/mini-tennis-perfect-smash/id1615962417
       

      Hack Features:
      - Dumb Opponents -> The opponent will always hit the ball into the net.


      Jailbreak required hack(s): https://iosgods.com/topic/169075-mini-tennis-v111-2-cheats-auto-win/#comment-5355489
      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
        • Thanks
        • Winner
        • Like
      • 55 replies
    • Family Tree! - Logic Puzzles v1.1.1 +20++ Jailed Cheats [ Debug Menu ]
      Modded/Hacked App: Family Tree! - Logic Puzzles By Lion Studios Plus LLC
      Bundle ID: com.regulusstudio.familytree
      iTunes Store Link: https://apps.apple.com/us/app/family-tree-logic-puzzles/id6453159988?uo=4


      Hack Features:
      - Debug Menu -> Head over to Settings and toggle the Sound button.


      Jailbreak required hack(s): [Mod Menu Hack] Family Tree! - Logic Puzzles v0.1.18 +20++ Cheats [ Debug Menu ] - 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/
        • Agree
        • Like
      • 10 replies
    • Family Tree! - Logic Puzzles v1.1.1 +20++ Cheats [ Debug Menu ]
      Modded/Hacked App: Family Tree! - Logic Puzzles By Lion Studios Plus LLC
      Bundle ID: com.regulusstudio.familytree
      iTunes Store Link: https://apps.apple.com/us/app/family-tree-logic-puzzles/id6453159988?uo=4


      Hack Features:
      - Debug Menu -> Head over to Settings and toggle the Sound button.


      Non-Jailbroken & No Jailbreak required hack(s): [Non-Jailbroken Hack] Family Tree! - Logic Puzzles v0.1.18 +20++ Jailed Cheats [ Debug Menu ] - 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/
        • Agree
        • Haha
        • Like
      • 14 replies
    • Earth Inc. v3.1.0 +3 Jailed Cheats [ Unlimited Currencies ]
      Modded/Hacked App: Earth Inc. By Treetop Crew Oy
      Bundle ID: com.TreetopCrew.EarthInc
      iTunes Store Link: https://apps.apple.com/us/app/earth-inc/id1582514877?uo=4


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


      Jailbreak required hack(s): [Mod Menu Hack] Earth Inc. v2.2.1 +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
        • Thanks
        • Winner
        • Like
      • 33 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