jmp reads as a jump and names the module it lands
in. It also checks every import and export slot, and looks for modules
with no file behind them. It opens the target with read access only and
never writes to it. It is the checking side of the inline and IAT hooking
chapter of The Game Hacker’s Handbook.
Run hookscan --name on a process and this report is
printed. This is real output. The target is the test fixture in the repo,
run in its hooked mode. It writes a 5-byte jmp
over one of its own functions. It also points its own
GetTickCount import slot at a function of its own.
hookscan 1.0.0: pid 39996 (hookscan_fixture.exe, x64), 5 of 5 modules scanned
[inline] hookscan_fixture.exe+0x35B0 in .text, 5 bytes
original 8D 04 49 89 44
current E9 CB FF FF FF
code jmp 0x00007FF6C1713580
target hookscan_fixture.exe!FixtureDetour
[iat] hookscan_fixture.exe imports KERNEL32.dll!GetTickCount
slot hookscan_fixture.exe+0x1E020
expected KERNEL32.DLL!GetTickCount
target hookscan_fixture.exe!FixtureFakeTickCount
2 findings
hookscan reports those two changes and nothing else. The
original bytes come from the file after relocation. The
current bytes are a jmp, and hookscan follows it
to the function it lands in.
.pdata entry. A jmp, call, push/ret or mov reg plus jmp reg is followed to its target and named.PROCESS_QUERY_INFORMATION | PROCESS_VM_READ and nothing more. --json prints one object, and the exit status is 0 with no findings, 1 with findings and 2 on an error. A program can check itself with hookscan::scanCurrentProcess.hookscan-v1.0.0-windows-x64.zip and hookscan-v1.0.0-windows-x86.zip, each with hookscan.exepush/ret trampolines followed--notes lists what was skipped--self and scanCurrentProcessIntended use. hookscan is for checking processes you own or are authorized to analyze. Use it on your own programs, to confirm a hook you wrote landed where you meant it to. Or use it to see what an overlay, a plugin or other software changed in a program you run. It only reads, but reading the memory of online or competitive games will very likely trip anti-cheat software and get the account banned. This is a research tool.
The binaries are unsigned. Antivirus software may flag a tool that reads another process’s memory. Build it from source if you would rather not take a binary on trust.
Match the build and the user. The x64
hookscan.exe scans 64-bit processes and the x86 one scans
32-bit processes. Each says so if you point it at the other kind. Run
hookscan as the same user as the target. A process owned by another user,
or one running elevated, needs hookscan to run elevated too.
What it cannot see. Hooks that change no module byte,
such as hardware breakpoints, guard-page hooks and vtable swaps, leave
nothing to compare. Code outside any module, such as JIT output, is not
checked beyond the PE header test. The scan is one snapshot, so a change
made after it read the bytes is missed. Pass --notes to see
what a scan skipped and why.