This is the AMP version of this page.
If you want to load the real page instead, click this text.

Solved How to Hook void in lgl 2.9?

Status
Not open for further replies.
void (*killPlayer)(void *instance); // Doesn't take any additional parameters

void(*old_LateUpdate)(void *instance);
void LateUpdate(void *instance)
{
if(instance != NULL)
{
bool IsEnemy = *(bool*)((uint64_t)instance + 0x8C) // Declare a variable to isEnemy to access it
if(IsEnemy) // Check if it's enemies
{
killPlayer(instance); // And if they are then kill them
}
}
old_LateUpdate(instance); If they aren't enemies then return original value
}
MsHookFunction((void*)getAbsoluteAddress(0x32720AB), (void*)LateUpdate, (void**)&old_LateUpdate);

killPlayer = (void (*)(void *))getAbsoluteAddress(targetLibName, 0x2485B9);
 
Status
Not open for further replies.