天天看点

windows下各调试器条件断点实例

0x00 前言

    发现网上很多关于ollydbg和windbg的条件断点的设置是错误的,所以这里总结下。

0x01 字符串条件断点

ollydbg:

unicode字符串:
bp kernel32.CreateFileW, [UNICODE [esp+4]]=="C:\\4.txt" 
 
ascii字符串:
bp kernel32.CreateFileA, [STRING [esp+4]]=="C:\\4.txt"
           

windbg:

unicode字符串:
bp kernel32!CreateFileW "$<F:\\script.txt"
其中,F:\script.txt的内容为:
as /mu ${/v:fname} poi(esp+4)
.if ( $sicmp( "${fname}", "c:\3.txt" ) = 0  ) {.echo ${fname}} .else {gc}
 
ascii字符串:
bp kernel32!CreateFileA "$<F:\\script.txt"
其中,F:\script.txt的内容为:
as /ma ${/v:fname} poi(esp+4)
.if ( $sicmp( "${fname}", "c:\3.txt" ) = 0  ) {.echo ${fname}} .else {gc}
           

继续阅读