Tag:

如何在一个WinAPI挂钩中创建一个Hook和Trampolinefunction

所以我一直在学习钩子和使用trampolines的概念,以绕过/执行WinAPI钩子函数中的数据(在不同的可执行文件中,使用DLL注入)。 到目前为止,我知道如何使用程序集和C的混合物来制作它(蹦床和钩子),但我似乎不能只使用C来做,因为我似乎缺少一些东西。 如果有人能告诉我我做错了什么以及如何修复它,我会很感激。 现在我的代码: #include unsigned char* address = 0; __declspec(naked) int __stdcall MessageBoxAHookTrampoline(HWND Window, char* Message, char* Title, int Type) { __asm { push ebp mov ebp, esp mov eax, address add eax, 5 jmp eax } } int __stdcall MessageBoxAHook(HWND Window, char* Message, char* Title, int Type) { wchar_t* WMessage = L”Hooked!”; wchar_t* […]