Del2281753
Platinian
How can I hook this
// RVA: 0x31B4C60 Offset: 0x31B0C60 VA: 0x31B4C60
public ObscuredFloat get_MoneyIncomeMultiplier() { }
I tried using this hook but it's not working
// RVA: 0x31B4C60 Offset: 0x31B0C60 VA: 0x31B4C60
public ObscuredFloat get_MoneyIncomeMultiplier() { }
I tried using this hook but it's not working
union intfloat {
int i;
float f;
};
float GetObscuredFloat(uint64_t location){
int cryptoKey = *(int *)location;
intfloat encryptedValue;
encryptedValue.f = *(float *)(location + 0x4);
intfloat realValue;
realValue.i = encryptedValue.i ^ cryptoKey;
return 100.0f;
}
float (*old_get_MoneyIncomeMultiplier)(void *_this); // Declare original function pointer
float get_MoneyIncomeMultiplier(void *_this) {
if (_this != NULL) {
if (test1) {
uint64_t location = reinterpret_cast<uint64_t>(_this);
return GetObscuredFloat(location);
}
}
return old_get_MoneyIncomeMultiplier(_this); // Safe fallback
}
HOOK("0x31B4C60", get_MoneyIncomeMultiplier, old_get_MoneyIncomeMultiplier);