Friday, January 19, 2007

.NET Object Spy

This post is more like the actual reason why that I've set up this blogging thing :)

I've created a .NET Object spy which can be handy in production or acceptance environments.
Actually I've found the base-code on codeproject (http://www.codeproject.com/KB/dotnet/objectspy.aspx) and modified chunks of it, the core injector thing to hookup and the icons come from there.
Thanks to Bjarne Dam Sørensen for this magnificant code.

Where you don't always have the possibility to 'debug' your project, because it's hosted at an end-user's computer or on a server somewhere, and the server/computer does in most cases not have Visual Studio installed.

I'm sure that there are other tools on the market that maybe can do the same job (or better).

But the reason i made this tool is specially for learning purposes, and with this experience also maybe be able to give other developers a tool for debugging that's totally free.

So we will go to the explaining stuff:

.Net Object Spy / Debugger

This project is able to hook on to a handle from another .net application.
The only limitation at the time (which is a pretty big one) is that it will only work on
winforms applications.
Because winforms apps have controls with handles which i can lock into and then show them in a user-friendly gui. (or that's the intention :))

The GUI is pretty straight forward.

You have an icon on the upper left of the window which allows you to drag it over your application to select a control you want to examine.
If you did that, then you can click on 2 buttons.

button 1 = 'Open Spy'
button 2 = 'Open hooked'

if you click 'Open Spy' or 'Open Hooked' then a viewer will open, where you van 'browse' your control and all it's properties and fields etc.

The open hooked, hooks on the application but will not unhook!
For doing that, you have the press a third button -> 'Close Hook'

If you open the debugger in hooked mode, then you can at run time change all the values in
the objects available in the control.

It doesn't matter whether the application is obfuscated or not, or is build in release or debug mode.

View the next post to find the distribution.

Enjoy !

Whizzo

4 comments:

Unknown said...
This comment has been removed by the author.
Unknown said...

Hi,
The Zip file of the .net application is not available in the location specified by the download link. Kindly upload the application as I am in need of application which does what ever you have described.

Regards,
PRiya

Whizzo said...

Priya,

The link is restored again,
Please let me know wether this app did the trick please ;)

W.

JeWe said...

Hi,

the download is again not available - BTW did you include source code?
Could you please make the download available again?

Thanks, JeWe