Help! how to kook function like set_atk:void in LGL mod menu

xsong

Solid & Active Platinian
hello guys, pls help me hook this function, I've tried but it not works
I cannot f find any unpdate, lateupdate.... function like that....:face01:

Code:
[Token(Token = "0x60021CD")]
[Address(RVA = "0xC6E1A4", Offset = "0xC6E1A4", VA = "0xC6E1A4")]
public void set_atk(int value)
{
}

my code:

Code:
void (*old_set_atk)(void *instance, int value);
void set_atk_hook(void *instance, int value) {
    if (instance != NULL) {
        
        if (Hack2 > 1) {
            value *= Hack;
        }
    }
    old_set_atk(instance, value);
}

 A64HookFunction((void *) getAbsoluteAddress(libName, 0xC6E1A4),
                    (void *) set_atk_hook,(void **) &old_set_atk);
 
No FixedUpdate either I guess?

In that case, try finding an Update, FixedUpdate or LateUpdate in a similar class. For example if your class is called PlayerStats, look for one of those 3 Updates in a class called PlayerBehavior (just as an example). In other words don't go to a class called EnemyBehavior. I mean when all else fails, it can't hurt to try them all, but it's more logical to start out with a similiar class, you know what I mean? You can also check this link out for more info about this issue:


 
No FixedUpdate either I guess?

In that case, try finding an Update, FixedUpdate or LateUpdate in a similar class. For example if your class is called PlayerStats, look for one of those 3 Updates in a class called PlayerBehavior (just as an example). In other words don't go to a class called EnemyBehavior. I mean when all else fails, it can't hurt to try them all, but it's more logical to start out with a similiar class, you know what I mean? You can also check this link out for more info about this issue:


Thank you!
 
Back
Top Bottom