Break when a register has an specific value?

2020-03-26 03:48发布

Any way to make Windbg to break when a specific value is assigned to the eax register? I know one of the functions in my program is returning an specific error, it would be very fast to find the guilty this way.

标签: windbg
1条回答
姐就是有狂的资本
2楼-- · 2020-03-26 04:35

You can set a breakpoint on all your suspect functions and then check the eax register value like so:

bp myAddress ".if (@retreg == dodgyVal) {walk the stack and do other cool stuff} .else {gc}"

See conditional breakpoints and also pseudo-register syntax for available register values

查看更多
登录 后发表回答