The debugger is one of the simplest tools available to a developer and yet it is also one of the most powerful. In the simplest case the debugger can display a stack trace of a thread and set break points on functions. This simply requires the debugger to walk the stack or modify and restore memory locations. The outcome of these simple actions can be very powerful. The use of one or two simple commands can solve what would otherwise be a head banging problem.
Developers may spend hours modifying source code to help track down the problems they are seeing. This is definitely a good thing to do and is often necessary, however there are tricks and shortcuts that can be done just using the debugger.
In this article, I will not be covering how to do stack traces or how to track down an access violation. Instead I will show how to use the debugger in non-conventional ways and demonstrate advanced debugging and reverse engineering techniques using very simple debugger features.
The tools I will be using in this article are "cdb", "ntsd" and "windbg," which are freely downloadable debuggers provided by Microsoft (http://www.microsoft.com/whdc/devtools/ddk/default.mspx). There are obviously many other great tools and debuggers such as Bounds Checker, Softice, Ollydebug, VTune and etc. however these are beyond the scope of what will be covered here.