2014年8月15日星期五

WINDBG条件断点

Setting a Conditional Breakpoint

Conditional breakpoints can be very useful when you are trying to find bugs in your code. 
They cause a break to occur only if a specific condition is satisfied.

正如文章所说:很有用。
同时,这也是通向WINDBG脚本的好途径。

本文收集本人常用的条件断点:


1.不是条件断点的高级断点:发生操作时不断下来而是打印个信息。
bu nt!zwcreatefile ".echo zwcreatefile is called;g"
bu ntdll!ntcreatefile ".echo ntcreatefile is called;g"
bu kernel32!CreateFileA "poi(eso + 4)"
bu kernel32!CreateFileW "poi(eso + 4)"


2.不算是条件断点的基于进程/线程的断点,主要用于内核模式的调试:
bu /p 81cf3540 test!PreOPeration
bu /p 81cf3540 test!PreOPeration+0x1af
bu1 /p 81e7f368 @@masm(`test!e:\code\driver\test0\test.c:422+`);
线程的不再说了,因为CID都是全局的。
这也省了编写这些识别条件的代码了。

没有评论:

发表评论