windbg setting conditional breakpoint

前端 未结 2 966
误落风尘
误落风尘 2021-01-23 01:56

I want to put a conditional breakpoint in windbg.

For example lets say LoadLibrary API.

How can I put breakpoint such that it should it whenever user32.dll get l

2条回答
  •  南方客
    南方客 (楼主)
    2021-01-23 02:28

    you can not set a conditional breakpoint on a user32.dll since it's being mapped into the address space relatively early and the initial debugger's breakpoint triggers after that (as far as i know).

    provided you can track the moment user32.dll is loaded, you can override a module break like this:

    sxe ld user32.dll
    

    what you could do is have your app get started by a boostrapper application and then have windows debugger break on user32.dll load. just use -o command-line option or .childdbg 1 extension call to initiate debugging of child processes and have it started with cmd.exe, for instance:

    windbg -c "sxe ld user32.dll;g" -o cmd.exe /C yourapp.exe
    

提交回复
热议问题