Trilha C/C++ Wanderley Caloni Sócio-Desenvolvedor da
Nov 22, 2014
Trilha C/C++
Wanderley CaloniSócio-Desenvolvedor da
Depurando até o fim do mundo: técnicas e truques de
WinDbg
Onde sou? Quem estou?
• Segurança da Informação– Sistema de Controle de Usuários e Aplicações– Criptografia de Discos
Onde sou? Quem estou?
• Análise de Trojans– Engenharia Reversa– Crash Dump Analysis
Onde sou? Quem estou?
• Mercado Financeiro– Alto Desempenho– Análise de Risco
Onde sou? Quem estou?
• Mercado Financeiro– Alto Desempenho– Algoritmos– Cotações– Mobile
Onde sou? Quem estou?
Onde sou? Quem estou?
Onde sou? Quem estou?
Vamos ao que interessa?
dd ed kv kvn . ~ .frame lm a .dvalloc .dvfree .symfix .reload !analyze –v r !uniqstack bp bl bm bc bd s !heap
dv bm dd poi(esp+8) !db !eb .sympath .srcpath .kvn .frame .cl
s .echo u –remote –premote –server .help symstore adplus logger logviewer !sym noisy .call wt !heap
l+* –flt s 1034 –p –a $$> <:-o
SOFTICE
SOFTICE
DEBUG.COM
DEBUG.COM
windbg.exe -k com:port=1,baud=115200,resets=0,reconnect -b
bcdedit /dbgsettingsbcdedit /copy {current}bcdedit set debug on
windbg.exe -k usb2:targetname=USBString -b
bcdedit /dbgsettingsbcdedit /copy {current}bcdedit set debug on
windbg.exe -k com:pipe,port=\\.\pipe\com_1,resets=0,reconnect -b
windbg.exe -k com:pipe,port=\\.\pipe\com_1,resets=0,reconnect -b
WELCOME TO THE REAL WORLD
NABUCODEBUGGER
.symfix
.sympath!sym noisy.reload [/f] [/i] ModuleName.extlm[l]
symstore.exe add /f Symbols.pdb /s <SymbolStore> /t “ProductName"
SRCSRV (SVN)
windbg.exe -server tcp:port=<n>windbg.exe -remote tcp:server=<ip>,port=<n>windbg.exe -remote tcp:server=<ip>,port=<n>windbg.exe -remote tcp:server=<ip>,port=<n>
dbgsrv.exe -t tcp:port=<n>windbg.exe -premote tcp:server=<ip>,port=<n>
TCP Client => ServerTCP Server => ClientSerial (??????)Named PipeSSL/SPIPE
(password, ipv6, ...)
selfie
.dump /ma <dump-file.dmp>
Adplus -Crash -pmn <proc-name>
!analyze -v!analyze -v!analyze -v!analyze -v!analyze -v!analyze -v!analyze -v!analyze -v
GLOBAL FLAGS
GLOBAL FLAGS
SXE, SXD, SXN, SXI
SXE ld:MinhaDLL.dll
logger process.exe
CODECOMPILEPROFILECODECOMPILEPROFILECODECOMPILEPROFILECODECOMPILEPROFILECODECOMPILEPROFILECODECOMPILEPROFILE...
WT
DEBUGGER
KERNEL
USER
PROCESS
CABLE
DEBUGGER
$<, $><, $$<, and $$><
#include < wdbgexts.h>
.hh <topic>
www.windbg.info