Skip to content

Instantly share code, notes, and snippets.

@nicoster
Created April 12, 2012 23:45
Show Gist options
  • Select an option

  • Save nicoster/2371944 to your computer and use it in GitHub Desktop.

Select an option

Save nicoster/2371944 to your computer and use it in GitHub Desktop.
Monitoring show/hide window using Windbg
.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