Hi all,
I need help for understand correctly or method to correctly hook a ObscuredFloat/Bool or Int.
Ok , anticheat is CodeStage (unity) - il2cpp
i use template LGL.
ok i search to mod this function in dll :
public ObscuredBool TakeDamage()
{
return default(ObscuredBool);
}
i have a general function to get a ObscuredBool :
bool GetObscuredBoolValue(uint64_t location){
int cryptoKey = *(int *)location;
int obfuscatedValue = *(int *)(location + 0x4);
return (bool)obfuscatedValue ^ cryptoKey;
}
ok my hook function :
bool (*old_get_Godmode)(void *instance);
bool get_Godmode(void *instance) {
if (instance != nullptr)
{
if(IsGodmode)
{
bool getBool = GetObscuredBoolValue(0xB6FC38);
return getBool = true ;
}
}
return old_get_Godmode(instance);
}
HOOK("0xB6FC38", get_Godmode, old_get_Godmode);
=> so my problem is the game crash or freeze if i enable button godmode in menu. why ?
and if i logcat, i see prt is null, why because is same function on unprotected apk or protected apk ...
i appreciate little help for very make that hook correctly
I need help for understand correctly or method to correctly hook a ObscuredFloat/Bool or Int.
Ok , anticheat is CodeStage (unity) - il2cpp
i use template LGL.
ok i search to mod this function in dll :
public ObscuredBool TakeDamage()
{
return default(ObscuredBool);
}
i have a general function to get a ObscuredBool :
bool GetObscuredBoolValue(uint64_t location){
int cryptoKey = *(int *)location;
int obfuscatedValue = *(int *)(location + 0x4);
return (bool)obfuscatedValue ^ cryptoKey;
}
ok my hook function :
bool (*old_get_Godmode)(void *instance);
bool get_Godmode(void *instance) {
if (instance != nullptr)
{
if(IsGodmode)
{
bool getBool = GetObscuredBoolValue(0xB6FC38);
return getBool = true ;
}
}
return old_get_Godmode(instance);
}
HOOK("0xB6FC38", get_Godmode, old_get_Godmode);
=> so my problem is the game crash or freeze if i enable button godmode in menu. why ?
and if i logcat, i see prt is null, why because is same function on unprotected apk or protected apk ...
i appreciate little help for very make that hook correctly