Tuesday, 20 November 2012

Util - Windows Handles Viewer (Simple Gui) v1.0.exe

Following my research into Win32 Messaging APIs that allowed me to put both IBM AppScan Source and Standard working side by side and to connect TeamMentor with AppScan Source, here is a pretty sweet Windows Handles Viewer which allows the easy discovery (and in some cases modification) of the Window's Handle of a particular Win32's Button, TextBox, Menu, Window, etc...

You can download this (857kb) .NET 4.0 app from Util - Windows Handles Viewer (Simple Gui) v1.0.exe


And this is what it looks like:



To find a handle, just drag the Target icon around and you will see the values in the Handle, Window and Handle Text change.

In the image below, the Target icon was hovering on top of this tools's top bar:


The Handle Text TextBox can also be used to edit the value (which if applicable will be changed on the target Handle):


We can also view and edit other process (like Notepad)


And even Chrome:


In the example below, note how the the URL was changed, but the loaded website is still the same (owasp.org)



NOTE: These 'handle detection' and 'set text' techniques don't work with all visible controls:

  • more complex Windows controls, like TreeViews, DataGridViews, RichTextBoxes, ListViews, etc... require more complex Windows Messages
  • a number of applications, like for example WPF applications or WebBrowsers, have their own rendering engine (i.e. not using Win32/user32.dll )
    • in this case we will only see a handle for the window hosting those rendering engines


Script this tool: If you want to run or modify this tool (using the O2 Platform) here is the script used to create it: Util - Windows Messages Handle Viewer (Simple Gui).h2

Credits: this tools re-uses code from the http://hawkeye.codeplex.com/ tool