如何挂钩__usercall,__userpurge(__spoils)函数?

Svi*_*ack 2 c hook detours reverse-engineering usercall

知道任何有关钩子__usercall函数类型的知识吗?我成功挂机__thiscall,__stdcall并__cdecl打电话,但这对我来说已经足够。

知道任何人的的钩子库,__usercall或如何使用翻译为__stdcall或钩住此类函数__cdecl?

我首先必须挂钩的功能是:

int __usercall func<eax>(int a<eax>, int b<ecx>, int c, unsigned int d, signed int e);
Run Code Online (Sandbox Code Playgroud)

Aby*_*byx 5

使用包装器将其转换为__stdcall。

int __stdcall func_hook_payload(int a, int b, int c, unsigned int d, signed int e);

// Wrapper for
// int __usercall func<eax>(int a<eax>, int b<ecx>, int c, unsigned int d, signed int e);
__declspec(naked) void func_hook()
{__asm{
    push ebp
    mov ebp, esp
    push dword ptr[ebp + 0x0C] // or just push e
    push dword ptr[ebp + 0x08] // d
    push dword ptr[ebp + 0x04] // c
    push ecx // b
    push eax // a
    call func_hook_payload
    leave
    ret // note: __usercall is cdecl-like
}}
Run Code Online (Sandbox Code Playgroud)