WCU / Cybersecurity
~/CSC 471/Class 09/KP 07
Class 09 · KP 07 / 25

User Mode (Windows): IAT and Inline Hooking

before hookIAT[MessageBoxW]user32!MessageBoxWrealafter IAT hookIAT[MessageBoxW]hook_MessageBoxWattacker
IAT hook: overwrite the import pointer so calls jump to your handler.
  • IAT hooking: every PE has an Import Address Table — a list of pointers to imported functions. Overwrite the pointer for, say, NtQueryDirectoryFile so calls jump to your code first.
  • Inline (trampoline) hooking: patch the first bytes of the target function itself with a jmp to your handler; your handler does its work, then jumps back to the original bytes.
  • Usually delivered by DLL injection into target processes (e.g. CreateRemoteThread + LoadLibrary).
Key Takeaway

User-mode hooks only affect the processes you inject into — a scanner running from a clean process still sees the truth.