Skip to content
Guest Big Announcement

Hooking function cause crash

Featured Replies


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;

 

Solved by AlyssaX64

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

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

 

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

  • Author
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? 

Create an account or sign in to comment

Featured Content

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.