WinDbg相关
WinDbg_Scripts
hwnd
wtrace
Dependencies
dprobe
krabsetw
BPerf
Advanced Windows NT
Debugging Applications for Windows
AeDebug
adplus/vsjitdebugger
adplus -hang/-crash
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options]
Image File Execution Options
Debugger
lm
x console!
x urtbased!
本地内核调试
https://learn.microsoft.com/zh-cn/windows-hardware/drivers/debugger/performing-local-kernel-debugging
https://learn.microsoft.com/zh-cn/windows-hardware/drivers/debugger/setting-up-local-kernel-debugging-of-a-single-computer-manually
bcdedit /debug on
bcdedit /dbgsettings local
windbg -kl
kd -kl
IsDebuggerPresent
esp + 0x4
Windows 提供了 Heap Manager 完成上述功能。HeapAlloc 函数是 Heap Manager 的分配函数。
HeapAlloc -> VirtualAlloc
PageHeap & Gflag
幸运的是, HeapManager 的确提供了上述的主动错误检查功能。只需要在注册表里面做对应
的修改,操作系统就会根据设置来改变 HeapManager 的行为
PageHeap -> like macOS guard malloc
gflags -> [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\GlobalFlag]
[HKEY_LOCAL_MACHINE\ SOFTWARE\ Microsoft\ Windows NT\ CurrentVersion\ Image File Execution Options\ ImageFileName\ GlobalFlag]
内存泄露
https://www.jianshu.com/p/ad41c2e074e5_CrtDumpMemoryLeaks
Windows 平台定位C语言工程内存泄漏
https://zhuanlan.zhihu.com/p/443548463
bp ntdll!NtWriteFile “r $t0=@$t0+1;.printf "function executes:%d times ",@$t0;.echo;g”
bp msvcrt!printf “r $t0=@$t0+1;.printf "function executes:%d times ",@$t0;.echo;g”
hello
1 |
|
1 | cdb test.exe |
1 | !address -summary |
1 | !address -f:Heap -c:"s -a %1 %2 \"world\"" |
WinDbg数据搜索技巧 —《格蠹汇编-从堆里抢救丢失的博客》
https://www.cnblogs.com/luzhlon/p/7055363.html
Windbg调试—-Windbg入门
https://blog.csdn.net/tonychan129/article/details/127136283
1 | cdb -z ieblog.dmp |
https://dbgtech.github.io/Tools/lldb-using.html
http://advdbg.org/books/swdbg2e/v2toc.aspx
https://files-cdn.cnblogs.com/files/lixiong/userdbg_msinternal.pdf
DbgEng扩展
WdbgExts
EngExtCpp
r eip=0042d9e
符号链接symlink_什么是符号链接或符号链接? 如何为Windows和Linux创建Symlink?
https://blog.csdn.net/cunjiu9486/article/details/109076948
bootmgr -> WinLoad -> ntoskrnl -> smss -> win32k.sys/csrss -> WinLogon
WinLogon –> NtUserCreateWindowStation/NtUserCreateDesktop
-> Services.exe/LSASS.exe
-> userinit.exe -> Explorer.exe
1 | dtrace -n "syscall:::entry /execname == \"notepad.exe\"/ {printf(\"%s\",execname);}" -c notepad.exe |