Jump to content

Can a you set a value to a function pointer inside a hook?


Go to solution Solved by Ted2,

6 posts in this topic

Recommended Posts

Posted

Let's say I found this method and I wanna change the value to 0:

private int ReloadDuration(); // 0x2347C82

I would just do it by hooking it and returning 0 like this:

int (*old_ReloadDuration)(void *instance);
int ReloadDuration(void *instance)
{
  if(instance != NULL)
  {
   return 0; 
  }
  return old_ReloadDuration(instance);
}
// MShookfunction whatever lol

 

But can I do it by making a function pointer and changing the value of it inside a hook and how would I do it?

Would I do it like this?

int (*ReloadDuration)(void *instance) = (int (*)(void *))getAbsoluteAddress(targetLibName, 0xOFFSET); // Function pointer for int ReloadDuration

void (*old_FixedUpdate)(void *instance);
void FixedUpdate(void *instance)
{
 if(instance != NULL)
 {
  int Reloadtime = ReloadDuration(instance); // Declare a variable to our function pointer and call it ReloadTime
   int ReloadTime = 0; // Set the value to 0
 }
  old_FixedUpdate(instance);
}
// MSHookfunction of Fixedupdate, whatever

 

@Ted2 you or anyone can help me please?

  • Solution
Posted (edited)

No, in programming you have getters and setters;

int getCoins() {
	return coins
}

void setCoins(int newValue) {
	coins = new_value
}

As you can see, to one of those functions you can pass a new value (SET). The other one just returns a variable (GET).

Function pointers are not any different, because the function pointer is that function and so, they work the same.

 

If for some reason you don't want to hook it, then I recommend opening the binary in IDA, go to the ReloadDuration method, and see which variable(s) is being used here (0x<some_value>. I assume this is an Unity game, so on top of the class ReloadDuration is in, you'll find a list of variables. See which one of them is inside ReloadDuration.

You can then change these variables in the FixedUpdate method, like so:

