【问题标题】:Windbg conditional breakpoints ignore condition itselfWindbg 条件断点忽略条件本身
【发布时间】:2018-03-09 00:01:26
【问题描述】:

我正在调试一个没有源的应用程序,我使用 IDA PRO + Windbg 作为调试器。我想用特定的句柄值来捕捉对CloseHandle 的调用,例如handle=0x14

我这样设置条件断点:

bp kernel32!CloseHandle "j (poi(@esp+4)=0x00000014) ''; 'gc'"

断点设置正常,但在每次调用CloseHandle 时都会中断,这与我尝试的相反,仅在第一个参数等于0x14 时才中断

【问题讨论】:

  • 你需要一个条件等于 == 而不是单个 =

标签: debugging windbg breakpoints ida conditional-breakpoint


【解决方案1】:

您缺少 = 条件等于运算符需要 两个 == 而不是 单个 =

0:000> bp kernel32!CloseHandle ".if(poi(@esp+4)!=0xcc) {? dwo(@esp+4);gc}.else{? dwo(@esp+4);.echo our handle;gc}"
0:000> g

Evaluate expression: 60 = 0000003c
Evaluate expression: 56 = 00000038

Evaluate expression: 204 = 000000cc <------
our handle <-------------

Evaluate expression: 200 = 000000c8    
Evaluate expression: 256 = 00000100   
Evaluate expression: 272 = 00000110    
Evaluate expression: 280 = 00000118    
Evaluate expression: 308 = 00000134
Evaluate expression: 312 = 00000138
Evaluate expression: 308 = 00000134
Evaluate expression: 324 = 00000144
Evaluate expression: 328 = 00000148
Evaluate expression: 324 = 00000144

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-05-16
    • 1970-01-01
    • 1970-01-01
    • 2011-01-27
    • 2021-11-18
    相关资源
    最近更新 更多