当寄存器中的地址指向带有某种模式的内存块时,我需要在调试器windbg中设置断点,并且该模式未固定以抵消诸如
bp ws2_32!sendto "j s @rdx @rdx+100 53 65 6e 64 g"
如何正确编写此条件?因此,只有在rdx和rdx + 100内部的地址范围内有此模式时,我才需要中断sendto 53 65 6e 64
bp ws2_32!sendto ".if(s @rdx @rdx+100 53 65 6e 64) == 0 { g }" error too
问题是s
不能构成有效条件。它要么打印结果,要么不打印结果。
示范准备
2:007> .dvalloc 1000
Allocated 1000 bytes starting at 003b0000
2:007> eb 003b0000 53 65 6e 64
2:007> db 003b0000 L10
003b0000 53 65 6e 64 00 00 00 00-00 00 00 00 00 00 00 00 Send............
测试使用 s
2:007> s-a 003b0000 L100 "Send"
003b0000 53 65 6e 64 00 00 00 00-00 00 00 00 00 00 00 00 Send............
2:007> s-a 003b0000 L100 "Test"
您可以.foreach
在的输出上使用s
。它将为输出中的每个单词运行命令,该命令太多了:
2:007> .foreach (output {s-a 003b0000 L100 "Send"}) { .echo "found" }
found
found
found
found
[...]
因此,让我们使用s
具有特殊选项的事实,即仅输出地址
2:007> .foreach (output {s-[1]a 003b0000 L100 "Send"}) { .echo "found" }
found
目前无法对您的断点进行复制,但它看起来应该像
bp ws2_32!sendto ".foreach (output {s-[1]a @rdx L100 "Send"}) { g }"
当搜索字节而不是ASCII字符串并使用寄存器而不是地址时,这也应该起作用
2:007> r eax = 003b0000
2:007> .foreach (output {s-[1]b @eax L100 53 65 6e 64}) { .echo "found" }
found
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句