Disabling VS JIT and Prepairing WinDBG for Unknown Exceptions


Often when you’re working on bug hunting, VS’s JIT Debugger became totally unusable cause it hasn’t a refined mechanism of exception inspection and no great aids for Post-Mortem Debugging, so became necessary to switch to the actual Lord of Debuggers..WinDbg (obviously after Sacred SoftICE :))so let’s disable the VS JIT that in case of crash will acts as the Handler of the occured Unhandled Exception.

Open VS Tools->Options->Debugging -> Just-In-Time Debugging and disable Native, Managed and Script

Now every application that crashes has not a debugger that handles the exception, let’s actualize WinDbg as JIT Debugger.

Go into WinDbg directory (Debugging Tools for Windows) and type

windbg -I

Now if all is ok a success MessageBox shoud appear.

Now try to cause an unhandled exception, for example by calling a buggy application, if Windbg popups it means that all works fine.

Now could happen that the unhandled exception is Unknown and windbg breaks when the execution is finished so we don’t have great information, no exception informations of reg/stack infos, but is here the power of windbg we can set Event Filters for all kind of exceptions known or not.

For example Unknown exception – code e0000001 (first chance)

We can put directly a break point when this unknown exception happens! ๐Ÿ™‚

by typing:

>sxe e0000001


To remove breakpoint type:

>sxd e0000001

See you to the next post.. ๐Ÿ™‚

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: