【问题标题】:Ignore some locations in Windbg Conditional breakpoints忽略 Windbg 条件断点中的某些位置
【发布时间】:2018-07-08 21:52:18
【问题描述】:

我正在尝试使用以下语法在 Windbg 中的 Windows 内核模式上设置条件硬件断点:

ba w1 ffff802312345678 "j(@rip==ffff802387654321 || @rip==ffff802387654330) 'gc';''"

我使用上述命令是为了忽略从 ffff802387654321ffff802387654330 对我的目标位置 (ffff802312345678) 的每次访问,因此每次从其他地方进行访问时,我都会收到通知。

但问题是,它仍然在 ffff802387654321ffff802387654330 等其他位置中断。

我还阅读了 official documents 关于“Conditional Breakpoints and Register Sign Extension”的文章,还测试了类似这样的内容:

ba w1 ffff802312345678 "j((@rip & 0xffffffffffffffff)=ffff802387654321 || (@rip & 0xffffffffffffffff)=ffff802387654330) 'gc';''"

但还是不行。

所以我的问题是:

  • 上面的命令有什么问题,我怎样才能达到预期的效果 结果?

【问题讨论】:

    标签: windbg breakpoints conditional-breakpoint


    【解决方案1】:

    没有|| MASM operator。我是or

    使用

    ba w1 ffff802312345678 "j(@rip==ffff802387654321 or @rip==ffff802387654330) 'gc';''"
    

    我没有复制你的确切情况,而是一个更简单的例子:

    0:000> r rip
    rip=0000000076db6fb0
    0:000> j (@rip==0000000076db6fb0 || @rip==0) '.echo 5';'.echo 6"
    Numeric expression missing from '| @rip==0) '.echo 5';'.echo 6"'
    0:000> j (@rip==0000000076db6fb0 or @rip==0) '.echo 5';'.echo 6"
    5
    

    【讨论】:

    • 附带说明,可以通过@c++operator 使用||j (@@c++(@rip==0000000076db6fb0 || @rip==0)) '.echo 5';'.echo 6" 或通过.expr /s c++ 完全切换到c++ 评估器。
    • @Neitsa:我尝试了@@c++,但没有成功。它对你有用吗?
    • @Neitsa:.expr /s c++ 也不起作用。在这两种情况下,它都会显示“无法解决...处的错误”
    • 奇怪:(这是session example;我的Windbg版本是10.0.16299.15不是windbg预览版)。
    猜你喜欢
    • 2018-03-09
    • 1970-01-01
    • 1970-01-01
    • 2014-11-10
    • 1970-01-01
    • 2019-05-16
    • 2012-12-31
    • 1970-01-01
    • 2011-03-21
    相关资源
    最近更新 更多