Storm/Perform_Shove_Trace.hpp

23 lines
552 B
C++
Raw Normal View History

2024-04-04 03:17:09 +08:00
void __thiscall Perform_Shove_Trace(void* Stack)
{
2024-10-18 06:46:40 +08:00
void* Entity = *(void**)((unsigned __int32)Stack + 332);
2024-04-04 03:17:09 +08:00
if (Entity == Perform_Trace_Target)
2024-04-04 03:17:09 +08:00
{
Perform_Trace_Damage = 1;
2024-04-04 03:17:09 +08:00
}
}
void* Original_Perform_Shove_Trace_Caller;
__attribute__((naked)) void Redirected_Perform_Shove_Trace()
2024-04-04 03:17:09 +08:00
{
2024-10-09 12:00:21 +08:00
asm("leal -304(%ebp), %eax");
asm("pushl %eax");
asm("calll *%edx");
asm("pushal");
asm("movl %esp, %ecx");
2024-10-07 03:45:39 +08:00
asm("calll %0" : : "m"(Perform_Shove_Trace));
2024-10-09 12:00:21 +08:00
asm("popal");
asm("jmpl *%0" : : "m"(Original_Perform_Shove_Trace_Caller));
2024-04-04 03:17:09 +08:00
}