Skip to content

Commit

Permalink
Allow another type of 32-bit kernel32 -> kernelbase API (e.g. GetComm…
Browse files Browse the repository at this point in the history
…andLine) to be hooked
  • Loading branch information
kevoreilly committed Dec 2, 2022
1 parent 5a447f0 commit 4a336c9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions hooking_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -725,6 +725,11 @@ int hook_api(hook_t *h, int type)
addr += 4;
}

// e.g. GetCommandLine APIs
if (!memcmp(addr, "\xeb\x05\x90\x90\x90\x90\x90", 7))
// step over the jump and the nops
addr += 7;

// windows 7 has a DLL called kernelbase.dll which basically acts
// as a layer between the program and kernel32 (and related?) it
// allows easy hotpatching of a set of functions which is why
Expand Down

0 comments on commit 4a336c9

Please sign in to comment.