Tag: usercall

挂钩用户呼叫function?

我有一个虚拟机,它在VM_Create上将一个函数的地址(systemCalls)传递给虚拟机。 所以我挂钩VM_Create并窃取系统调用地址,将其放入备份函数指针,我修改后的systemCalls函数的地址传递给原始的VM_Create,我可以从中修改参数,添加或删除调用,然后调用支持 – 系统调用function。 这很有效,直到游戏的新版本发布。 我相信找到了问题: 这是未修改的systemCalls函数的开始: intptr_t CL_CgameSystemCalls(intptr_t *args) { switch (args[0]) { case CG_PRINT: Com_Printf( “%s”, (const char*)VMA(1)); return 0; case CG_ERROR: Com_Error(ERR_DROP, “%s”, (const char*)VMA(1)); return 0; 这是我修改过的系统调用函数: intptr_t modified_CL_CgameSystemCalls (intptr_t *args) { switch (*args) { case CG_GETSNAPSHOT: mysnap = mysnap ; mynextSnap = (snapshot_t*) (CG_QVM2NATIVE(args[2])); mysnap = mynextSnap; retval = original_CL_CgameSystemCalls(args); […]

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

知道任何关于挂钩__usercall类型函数的东西吗? 我成功地挂了__thiscall , __thiscall和__cdecl但这对我来说已经足够了。 知道有人为__usercall挂钩,或者如何使用__stdcall或__cdecl翻译挂钩这类函数? 我最初必须解决的function是: int __usercall func(int a, int b, int c, unsigned int d, signed int e);