i have been trying to detect API Hook, inline and EAT hook.
For now I did not find anything on how to detect EAT hook.
For Inline Ring 3 hook, what i have so far:
FARPROC Address = GetProcAddress(GetModuleHandle("kernel32.dll"),"ExitProcess");
if (*(BYTE*)Address == 0xE9 || *(BYTE*)Address == 0x90 || *(BYTE*)Address == 0xC3)
{
printf("Api hooked\n");
}
The problem is that there are several opcodes that can be used to hook/change the prologue of functions, checking JMP / NOP / RET is trivial, I've seen a lot of HOOK types like PUSH RET, MOV, RETN etc ...
I wonder if anyone knows how to detect these hooks (detours) or modifications in the API. And also some way to detect the EAT hook.
Thank you.