你好,我有一个函数C++ __usercall在IDA挂钩
void __userpurge Test(int a1<eax>, int a2, int a3, int a4, char a5)
,我想钩/从我的C++注入DLL 这是我曾试图把它称之为但.EXE崩溃
DWORD CALL_ORIGINAL = 0x00EAF6D0;
__declspec(naked) void myHookedFunc(int a1,int a2,int a3,int a4,char a5) {
__asm
{
push a5
push a4
push a3
push a2
push eax
call CALL_ORGIGINAL //maybe use JMP?
retn
}
}
这是exe文件如何调用该函数
mov eax, [ebp+arg_4]
add esp, 8
push eax
push ecx
mov ecx, [edi+2138h]
mov edx, [ecx+4]
mov ecx, [edx+30h]
mov edx, [ecx]
mov eax, esp
mov [eax], edx
mov eax, [edi+20h]
mov [esp+40h+var_24], esp
push eax
push eax
mov eax, edi
call Test
pop edi
pop esi
retn
几声函数有APPE ars是
add esp, 24h
retn 10h
这将意味着有更多的参数或IDA得到错误的参数类型?
不要信任来自IDA的函数签名。有时候,IDA不会产生正确的签名。你需要手动分析它。 – UltimaWeapon
所以钩子好吗? – user1422473