Hi, i'm wondering why my code didn't works on this hook..
If someone can help me on this it would be great =))
nowhere222
C++:
//public void set_timeScale(float value) { } // class to hook
//the void *instance is a self-created variable.
void (*set_timeScale)(void *instance, float value);
float (*old_get_timeScale)(void *instance);
float get_timeScale(void *instance) {
//Check if instance is NULL to prevent CRASH
if (instance != NULL)
{
set_timeScale(instance, 9999); //Function Pointer mod
}
//return the original value (this code isn't really needed if you have a toggle/switch)
return old_get_timeScale(instance);
}
MSHookFunction((void *) getAbsoluteAddress(targetLibName,
string2Offset(OBFUSCATE_KEY("0x60e024", '?'))),
(void *)get_timeScale, (void **) &old_get_timeScale);
// Function pointer because we want to avoid crash when the il2cpp lib isn't loaded.
set_timeScale = (void (*)(void *, float)) getAbsoluteAddress(targetLibName, 0x60e02c);
nowhere222