Skip to content

Commit 4a336c9

Browse files
committed
Allow another type of 32-bit kernel32 -> kernelbase API (e.g. GetCommandLine) to be hooked
1 parent 5a447f0 commit 4a336c9

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

hooking_32.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -725,6 +725,11 @@ int hook_api(hook_t *h, int type)
725725
addr += 4;
726726
}
727727

728+
// e.g. GetCommandLine APIs
729+
if (!memcmp(addr, "\xeb\x05\x90\x90\x90\x90\x90", 7))
730+
// step over the jump and the nops
731+
addr += 7;
732+
728733
// windows 7 has a DLL called kernelbase.dll which basically acts
729734
// as a layer between the program and kernel32 (and related?) it
730735
// allows easy hotpatching of a set of functions which is why

0 commit comments

Comments
 (0)