GhostDebug 是一个 Windows x64 调试器原型,由一个原生调试 DLL 和一个 .NET Framework 命令行客户端组成。它旨在调试那些使用调试器检测检查的目标程序。
有关设计背景,请参阅 在 Windows 上开发不被检测的调试器。
在 Visual Studio 中构建所有项目。
启动目标进程。TestTarget 作为一个简单示例包含在内。
在 GhostDebug/GhostDebug-CLI/bin/Release/ 中打开终端并启动 CLI:
.\GhostDebug.exe
按进程 ID 或进程名称附加,然后使用交互式命令:
attach <pid/process name>
Attach to a process.
bp <address>
Set a breakpoint.
bp <address> <command list>
Set a breakpoint with commands that are executed automatically when it hits.
cl <address>
Clear a breakpoint.
g
Resume execution.
t
Step into one instruction.
rw <register> <value>
Queue a value to be written to a register before continuing.
help
Display the command help.
地址可以是绝对的、相对于主模块(+1234)、相对于另一个模块(ntdll+1234),或通过符号指定(!function 或 kernel32!ExitProcess)。断点也可以自动运行命令,例如 bp 1234 rw rax 0;g。
CLI 必须从包含 ghostdebug-core.dll 的目录运行,并且目标和 CLI 应使用相同的体系结构(x64)。