Jump to content

Hooking function cause crash


Go to solution Solved by AlyssaX64,

8 posts in this topic

Recommended Posts

Posted


So im hooking to the update function, but everytime when it execute it crashes. Any idea?

void(*old_Update)(void *instance);
void Update(void *instance) {

    bool isHeroTurn = *(bool*)((uint64_t)instance + 0x2B);

    if (isHeroTurn) {
      //do smth
    }
 
    old_Update(instance);
}

void setup() {
  MSHookFunction((void*)getRealOffset(0x1B9D454),(void*)Update,(void**)&old_Update);
}

[Token(Token = "0x60006D9")]
[Address(RVA = "0x1B9D454", Offset = "0x1B9D454", VA = "0x1B9D454")]
private void Update()
{
}
[NonSerialized]
[Token(Token = "0x40004D1")]
[FieldOffset(Offset = "0x2B")]
public bool isHeroesTurn;

 

Posted

Make sure you set targeted it if using UnityFramework

Posted (edited)
7 hours ago, Laxus said:

Make sure you set targeted it if using UnityFramework

Already done, keep crash idk why, like only on this one, when i hook other updates, it doesn't crash

7 hours ago, Puddin said:

What jailbreak you using?

palera1n rotful

Updated by batchh
Posted
2 hours ago, batchh said:

Already done, keep crash idk why, like only on this one, when i hook other updates, it doesn't crash

palera1n rotful

Try this

void(*old_Update)(void *instance);
void Update(void *instance) {

    bool isHeroTurn = *(bool*)((uint64_t)instance + 0x2B);

   if([switches isSwitchOn:NSSENCRYPT("Switch Name Goes Here")]) {
    *(bool*)((uint64_t)instance + 0x2B) = true;
    }
 
    old_Update(instance);
}

void setup() {
  MSHookFunction((void*)getRealOffset(0x1B9D454),(void*)Update,(void**)&old_Update);
}

 

Posted
5 hours ago, AlyssaX64 said:

Try this

void(*old_Update)(void *instance);
void Update(void *instance) {

    bool isHeroTurn = *(bool*)((uint64_t)instance + 0x2B);

   if([switches isSwitchOn:NSSENCRYPT("Switch Name Goes Here")]) {
    *(bool*)((uint64_t)instance + 0x2B) = true;
    }
 
    old_Update(instance);
}

void setup() {
  MSHookFunction((void*)getRealOffset(0x1B9D454),(void*)Update,(void**)&old_Update);
}

 

Still crashing :c

Posted
6 hours ago, AlyssaX64 said:

Try this

void(*old_Update)(void *instance);
void Update(void *instance) {

    bool isHeroTurn = *(bool*)((uint64_t)instance + 0x2B);

   if([switches isSwitchOn:NSSENCRYPT("Switch Name Goes Here")]) {
    *(bool*)((uint64_t)instance + 0x2B) = true;
    }
 
    old_Update(instance);
}

void setup() {
  MSHookFunction((void*)getRealOffset(0x1B9D454),(void*)Update,(void**)&old_Update);
}

 

Can i DM you if possible? 

  • Solution
Posted
Just now, batchh said:

Can i DM you if possible? 

Sure!!!

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
×
  • 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