Help! How to hook long

bool IsMoney = false;

long (*old_Money)(void *instance);
long Money(void *instance) {
if (instance != NULL) {
if (IsMoney) {
return ;
}
}
return old_Money(instance);
}
 
bool IsMoney = false;

long (*old_Money)(void *instance);
long Money(void *instance) {
if (instance != NULL) {
if (IsMoney) {
return ;
}
}
return old_Money(instance);
}

That will crash because you are not returning a long which the method is expecting

It should be something like this...

Code:
bool IsMoney = false;

long (*old_Money)(void *instance);
long Money(void *instance) {
    if (instance != NULL) {
        if (IsMoney) {
            return 99999999L;
        }
    }
    return old_Money(instance);
}
 
Back
Top Bottom