windbg调试程序

1.取消编译优化选择,将编译后的binary 及其 符号文件放入 bin下


2.设置gflags.exe,在程序刚启动就将其捕获
 
3. 进程:DoScan.exe在windbg.exe 设置如下:
(1)加载符号文件
0:000> .reload /f doscan.exe
0:000> .reload /f cliproxy.dll
"cliproxy.dll" was not found in the image list.
Debugger will attempt to load "cliproxy.dll" at given base 00000000.
Please provide the full image name, including the extension (i.e. kernel32.dll)
for more reliable results.Base address and size overrides can be given as
.reload <image.ext>=<base>,<size>.
Unable to add module at 00000000

如果reload命令加载本地symbol失败,可以用ld命令


(2)加载cliproxy.dll时下断点
0:000> sxe ld:cliproxy.dll
(3)设置断点
0:000> x doscan!*startupscan*
00411290 DoScan!DoStartUpScans (void)
00408ff0 DoScan!StartupScansLocked (void)
00409070 DoScan!StartupScansEnabled (void)
0:000> bp DoScan!DoStartUpScans
0:000> bp doscan!performscan
(4)开始调试
0:000> g

(5)设置源文件路径

4.将进程ccSvcHost.exe attached到windbg.exe上,之后做如下设置:
0:082> .reload /f avhostplugin.dll
0:082> x avhostplugin!*startscan*
0275dd70 AVHOSTPLUGIN!StartScan (struct HKEY__ *, unsigned long *, unsigned long, <function> *, <function> *, class CSavScanStatus *, void *, struct HKEY__ *, char *, char *)
027216e0 AVHOSTPLUGIN!CSavCloudScan::StartScan (void)
027556e0 AVHOSTPLUGIN!CScheduledScanService::StartScan (class CScheduledScanAbstract *, struct HKEY__ *, bool)
0275f170 AVHOSTPLUGIN!ThrottledStartScan (class CSavScanStatus *)
027e93b0 AVHOSTPLUGIN!CScanManagerService::StartScan (struct tagVARIANT, struct tagVARIANT *)
0:082> bp AVHOSTPLUGIN!CScanManagerService::StartScan
0:082> bl
 0 e 027e93b0     0001 (0001)  0:**** AVHOSTPLUGIN!CScanManagerService::StartScan
0:082> g

5.最终结果

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值