MEX Debugging Extension for WinDbg


Hello All, I'd like to share with you guys that like to analyze dump files the following tip:
The official version of the MEX extension publish was released and it is available for download at:
This extension is widely used by Microsoft Support Engineers in troubleshooting process applications.
After performing the download of MEX, you just need to extract the DLL to the winext subdirectory of WinDbg.
WinDbg is a user mode and kernel mode debugger with a graphical interface that uses the infrastructure of debuggers NTSD, CDB and KD to provide a more similar environment with Visual Studio, with watch windows, visual breakpoints on lines of code and other facilities for example, view variables (including C ++ objects), stack traces, and memory.
Examples of some MEX extension of commands:
 .load mex
 This command is used to load the MEX extension inside WinDbg so we can access the commands.
!mex.help
 This command displays the help of MEX extension grouped by category.
mex1
!clrstack2
 This command is used to display the managed call stack of the current thread.
clrstack2
 !dae
 This command is the DumpAllExceptions abbreviation.  It lists all the exceptions that were in memory at the time when the DUMP was collected.
dae
!us
 This command is short for UniqueStacks responsible for list all grouped by callstack threads.
us
! Mex.writemodule -a -p "destination path"
 This command is used to extract all binaries used by the application to an specific path.
writemodule
 !do2 "address"
 Short for DumpObject, this command displays the details of an object.
!sqlcn
Provides an overview of ADO.NET connections to SQL Server
I hope that you enjoy it!
Comments (5)

  1. Michael Cessna says:

    Exceptional work, much appreciated! Saved me time and headache.

    1. Excellent feedback! I am very glad that it helped you.

  2. Rajaniesh says:

    Amazing post!!

  3. Rajaniesh says:

    Can you please help which directory this would be --you just need to extract the DLL to the winext subdirectory

    1. You should extract inside the winext directory of the WinDbg directory, i.e., C:\Program Files (x86)\Windows Kits\10\Debuggers\x86\winext\ or C:\Program Files (x86)\Windows Kits\10\Debuggers\amd64\winext\.

      The default installation directory for 64 bit OS installs for the debugging tools is C:\Program Files (x86)\Windows Kits\10\Debuggers\. If you have a 32-bit OS, you can find the Windows Kits folder under C:\Program Files. To determine if you should use the 32 bit or 64 bit tools, see Choosing the 32-Bit or 64-Bit Debugging Tools.

      More details available at: https://msdn.microsoft.com/en-us/library/windows/hardware/ff543998(v=vs.85).aspx

      I hope have helped.
      Regards,

Skip to main content