*(int*)((uint64_t)instance + 0x<variable_code> = 0;

 

Updated by Ted2
  • Like 1
Posted
8 hours ago, Ted2 said:

No, in programming you have getters and setters;


int getCoins() {
	return coins
}

void setCoins(int newValue) {
	coins = new_value
}

As you can see, to one of those functions you can pass a new value (SET). The other one just returns a variable (GET).

Function pointers are not any different, because the function pointer is that function and so, they work the same.

 

If for some reason you don't want to hook it, then I recommend opening the binary in IDA, go to the ReloadDuration method, and see which variable(s) is being used here (0x<some_value>. I assume this is an Unity game, so on top of the class ReloadDuration is in, you'll find a list of variables. See which one of them is inside ReloadDuration.

You can then change these variables in the FixedUpdate method, like so:


*(int*)((uint64_t)instance + 0x<variable_code> = 0;

 

Okay, I don't have a problem with hooking, it's just that I wanted to know if it was possible to set a value to a function inside a hook, but other than that, I have no problem patching or hooking the function.

Posted

@Ted2 I just have one more quick question, that i'll ask here, I already asked on another site, but didn't receive a good response. So there was one class called IAPManager or something like that, and inside it there were many useful functions that if called, would buy you whatever it is supposed to, but inside that class there was no Update/LateUpdate/FixedUpdate method (I know in some cases they can be renamed, but I looked and that wasn't the case), so would I hook Start or Awake and call those functions through a function pointer? Which one works, or does neither work?

Posted
19 minutes ago, PixelYT said:

@Ted2 I just have one more quick question, that i'll ask here, I already asked on another site, but didn't receive a good response. So there was one class called IAPManager or something like that, and inside it there were many useful functions that if called, would buy you whatever it is supposed to, but inside that class there was no Update/LateUpdate/FixedUpdate method (I know in some cases they can be renamed, but I looked and that wasn't the case), so would I hook Start or Awake and call those functions through a function pointer? Which one works, or does neither work?

https://docs.unity3d.com/Manual/ExecutionOrder.html

This is a great graph that tells you what and when they're being executed.

So I don't think any of those two will work.

 

It's possible other classes have an instance of this IAPManager class, and handle it there.

But without more info, I can't really answer.

  • Like 1
Posted
2 hours ago, Ted2 said:

https://docs.unity3d.com/Manual/ExecutionOrder.html

This is a great graph that tells you what and when they're being executed.

So I don't think any of those two will work.

 

It's possible other classes have an instance of this IAPManager class, and handle it there.

But without more info, I can't really answer.

Alright thanks for the help

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

    • Transcender : Idle RPG v1.4.9 +2 Cheats
      Modded/Hacked App: Transcender : Idle RPG By Rookie Project Co., Ltd.
      Bundle ID: com.playgames.transcender
      iTunes Store Link: https://apps.apple.com/sg/app/transcender-idle-rpg/id6448614350?uo=4

       

       

      📌 Mod Requirements

      - Jailbroken iPhone or iPad.
      - iGameGod / Filza / iMazing.
      - Cydia Substrate, ElleKit, Substitute or libhooker depending on your jailbreak (from Sileo, Cydia or Zebra).

       

      🤩 Hack Features

      - Damage Multiplier
      - Never Die

       

      ⬇️ iOS Hack Download Link


      Hidden Content

      Download Hack







       

      📖 iOS Installation Instructions

      STEP 1: Download the .deb hack file from the link above. Use Safari, Google Chrome or other iOS browsers to download.
      STEP 2: Once the file has downloaded, tap on it and then you will be prompted on whether you want to open the deb with iGameGod or copy it to Filza.
      STEP 3: If needed, tap on the downloaded file again, then select ‘Normal Install’ from the options on your screen.
      STEP 4: Let iGameGod/Filza finish the cheat installation. If it doesn’t install successfully, see the note below.
      STEP 5: Open the game, log in to your iOSGods account when asked, then toggle on the features you want and enjoy!

       

      NOTE: If you have any questions or problems, read our Jailbreak iOS Hack Troubleshooting & Frequently Asked Questions & Answers topic. If you still haven't found a solution, post your issue below and we'll do our best to help! If the hack does work for you, please post your feedback below and help out other fellow members that are encountering issues.

       

      🙌 Credits

      - AlyssaX64

       

      📷 Cheat Video/Screenshots

      N/A

       

      More iOS App Hacks
      If you’re looking for Non-Jailbroken & No Jailbreak required iOS IPA hacks, visit the iOS Game Cheats & Hacks or the iOSGods App for a variety of modded games and apps for non-jailbroken iOS devices.

      Modded Android APKs
      Need modded apps or games for Android? Check out the latest custom APK mods, cheats & more in our Android Section.
        • Haha
        • Winner
        • Like
      • 4 replies
    • Transcender : Idle RPG v1.4.9 +2 Jailed Cheats
      Modded/Hacked App: Transcender : Idle RPG By Rookie Project Co., Ltd.
      Bundle ID: com.playgames.transcender
      iTunes Store Link: https://apps.apple.com/sg/app/transcender-idle-rpg/id6448614350?uo=4

       

       

      📌 Mod Requirements

      - Non-Jailbroken/Jailed or Jailbroken iPhone or iPad.
      - Sideloadly or alternatives.
      - Computer running Windows/macOS/Linux with iTunes installed.

       

      🤩 Hack Features

      - Damage Multiplier
      - Never Die

       

      ⬇️ iOS Hack Download IPA Link


      Hidden Content

      Download via the iOSGods App







       

      📖 PC Installation Instructions

      STEP 1: Download the pre-hacked .IPA file from the link above to your computer. To download from the iOSGods App, see our iOSGods App IPA Download Tutorial which includes a video example.
      STEP 2: Download Sideloadly and install it on your Windows or Mac.
      STEP 3: Open Sideloadly on your computer, connect your iOS device, and wait until your device name appears in Sideloadly.
      STEP 4: Once your iDevice is recognized, drag the modded .IPA file you downloaded and drop it into the Sideloadly application.
      STEP 5: Enter your Apple Account email, then press “Start.” You’ll then be asked to enter your password. Go ahead and provide the required information.
      STEP 6: Wait for Sideloadly to finish sideloading/installing the hacked IPA. If there are issues during installation, please read the note below.
      STEP 7: Once the installation is complete and you see the app on your Home Screen, you will need to go to Settings -> General -> Profiles / VPN & Device Management. Once there, tap on the email you entered from step 6, and then tap on 'Trust [email protected]'.
      STEP 8: Now go to your Home Screen and open the newly installed app and everything should work fine. You may need to follow further per app instructions inside the hack's popup in-game.

      NOTE: iOS/iPadOS 16 and later, you must enable Developer Mode. For free Apple Developer accounts, you will need to repeat this process every 7 days. If you have any questions or problems, read our Sideloadly FAQ section of the topic and if you don't find a solution, please post your issue below and we'll do our best to help! If the hack does work for you, post your feedback below and help out other fellow members that are encountering issues.

       

      🙌 Credits

      - AlyssaX64

       

      📷 Cheat Video/Screenshots

      N/A
        • Haha
        • Like
      • 2 replies
    • EvoCreo 2: Monster Trainer RPG v1.2.1 +8 Jailed Cheats [ Damage + More ]
      Modded/Hacked App: EvoCreo 2: Monster Trainer RPG By Ilmfinity Studios LLC
      Bundle ID: com.ilmfinity.evocreo2
      iTunes Store Link: https://apps.apple.com/us/app/evocreo-2-monster-trainer-rpg/id1499001662?uo=4

       


      🤩 Hack Features

      - Unlimited Money -> Will increase instead of decrease.
      - Unlimited Skill Points
      - Unlimited Bag Items -> Will increase instead of decrease.
      - Prestige Cleo Allowed
      - Max Creo Level -> Earn some XP.
      - Damage Multiplier - Linked -> Affects both you and enemy. Use carefully.
      - Free In-App Purchases
      - Unlock All Achievements/Badges
        • Informative
        • Agree
        • Thanks
        • Winner
        • Like
      • 16 replies
    • EvoCreo 2: Monster Trainer RPG v1.2.1 +8 Cheats [ Damage + More ]
      Modded/Hacked App: EvoCreo 2: Monster Trainer RPG By Ilmfinity Studios LLC
      Bundle ID: com.ilmfinity.evocreo2
      iTunes Store Link: https://apps.apple.com/us/app/evocreo-2-monster-trainer-rpg/id1499001662?uo=4

       


      🤩 Hack Features

      - Unlimited Money -> Will increase instead of decrease.
      - Unlimited Skill Points
      - Unlimited Bag Items -> Will increase instead of decrease.
      - Prestige Cleo Allowed
      - Max Creo Level -> Earn some XP.
      - Damage Multiplier - Linked -> Affects both you and enemy. Use carefully.
      - Free In-App Purchases
      - Unlock All Achievements/Badges
        • Agree
        • Thanks
        • Like
      • 14 replies
    • Cluedo: Classic Edition v2.10.1 +1 Jailed Cheat [ Everything Owned ]
      Modded/Hacked App: Cluedo: Classic Edition By Marmalade Game Studio Limited
      Bundle ID: com.marmalade.cluedogameRotW
      iTunes Store Link: https://apps.apple.com/gb/app/cluedo-classic-edition/id1238247658?uo=4

       


      🤩 Hack Features

      - Everything Owned
        • Winner
      • 0 replies
    • Cluedo - Official Hasbro Game v1.0.2 +1 Jailed Cheat [ Everything Owned ]
      Modded/Hacked App: Cluedo - Official Hasbro Game By Marmalade Game Studio Limited
      Bundle ID: com.marmalade.cluedo2RotW
      iTunes Store Link: https://apps.apple.com/gb/app/cluedo-official-hasbro-game/id6447306697?uo=4

       
       

      🤩 Hack Features

      - Everything Owned
        • Winner
      • 1 reply
    • ✨ Hack Updated! ✨
      This hack is now updated to the current App Store version!

       

      🔄 How to Update:
      Re-download the latest .IPA/.DEB from the link in the main post or the iOSGods App and follow the same installation steps you used before.

      If you experience any issues, please let us know by replying to this topic.
    • Cluedo: Classic Edition v2.10.1 +1 Cheat [ Everything Owned ]
      Modded/Hacked App: Cluedo: Classic Edition By Marmalade Game Studio Limited
      Bundle ID: com.marmalade.cluedogameRotW
      iTunes Store Link: https://apps.apple.com/gb/app/cluedo-classic-edition/id1238247658?uo=4

       


      🤩 Hack Features

      - Everything Owned
        • Winner
      • 0 replies
    • Hunt Royale: Action RPG Battle v3.5.0 +3 Jailed Cheats [ Damage & Defence ]
      Modded/Hacked App: Hunt Royale: Action RPG Battle By BoomBit, Inc.
      Bundle ID: com.hunt.royale
      iTunes Store Link: https://apps.apple.com/us/app/hunt-royale-action-rpg-battle/id1537379121?uo=4

       
       

      🚀 Hack Features

      - Dumb Enemies

      VIP
      - Damage Multiplier
      - Defence Multiplier
        • Informative
        • Haha
        • Like
      • 22 replies
    • Hunt Royale: Action RPG Battle v3.5.0 +3 Cheats [ Damage & Defence ]
      Modded/Hacked App: Hunt Royale: Action RPG Battle By BoomBit, Inc.
      Bundle ID: com.hunt.royale
      iTunes Store Link: https://apps.apple.com/us/app/hunt-royale-action-rpg-battle/id1537379121?uo=4

       


      🚀 Hack Features

      - Dumb Enemies

      VIP
      - Damage Multiplier
      - Defence Multiplier
        • Like
      • 7 replies
    • SpongeBob Adventures: In A Jam v2.21.1 +1++ Jailed Cheats [ Everything ]
      Modded/Hacked App: SpongeBob Adventures: In A Jam By Tilting Point LLC
      Bundle ID: com.tiltingpoint.sbadventures
      iTunes Store Link: https://apps.apple.com/us/app/spongebob-adventures-in-a-jam/id1641251535?uo=4


      Hack Features:
      - Unlimited Everything -> Will increase instead of decrease.


      Jailbreak required hack(s): [Mod Menu Hack] SpongeBob Adventures: In A Jam +20++ Cheats [ Cheat 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/
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 125 replies
    • SpongeBob Adventures: In A Jam v2.21.1 +1++ Cheats [ Everything ]
      Modded/Hacked App: SpongeBob Adventures: In A Jam By Tilting Point LLC
      Bundle ID: com.tiltingpoint.sbadventures
      iTunes Store Link: https://apps.apple.com/us/app/spongebob-adventures-in-a-jam/id1641251535?uo=4


      Hack Features:
      - Unlimited Everything -> Will increase instead of decrease.


      Non-Jailbroken & No Jailbreak required hack(s): [No Jailbreak Required] SpongeBob Adventures: In A Jam +20++ Jailed Cheats [ Cheat Menu ] - 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/
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 156 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