Jump to content

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


2 posts in this topic

Recommended Posts

Posted

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

 
Posted
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);
  } 

 

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

    • Obsidian Knight RPG v1.200.12 [+3 Jailed Cheats]
      Modded/Hacked App: Obsidian Knight RPG By ActFirst Games AB
      Bundle ID: com.actfirstgames.obsidianknight
      iTunes Store Link: https://apps.apple.com/us/app/obsidian-knight-rpg/id6505061490?uo=4



      🚀 Hack Features

      - Unlimited Currency
      - God Mode / Never Die
      - High Damage / OHK
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 30 replies
    • Obsidian Knight RPG v1.200.12 [+3 Cheats]
      Modded/Hacked App: Obsidian Knight RPG By ActFirst Games AB
      Bundle ID: com.actfirstgames.obsidianknight
      iTunes Store Link: https://apps.apple.com/us/app/obsidian-knight-rpg/id6505061490?uo=4

       

      🚀 Hack Features

      - Unlimited Currency
      - God Mode / Never Die
      - High Damage / OHK
        • Agree
        • Haha
        • Winner
        • Like
      • 31 replies
    • Margonem Adventures v2.4.6 [+3 Jailed Cheats]
      Modded/Hacked App: Margonem Adventures By GARMORY sp. z o.o. sp. k.
      Bundle ID: pl.Garmory.MargonemAdventures
      iTunes Store Link: https://apps.apple.com/us/app/margonem-adventures/id6444410609?uo=4

       

      🤩 Hack Features

      - Enemy Can't Move
      - Enemy Can't Attack
      - Unlimited Mana
        • Like
      • 24 replies
    • Margonem Adventures v2.4.6 [+3 Cheats]
      Modded/Hacked App: Margonem Adventures By GARMORY sp. z o.o. sp. k.
      Bundle ID: pl.Garmory.MargonemAdventures
      iTunes Store Link: https://apps.apple.com/us/app/margonem-adventures/id6444410609?uo=4



      🤩 Hack Features

      - Enemy Can't Move
      - Enemy Can't Attack
      - Unlimited Mana
        • Agree
        • Winner
        • Like
      • 16 replies
    • Pal Go: Tower Defense TD v0.4.51 [+7 Cheats]
      Modded/Hacked App: Pal Go: Tower Defense TD By Playwind Ltd
      Bundle ID: com.playwindgames.freedefender
      iTunes Store Link: https://apps.apple.com/us/app/pal-go-tower-defense-td/id6479316663?uo=4


       

      🚀 Hack Features

      - [VIP] Freeze Currency (Currency will not decrease when used)

      - [VIP] Currency Always Enough (Buy even when you don't have enough currency)

      - [Free] Higher Recruit Energy (Gives 500 Recruit Energy Every Wave)

      - [Free] Always Can Drag Hero

      - [Free] Skip Ads

      - [Free] No Attack Cooldown

      - [Free] Global Speed Multiplier (Enable Inside Battle)

       

      Warning


      Do not use on main account. There is a chance of ban. Not responsible for any bans.

       


      🍏 For Non-Jailbroken & No Jailbreak required hacks: https://iosgods.com/forum/79-no-jailbreak-section/
      🤖 Modded Android APK(s): https://iosgods.com/forum/68-android-section/
        • Informative
        • Agree
        • Thanks
        • Winner
        • Like
      • 71 replies
    • Pal Go: Tower Defense TD v0.4.51 [+7 Jailed Cheats]
      Modded/Hacked App: Pal Go: Tower Defense TD By Playwind Ltd
      Bundle ID: com.playwindgames.freedefender
      iTunes Store Link: https://apps.apple.com/us/app/pal-go-tower-defense-td/id6479316663?uo=4


       

      Hack Features

      - [VIP] Freeze Currency (Currency will not decrease when used)

      - [VIP] Currency Always Enough (Buy even when you don't have enough currency)

      - [Free] Higher Recruit Energy (Gives 500 Recruit Energy Every Wave)

      - [Free] Always Can Drag Hero

      - [Free] Skip Ads

      - [Free] No Attack Cooldown

      - [Free] Global Speed Multiplier (Enable Inside Battle)

       

      Warning


      Do not use on main account. There is a chance of ban. Not responsible for any bans.

       

      Jailbreak required iOS hacks: https://iosgods.com/forum/5-game-cheats-hack-requests/
      Modded Android APKs: https://iosgods.com/forum/68-android-section/
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 94 replies
    • Fortress: Stickman Trenches v3.5 [+2 Jailed Cheats]
      Modded/Hacked App: Fortress: Stickman Trenches By APPWILL COMPANY LTD
      Bundle ID: com.g1.growfortmarines
      App Store Link: https://apps.apple.com/us/app/fortress-stickman-trenches/id6445945405?uo=4



      🤩 Hack Features

      - Enemy Can't Attack
      - Unlimited Currency
        • Like
      • 2 replies
    • Fortress: Stickman Trenches v3.5 [+2 Cheats]
      Modded/Hacked App: Fortress: Stickman Trenches By APPWILL COMPANY LTD
      Bundle ID: com.g1.growfortmarines
      App Store Link: https://apps.apple.com/us/app/fortress-stickman-trenches/id6445945405?uo=4


      🤩 Hack Features

      - Enemy Can't Attack
      - Unlimited Currency
       
      • 1 reply
    • Zombie Fortress: Trap Defense v0.13.1 [+6 Jailed Cheats]
      Modded/Hacked App: Zombie Fortress: Trap Defense By SayGames LTD
      Bundle ID: com.nlabsoft.zombiecrusher.s
      App Store Link: https://apps.apple.com/us/app/zombie-fortress-trap-defense/id6747713523?uo=4



      🤩 Hack Features

      - Add Cash
      - Add Diamond
      - Add Energy
      - Add Parts
      - Never Die
      - Add Battle Gold (Enable inside battle)
        • Agree
        • Winner
        • Like
      • 5 replies
    • Zombie Fortress: Trap Defense v0.13.1 [+6 Cheats]
      Modded/Hacked App: Zombie Fortress: Trap Defense By SayGames LTD
      Bundle ID: com.nlabsoft.zombiecrusher.s
      App Store Link: https://apps.apple.com/us/app/zombie-fortress-trap-defense/id6747713523?uo=4



      🤩 Hack Features

      - Add Cash
      - Add Diamond
      - Add Energy
      - Add Parts
      - Never Die
      - Add Battle Gold (Enable inside battle)
        • Winner
        • Like
      • 2 replies
    • Shadowborn v0.6.1 Debug Menu [+8 Jailed Cheats]
      Modded/Hacked App: Shadowborn By VIVA GAMES S.L.
      Bundle ID: com.onemb.shadowborn
      App Store Link: https://apps.apple.com/us/app/shadowborn/id6738343504?uo=4

       

      🤩 Hack Features

      - Debug Menu
        • Haha
        • Winner
        • Like
      • 12 replies
    • Shadowborn v0.6.1 Debug Menu [+8 Cheats]
      Modded/Hacked App: Shadowborn By VIVA GAMES S.L.
      Bundle ID: com.onemb.shadowborn
      App Store Link: https://apps.apple.com/us/app/shadowborn/id6738343504?uo=4



      🤩 Hack Features

      - Debug Menu
       
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 19 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