Help! Function Pointer

mxiloe

Platinian
Hey.. so I'm trying to use the lgl mod menu v2.8 and the function that I found is:

C++:
// Token: 0x060008A1 RID: 2209 RVA: 0x00004560 File Offset: 0x00002760
[Token(Token = "0x60008A1")]
[Address(RVA = "0x2BD492C", Offset = "0x2BD492C", VA = "0x2BD492C")]
[CompilerGenerated]
public float get_attackRange()
{
    return 0f;
}

my function pointer is:

C++:
bool get_attackRange = false;
float (*old_attackRange)(void *instance);
float attackRange(void *instance) {
    if (instance != NULL) {
        if (get_attackRange) {
            return 10.0;
        }
    }
    return old_attackRange(instance);
}



MSHookFunction((void*) getAbsoluteAddress(targetLibName, 0x2BD492C), (void*) attackRange, (void**)&old_attackRange);


my case is:

C++:
case 2:
            get_attackRange = boolean;
            break;



after compiling and all that stuff, my game loads for a few sec - the menu appears but then the game crashes.
Any solutions that could help me?
 
Back
Top Bottom