mirror of
https://github.com/JezuzLizard/T4SP-Server-Plugin.git
synced 2025-04-20 21:45:43 +00:00
added caller addr to detour
This commit is contained in:
parent
57248cc8f8
commit
ffa637e8a7
@ -95,8 +95,9 @@ namespace test
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int __stdcall scr_getentityid_call(game::scriptInstance_t inst, game::classNum_e classnum, unsigned int clientnum, unsigned int entnum)
|
unsigned int __stdcall scr_getentityid_call(void* caller_addr, game::scriptInstance_t inst, game::classNum_e classnum, unsigned int clientnum, unsigned int entnum)
|
||||||
{
|
{
|
||||||
|
printf("scr_getentityid_call: called from %p\n", caller_addr);
|
||||||
// minhook allocated space for the original asm, we want to execute that instead because the original gamecode has the jump from the detour
|
// minhook allocated space for the original asm, we want to execute that instead because the original gamecode has the jump from the detour
|
||||||
return game::Scr_GetEntityId(inst, entnum, classnum, clientnum, scr_getentityid_hook.get_original());
|
return game::Scr_GetEntityId(inst, entnum, classnum, clientnum, scr_getentityid_hook.get_original());
|
||||||
}
|
}
|
||||||
@ -116,6 +117,8 @@ namespace test
|
|||||||
push clientnum;
|
push clientnum;
|
||||||
push classnum;
|
push classnum;
|
||||||
push inst;
|
push inst;
|
||||||
|
mov eax, [ebp + 4]; // caller address! where did we get called from?
|
||||||
|
push eax;
|
||||||
call scr_getentityid_call;
|
call scr_getentityid_call;
|
||||||
// we made this a __stdcall, so we dont need to clean up stack
|
// we made this a __stdcall, so we dont need to clean up stack
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user