Created
April 12, 2012 23:45
-
-
Save nicoster/2371944 to your computer and use it in GitHub Desktop.
Monitoring show/hide window using Windbg
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| .if (not(${/d:$arg1})) | |
| { | |
| .echo Now you're monitoring all windows for show/hide events in current process. | |
| .echo | |
| .echo If you just want to monitor one window, do it this way: | |
| .echo " $$>a<${$arg0} [hwnd]" | |
| .echo | |
| bp USER32!NtUserShowWindow ".printf \"ShowWindow(%N, %d)\\n\", poi(@esp+4), @@(!!@@(poi(@esp+8)));g" | |
| bp USER32!NtUserSetWindowPos ".printf \"SetWindowPos(%N, %d)\\n\", poi(@esp+4), @@(!!(@@(poi(@esp+1c))&0x40));g" | |
| } | |
| .else | |
| { | |
| bp USER32!NtUserShowWindow "j (poi(@esp+4) == ${$arg1}) '.echo;.printf \"ShowWindow(%N, %d) \\n\", poi(@esp+4), @@(!!@@(poi(@esp+8)));kL;g';'g'" | |
| bp USER32!NtUserSetWindowPos "j (poi(@esp+4) == ${$arg1}) '.echo;.printf \"SetWindowPos(%N, %d)\\n\", poi(@esp+4), @@(!!(@@(poi(@esp+1c))&0x40));kL;g';'g'" | |
| } | |
| bl |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment