Help! Game crashes when hooking Update() method

Denka

Platinian
Original poster
Sep 1, 2019
15
0
1
24
Ukr
Hi. When i hook update method the game crashes. Here is my update and old update method:
Code:
void (*GoldHack_old)(void *instance);
void GoldHack(void *instance){
    if(instance != NULL && NM.isMajor){
        *(float *) ((uint64_t) instance + 0x300) = 999.5f;
    }
    return GoldHack_old(instance);
}
And here is my hook call: A64HookFunction((void *)getAbsoluteAddress("libil2cpp.so", 0x655D98), (void *)GoldHack, (void **)&GoldHack_old);
Help me pls
 

Poison Modz

Approved Modder
Approved Modder
Aug 27, 2020
158
11,142
1,193
India
void (*old_GoldHack)(void *instance);
void GoldHack(void *instance){
if(instance != NULL && NM.isMajor){
*(float *) ((uint64_t) instance + 0x300) = 999.5f;
}
return old_GoldHack(instance);
}

A64HookFunction((void *)getAbsoluteAddress("libil2cpp.so", 0x655D98), (void *)GoldHack, (void **)&old_GoldHack);
 
Last edited:

Raebydett

Awesome Active Platinian
Jan 20, 2020
173
61
28
G
@Poison Modz rename the update old_ / _old doesnt change anything, u can use any random name still works lol

@Denka everything looks fine to me, maybe use other update method from another class that used on that instance
 
  • Like
Reactions: Denka

Francois284Modz

Awesome Active Platinian
Jun 10, 2018
188
2,442
193
26
france
Why are you returning value in à void type ? Void does not return value
Replace this
return GoldHack_old(instance);

By juste
GoldHack_old(instance);