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

    • Nonogram Crossing Logic Puzzle v1.078.01 [ +3 Cheats ] Currency Max
      Modded/Hacked App: Nonogram Crossing Logic Puzzle By Two Desperados Ltd
      Bundle ID: com.twodesperados.pic.cross.picross.logic
      App Store Link: https://apps.apple.com/us/app/nonogram-crossing-logic-puzzle/id1613958816?uo=4


      🤩 Hack Features

      - Coins
      - Energy
      - Booster
      • 0 replies
    • Nonogram Crossing Logic Puzzle v1.078.01 [ +3 Jailed ] Currency Max
      Modded/Hacked App: Nonogram Crossing Logic Puzzle By Two Desperados Ltd
      Bundle ID: com.twodesperados.pic.cross.picross.logic
      App Store Link: https://apps.apple.com/us/app/nonogram-crossing-logic-puzzle/id1613958816?uo=4


      🤩 Hack Features

      - Coins
      - Energy
      - Booster
      • 0 replies
    • Candy Critters: Idle Merge v1.1.0 +4++ Jailed Cheats [ Unlimited Currencies ]
      Modded/Hacked App: Candy Critters: Idle Merge By PlaySide Studios PTY LTD
      Bundle ID: com.playsidestudios.candycritters
      App Store Link: https://apps.apple.com/us/app/candy-critters-idle-merge/id6480020380?uo=4

       


      🤩 Hack Features

      - Unlimited Currencies -> Will increase instead of decrease.
      - All Cards Unlocked
      - No Card Upgrade Cost
      - Free In-App Purchases
      • 3 replies
    • Candy Critters: Idle Merge v1.1.0 +4++ Cheats [ Unlimited Currencies ]
      Modded/Hacked App: Candy Critters: Idle Merge By PlaySide Studios PTY LTD
      Bundle ID: com.playsidestudios.candycritters
      App Store Link: https://apps.apple.com/us/app/candy-critters-idle-merge/id6480020380?uo=4

       


      🤩 Hack Features

      - Unlimited Currencies -> Will increase instead of decrease.
      - All Cards Unlocked
      - No Card Upgrade Cost
      - Free In-App Purchases
      • 0 replies
    • Loadout Warrior v2.2.4 [ +5 Jailed ] ADS NO
      Modded/Hacked App: Loadout Warrior By MobGame Pte. LTD
      Bundle ID: com.mobgame.loadout.warrior
      iTunes Store Link: https://apps.apple.com/us/app/loadout-warrior/id6743389761?uo=4
       

      🤩 Hack Features

      - ADS NO [ Rewards Free ]

      - Battle Coins

      - HP

      - ATK

      - ATK CD
      • 6 replies
    • Loadout Warrior v2.2.4 [ +5 Cheats ] ADS NO
      Modded/Hacked App: Loadout Warrior By MobGame Pte. LTD
      Bundle ID: com.mobgame.loadout.warrior
      iTunes Store Link: https://apps.apple.com/us/app/loadout-warrior/id6743389761?uo=4
       

      🤩 Hack Features

      - ADS NO [ Rewards Free ]

      - Battle Coins

      - HP

      - ATK

      - ATK CD
      • 4 replies
    • Block Clash!! v1.0.6 [+2 Jailed Cheats]
      Modded/Hacked App: Block Clash!! By treeplla Inc.
      Bundle ID: com.tree.hybrid.blockclash
      App Store Link: https://apps.apple.com/us/app/block-clash/id6745582734?uo=4

       


      🤩 Hack Features

      - Never Die
      - One Hit Kill
      • 5 replies
    • Block Clash!! v1.0.6 [+2 Cheats]
      Modded/Hacked App: Block Clash!! By treeplla Inc.
      Bundle ID: com.tree.hybrid.blockclash
      App Store Link: https://apps.apple.com/us/app/block-clash/id6745582734?uo=4


      🤩 Hack Features

      - Never Die
      - One Hit Kill
       
      • 5 replies
    • Soul Huntress: Dungeon Crawler v1.0.3 [+3 Jailed Cheats]
      Modded/Hacked App: Soul Huntress: Dungeon Crawler By Panthera Joint Stock Company
      Bundle ID: com.pantheraplay.soulhuntress
      App Store Link: https://apps.apple.com/ph/app/soul-huntress-dungeon-crawler/id6743422594?uo=4


      🤩 Hack Features

      - Never Die
      - Unlimited Currency (Always Will Increase Spend)
      - Always Can Use Items (Even when has cooldown)
      • 5 replies
    • Soul Huntress: Dungeon Crawler v1.0.3 [+3 Cheats]
      Modded/Hacked App: Soul Huntress: Dungeon Crawler By Panthera Joint Stock Company
      Bundle ID: com.pantheraplay.soulhuntress
      App Store Link: https://apps.apple.com/ph/app/soul-huntress-dungeon-crawler/id6743422594?uo=4



      🤩 Hack Features

      - Never Die
      - Unlimited Currency (Always Will Increase Spend)
      - Always Can Use Items (Even when has cooldown)
      • 4 replies
    • Tales of Brave doomsday battle v2.1.19 [ +9 Jailed ] ADS NO
      Modded/Hacked App: Tales of Brave doomsday battle By Hakan Aksar
      Bundle ID: com.tianyou.tob
      iTunes Store Link: https://apps.apple.com/us/app/tales-of-brave-doomsday-battle/id6587553322?uo=4
       

      🤩 Hack Features

      - ADS NO [ Rewards Free ]

      - Never Die

      - ONE HiT KiLL

      - Enemy Movement Speed

      - ATK Speed

      - Bullet Max 20

      - Bullet Size Big

      - Enemy Freeze

      - Wall No Hit Enemy


      ⬇️ iOS Hack Download IPA Link


      Hidden Content

      Download via the iOSGods App
      • 22 replies
    • Tales of Brave doomsday battle v2.1.19 [ +9 Cheats ] ADS NO
      Modded/Hacked App: Tales of Brave doomsday battle By Hakan Aksar
      Bundle ID: com.tianyou.tob
      iTunes Store Link: https://apps.apple.com/us/app/tales-of-brave-doomsday-battle/id6587553322?uo=4
       

      🤩 Hack Features

      - ADS NO [ Rewards Free ]

      - Never Die

      - ONE HiT KiLL

      - Enemy Movement Speed

      - ATK Speed

      - Bullet Max 20

      - Bullet Size Big

      - Enemy Freeze

      - Wall No Hit Enemy

       

      ⬇️ iOS Hack Download Link


      Hidden Content

      Download Hack
      • 14 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