• Debugging tools for windows use. Install Debugging Tools for Windows. Installing WinDBG on Windows

    To identify the causes of blue screens (BSOD), it is required to analyze the memory dump. In the vast majority of cases, a minidump is enough, which is created by the system in case of critical errors.
    This article provides step-by-step instructions for installing and configuring WinDBG, a powerful debugging tool that allows you to identify the true cause of a BSOD.

    Step 1 — Setting Up Small Memory Dump Recording

    Step 2 — Installing WinDBG

    To analyze memory dumps, you will need to install the WinDBG debugger, which is included with the Windows SDK. At the time of writing, the latest available versions of the Windows SDK are:

    • Windows 10 SDK (download online installer)
    • Windows 8.1 SDK (download online installer)

    Step 3 — Mapping .dmp Files to WinDBG

    Map your .dmp files to WinDBG to make it easier to read and analyze memory dumps. This will allow you to open dump files from Explorer directly in WinDBG, bypassing its preliminary launch.


    Step 4 — Setting Up the Symbol Server to Receive Debug Symbol Files


    The installation and initial configuration of WinDBG is now complete. In order to change its appearance, you can go to the menu view- font settings you will find by selecting the item Font, and console window settings in Options.

    To identify the causes of blue screens (BSOD), it is required to analyze the memory dump. In the vast majority of cases, a minidump is enough, which is created by the system in case of critical errors.
    This article provides step-by-step instructions for installing and configuring WinDBG, a powerful debugging tool that allows you to identify the true cause of a BSOD.

    Step 1 — Setting Up Small Memory Dump Recording

    Step 2 — Installing WinDBG

    To analyze memory dumps, you will need to install the WinDBG debugger, which is included with the Windows SDK. At the time of writing, the latest available versions of the Windows SDK are:

    • Windows 10 SDK (download online installer)
    • Windows 8.1 SDK (download online installer)

    Step 3 — Mapping .dmp Files to WinDBG

    Map your .dmp files to WinDBG to make it easier to read and analyze memory dumps. This will allow you to open dump files from Explorer directly in WinDBG, bypassing its preliminary launch.


    Step 4 — Setting Up the Symbol Server to Receive Debug Symbol Files


    The installation and initial configuration of WinDBG is now complete. In order to change its appearance, you can go to the menu view- font settings you will find by selecting the item Font, and console window settings in Options.

    These types of failures are usually associated with a failed driver that can be difficult to pinpoint. However, the improved bug tracking system in Windows Vista (and not only in Vista!) can often lead you to a problematic file. As a result, most people stop frantically trying to work on an unstable computer, saving documents with paranoid regularity and hoping for the best.

    When Windows crashes, a so-called “memory dump” is usually created. The latter can be investigated with the free Windows Debugging Tools, which can point you to the source of the problem. Therefore, all you need to do is:

    Download yourself a debugging tool

    You can download Windows Debugging Tools directly from the Microsoft website. The program works with many operating systems, starting with Windows NT 4 and ending with Windows 2008, so you should not have any problems with it. Yes, it cannot be said that it is stable under Windows 7 RC, but according to our tests it still works. Therefore, even an attempt to diagnose a problem from under Windows 7 RC may be successful.

    Configure your system

    During crashes, your computer needs to create memory dumps that will later serve as a source of information for the debugger. Therefore, it is important that Windows is configured to generate dumps. To configure your operating system, right-click on Your computer (Computer) and select Properties (Properties). Then click on the Advanced System Settings tab, on it find the Startup and Recovery Settings subsection and make sure that the Write debugging information option is set to Kernel memory dump ) or Complete memory dump.

    Next, click Start, go to Programs (All Programs), select Debugging Tools and run WinDbg. In the program, go to the File menu and select Symbol File Path ... Then write the following line in the window that opens:

    SRV*c:\symbols*http://msdl.microsoft.com/download/symbols

    The latter defines the path to special data - the so-called "symbols" (symbols), which can help the debugging tool in identifying your crashed file.

    After entering the string, click the OK button. Later, when working with the debugger, this line will cause the symbols to be downloaded from msdl.microsoft.com and saved to the c:\symbols folder.

    Solve your problem

    Now wait for another blue screen failure, and the subsequent completion of the computer restart. Then run WinDbg again (Vista users need to run the program as an administrator), click on the File menu, select Open Crash Dump, open the \Windows\MEMORY.DMP file, and the program will immediately begin to analyze it.

    Unfortunately, WinDbg provides very little information about what it does, so you might even think that the program is stuck. However, wait. Understand that analyzing, say, 4GB of memory on a not very powerful computer can take some time, up to hours. Therefore, be patient, but rather leave the analysis overnight.

    However, usually the result is obtained within a few minutes. This is evidenced by the Bugcheck Analysis line that says something like "Probably caused by: UACReplace.sys". Translated into Russian, this means that the problem is possibly caused by the UACReplace.sys file. Enter it into the search bar, for example, Google and you will find out its real origin. In particular, if it belongs to one of the programs you installed or an installed driver, then you can simply try to update it or it. Perhaps this will solve your problems.

    I must say that from time to time WinDbg cannot name the file at all, or it simply selects one of the Windows DLLs. If this happened to you, then just click on the command window above the status bar and type the command:

    After that press Enter. This will give you a more detailed report, which may contain information about the possible causes of your troubles.

    If this time you are not lucky, do not despair. Debugging is quite difficult, even for experts. So just close WinDbg and run the analyzer again after the next crash. Perhaps this will give you some more information. Good luck!

    Introduction to WinDBG - Part 1

    Alexander Antipov

    WinDBG is a great debugger. It may not have a very user-friendly interface and no black background by default, but it is one of the most powerful and stable debuggers on Windows at present. In this article, I'll walk you through the basics of WinDBG so you can get started with it.


    WinDBG is a great debugger. It may not have a very user-friendly interface and no black background by default, but it is one of the most powerful and stable debuggers on Windows at present. In this article, I'll walk you through the basics of WinDBG so you can get started with it.

    This is the first article in a series about WinDBG. List of all articles included in this series:

    • Part 1 - installation, interface, symbols, remote/local debugging, help system, modules, registers.
    • Part 2 - breakpoints.
    • Part 3 - memory inspection, program step-by-step debugging, tips and tricks.

    In this article we'll look at mounting and attaching to a process, and in the following ones we'll cover breakpoints, stepping through, and memory inspection.

    Installing WinDBG

    Compared to Windows 7, the installation process for WinDBG in Windows 8 has changed slightly. In this section, we'll cover installing the debugger for both operating systems.

    Installing WinDBG on Windows 8

    In Windows 8, WinDBG is included in the Windows Driver Kit (WDK). You can install Visual Studio and the WDK, or install the Debugging Tools for Windows 8.1 package separately, which includes WinDBG.

    The installer will ask if you want to install WinDBG locally or download the entire development package for another computer. The latter is essentially the equivalent of a standalone installer, which is very handy if you want to install the package on other systems in the future.

    Figure 1: Selecting the installation type

    In the next window, you need to uncheck all items except "Debugging Tools for Windows" and click on the "Download" button.

    Once the installer has completed its work, go to the directory where the package was downloaded (by default it is c:\Users\Username\Downloads\Windows Kits\8.1\StandaloneSDK) and go through the installation procedure.

    Installing WinDBG on Windows 7 and earlier

    For Windows 7 and earlier, WinDBG is part of the "Debugging Tools for Windows" package, which is included with the Windows SDK and the .Net Framework. You will be required to download the installer, and then select "Debugging Tools for Windows" during the installation process.

    During installation, I select the "Debugging Tools" option under "Redistributable Packages" to create a standalone installer to facilitate subsequent installations.

    Figure 2: Selecting installation options to create a standalone installer

    Upon completion of the installation, you should have WinDBG installers for various platforms (in the directory c:\Program Files\Microsoft SDKs\Windows\v7.1\Redist\Debugging Tools for Windows\).

    Figure 3: Folder with WinDBG installers for various platforms

    WinDBG Interface

    Figure 4: Appearance of WinDBG

    Once you first see the look and feel of WinDGB, you will realize that the debugger is frighteningly simple. Most of the WinDBG functions are learned during process debugging. Instead of wasting time describing the interface, in the following sections we will only cover the most important points.

    The most basic thing you need to know about the debugger interface is the command window, which consists of two areas. The first area: a window where the result of executing commands is displayed. Second area: a small text field for entering commands.

    Figure 5: WinDBG Command Window

    Symbols

    In most cases, WinDBG does not require any special settings and works correctly right out of the box. But one important thing that needs to be tweaked is the symbols. Symbols are files that are generated along with the executable file during program compilation and contain debugging information (functions and variable names). Debug information allows you to explore the functionality of an application while debugging or disassembling. Many Microsoft components are compiled with symbols that are distributed through the Microsoft Symbol Server. With the rest of the executable files, everything is not so rosy - very rarely files with debugging information are bundled with the application. In most cases, companies restrict access to such information.

    To configure WinDBG to use Microsoft Symbol Server go to the File:Symbol File Path section and set the path to SRV*C:\Symbols*http://msdl.microsoft.com/download/symbols. Of course, it's a bit odd that asterisks are used as a delimiter. After you set up the Microsoft Symbol Server, the symbols will be downloaded to the C:\Symbols folder.

    Figure 6: Microsoft Symbol Server setup

    WinDBG will automatically load symbols for binary files when needed. You can also add your own symbols folder like so:

    SRV*C:\Symbols*http://msdl.microsoft.com/download/symbols;c:\SomeOtherSymbolFolder

    Adding symbols while debugging

    If you need to import symbols while debugging, you can do so with .sympath (the command window will appear when you hook into the process). For example, to add the c:\SomeOtherSymbolFolder folder, enter the following command:

    0:025> .sympath+ c:\SomeOtherSymbolFolder
    Symbol search path is: SRV*C:\Symbols*http://msdl.microsoft.com/download/symbols;c:\SomeOtherSymbolFolder
    Expanded Symbol search path is: srv*c:\symbols*http://msdl.microsoft.com/download/symbols;c:\someothersymbolfolder

    It's a good idea to reload symbols after adding or changing paths:

    0:025> .reload
    Reloading current modules
    ................................................................
    ...............................................

    Checking Loaded Symbols

    To see which modules have symbols loaded, you can use the x*! command. Although WinDBG only loads symbols as needed, the x*! will show symbols that can be loaded. You can force symbols to be loaded using the ld * command (this may take some time and you can stop this process by going to Debug:Break).

    Now we can see the symbols for each module.

    Figure 8: List of symbols

    Debugging a local process

    When debugging a local process, you have two options:

    1. Attach to an already running process.
    2. Launch process via WinDBG.

    Each method has its own advantages and disadvantages. If, say, you run the program through WinDBG, then you have some special debugging options available (for example, heap debugging) that can cause the application to crash. On the other hand, there are also programs that crash when you attach a debugger to them. Some applications (especially malware) check the presence of a debugger in the system during startup and, accordingly, in this case it makes sense to cling to an already running process. Sometimes there is a debugging of a Windows service that sets some parameters at startup time, so to simplify the debugging process, it is also better to hook onto a running process rather than start the service through a debugger. Some people claim that running a process through a debugger has a serious impact on performance. In short, try both and choose what suits you best. If for some reason you prefer a particular method, share your thoughts in the comments!

    Starting a process

    If you're debugging a standalone application that's running locally and isn't networked, you might want to run it through WinDBG. However, this does not mean that you cannot hook on to an already running process. Choose the most convenient way for you.

    Starting the process is not difficult. Go to "File:Open Executable" and select the executable you want to debug. You can also provide arguments or set the start directory:

    Figure 9: Selecting an executable for debugging

    Process connection

    Connecting to an already running process is also not difficult. However, please note that in some cases it may take time to find the exact process you want to debug. For example, some browsers create one parent process and then several more processes for each tab. So, depending on the crash dump you're debugging, you might want to hook not to the parent process, but to the process associated with the tab.

    To attach to an already running process, go to "File:Attach to a Process" and then select the PID or process name. Remember that you need to have the appropriate rights to hook into the process.

    Figure 10: Selecting a process to hook on to

    If, after connecting, the application has suspended its work, you can use the "Noninvaise" mode by checking the appropriate box.

    Debugging a remote process

    You may sometimes need to debug a process on a remote system. It would be much more convenient to handle this task with a local debugger instead of using a virtual machine or RDP. Or maybe you're debugging the LoginUI.exe process, which is only available when the system is locked. In situations like this, you can use the local version of WinDBG and attach to processes remotely. To solve these problems, there are two most common methods.

    Existing debug sessions

    If you have already started debugging the program locally (by attaching or launching a process through WinDBG), you can enter a specific command and WinDBG will start a "listener" (listener) that the remote debugger can connect to. To do this, use the .server command:

    Server tcp:port=5005

    After running the above command, you may see a warning like this:

    Figure 11: Warning message that may appear after running the command to create a "listener"

    Then WinDBG will report that the server is running:

    0:005> .server tcp:port=5005
    0: -remote tcp:Port=5005,Server=USER-PC

    You can now connect from a remote host to an already existing debug session by going to "File:Connect to a Remote Session" and entering something like this in the text field: tcp:Port=5005,Server=192.168.127.138

    Figure 12: Remote connection to a debug session

    After connecting, you will receive confirmation on the remote client:


    server started. Client can connect with any of these command lines
    0: -remote tcp:Port=5005,Server=USER-PC
    MACHINENAME\User (tcp 192.168.127.138:13334) connected at Mon Dec 16 09:03:03 2013

    and the message in the local version of the debugger:

    MACHINENAME\User (tcp 192.168.127.138:13334) connected at Mon Dec 16 09:03:03 2013

    Create a remote server

    You can also create a separate WinDBG server, connect to it remotely, and select a process to debug. This can be done using the dbgsrv.exe file where you plan to debug processes. To start such a server, run the following command:

    dbgsrv.exe -t tcp:port=5005

    Figure 13: Starting a remote server

    And again, you may receive a security warning that you should accept:

    Figure 14: Security message that may appear during debug server startup

    You can connect to the debug server if you go to the "File: Connect to Remote Stub" file and enter the following line in the text field: tcp:Port=5005,Server=192.168.127.138

    Figure 15: Connecting to the debug server

    After connecting, you will not receive any signals that you have connected, but if you go to "File:Attach to a Process", you will see a list of debug server processes (where dbgsrv.exe is running). Now you can hook into the process as if you were doing it locally.

    Help system

    The help system in WinDBG is great. In addition to learning something new, you should be able to get help information about a command. Use the .hh command to access the WinDBG help:

    You can also get help information for a specific command. For example, to get help on the .reload command, use the following command:

    windbg> .hh .reload

    Or just go to the "Help:Contents" section.

    Modules

    While the program is running, various modules are imported that provide the functionality of the application. Therefore, if you know which modules are imported by an application, you can better understand how it works. In many cases, you will be debugging the specific module loaded by the program, not the executable itself.

    Once connected to the process, WinDBG will automatically display the loaded modules. For example, below are the modules after I connected to calc.exe:

    Microsoft (R) Windows Debugger Version 6.12.0002.633 X86
    Copyright (c) Microsoft Corporation. All rights reserved.

    *** wait with pending attach
    Symbol search path is: SRV*C:\Symbols*http://msdl.microsoft.com/download/symbols
    Executable search path is:
    ModLoad: 00a70000 00b30000 C:\Windows\system32\calc.exe
    ModLoad: 77630000 7776c000 C:\Windows\SYSTEM32\ntdll.dll
    ModLoad: 77550000 77624000 C:\Windows\system32\kernel32.dll
    ModLoad: 75920000 7596a000 C:\Windows\system32\KERNELBASE.dll
    ModLoad: 76410000 77059000 C:\Windows\system32\SHELL32.dll
    ModLoad: 77240000 772ec000 C:\Windows\system32\msvcrt.dll
    ModLoad: 76300000 76357000 C:\Windows\system32\SHLWAPI.dll
    ModLoad: 75cd0000 75d1e000 C:\Windows\system32\GDI32.dll
    ModLoad: 75fa0000 76069000 C:\Windows\system32\USER32.dll
    ModLoad: 777b0000 777ba000 C:\Windows\system32\LPK.dll
    ModLoad: 774b0000 7754d000 C:\Windows\system32\USP10.dll
    ModLoad: 73110000 732a0000 C:\Windows\WinSxS\x86_microsoft.windows.gdiplus_
    6595b64144ccf1df_1.1.7600.16385_none_72fc7cbf861225ca\gdiplus.dll
    ModLoad: 75a80000 75bdc000 C:\Windows\system32\ole32.dll
    ModLoad: 76360000 76401000 C:\Windows\system32\RPCRT4.dll
    ModLoad: 777c0000 77860000 C:\Windows\system32\ADVAPI32.dll
    ModLoad: 75be0000 75bf9000 C:\Windows\SYSTEM32\sechost.dll
    ModLoad: 76270000 762ff000 C:\Windows\system32\OLEAUT32.dll
    ModLoad: 74590000 745d0000 C:\Windows\system32\UxTheme.dll
    ModLoad: 74710000 748ae000 C:\Windows\WinSxS\x86_microsoft.windows.common-
    ModLoad: 703d0000 70402000 C:\Windows\system32\WINMM.dll
    ModLoad: 74c80000 74c89000 C:\Windows\system32\VERSION.dll
    ModLoad: 77770000 7778f000 C:\Windows\system32\IMM32.DLL
    ModLoad: 75c00000 75ccc000 C:\Windows\system32\MSCTF.dll
    ModLoad: 74130000 7422b000 C:\Windows\system32\WindowsCodecs.dll
    ModLoad: 74260000 74273000 C:\Windows\system32\dwmapi.dll
    ModLoad: 756d0000 756dc000 C:\Windows\system32\CRYPTBASE.dll
    ModLoad: 75e60000 75ee3000 C:\Windows\system32\CLBCatQ.DLL
    ModLoad: 6ef10000 6ef4c000 C:\Windows\system32\oleacc.dll

    Later in the debugging process, you can display this list again with the lmf command:

    0:005>lmf
    start end module name
    00a70000 00b30000 calc C:\Windows\system32\calc.exe
    6ef10000 6ef4c000 oleacc C:\Windows\system32\oleacc.dll
    703d0000 70402000 WINMM C:\Windows\system32\WINMM.dll
    73110000 732a0000 gdiplus C:\Windows\WinSxS\x86_microsoft.windows.gdiplus_6595b64144ccf1df_
    1.1.7600.16385_none_72fc7cbf861225ca\gdiplus.dll
    74130000 7422b000 WindowsCodecs C:\Windows\system32\WindowsCodecs.dll
    74260000 74273000 dwmapi C:\Windows\system32\dwmapi.dll
    74590000 745d0000 UxTheme C:\Windows\system32\UxTheme.dll
    74710000 748ae000 COMCTL32 C:\Windows\WinSxS\x86_microsoft.windows.common-
    controls_6595b64144ccf1df_6.0.7600.16385_none_421189da2b7fabfc\COMCTL32.dll
    74c80000 74c89000 VERSION C:\Windows\system32\VERSION.dll
    756d0000 756dc000 CRYPTBASE C:\Windows\system32\CRYPTBASE.dll
    75920000 7596a000 KERNELBASE C:\Windows\system32\KERNELBASE.dll
    75a80000 75bdc000 ole32 C:\Windows\system32\ole32.dll
    75be0000 75bf9000 sechost C:\Windows\SYSTEM32\sechost.dll
    75c00000 75ccc000 MSCTF C:\Windows\system32\MSCTF.dll
    75cd0000 75d1e000 GDI32 C:\Windows\system32\GDI32.dll
    75e60000 75ee3000 CLBCatQ C:\Windows\system32\CLBCatQ.DLL
    75fa0000 76069000 USER32 C:\Windows\system32\USER32.dll
    76270000 762ff000 OLEAUT32 C:\Windows\system32\OLEAUT32.dll
    76300000 76357000 SHLWAPI C:\Windows\system32\SHLWAPI.dll
    76360000 76401000 RPCRT4 C:\Windows\system32\RPCRT4.dll
    76410000 77059000 SHELL32 C:\Windows\system32\SHELL32.dll
    77240000 772ec000 msvcrt C:\Windows\system32\msvcrt.dll
    774b0000 7754d000 USP10 C:\Windows\system32\USP10.dll
    77550000 77624000 kernel32 C:\Windows\system32\kernel32.dll
    77630000 7776c000 ntdll C:\Windows\SYSTEM32\ntdll.dll
    77770000 7778f000 IMM32 C:\Windows\system32\IMM32.DLL
    777b0000 777ba000LPK C:\Windows\system32\LPK.dll
    777c0000 77860000 ADVAPI32 C:\Windows\system32\ADVAPI32.dll

    You can also find out the download address for a specific module using the "lmf m" command:

    0:005> lmf m kernel32
    start end module name
    77550000 77624000 kernel32 C:\Windows\system32\kernel32.dll

    You can also get information about the image header of a particular module using the !dh extension (the exclamation point indicates an extension):

    0:005> !dh kernel32

    File Type: DLL
    FILE HEADER VALUES
    14C machine (i386)
    4 number of sections
    4A5BDAAD time date stamp Mon Jul 13 21:09:01 2009

    0 file pointer to symbol table
    0 number of symbols
    E0 size of optional header
    2102 characteristics
    Executable
    32 bit word machine
    DLL

    OPTIONAL HEADER VALUES
    10B magic#
    9.00 linker version
    C4600 size code
    C800 size of initialized data
    0 size of uninitialized data
    510C5 address of entry point
    1000 base code
    ----- new -----
    77550000 imagebase
    1000 section alignment
    200 file alignment
    3 subsystem (Windows CUI)
    6.01 operating system version
    6.01 image version
    6.01 subsystem version
    D4000 size image
    800 size headers
    D5597 checksum
    00040000 size of stack reserve
    00001000 size of stack commit
    00100000 size of heap reserve
    00001000 size of heap commit
    140 DLL characteristics
    dynamic base
    NX compatible
    B4DA8 [A915] address of Export Directory
    BF6C0 [ 1F4] address of Import Directory
    C7000 [ 520] address of Resource Directory
    0 [ 0] address of Exception Directory
    0 [ 0] address of Security Directory
    C8000 [B098] address of Base Relocation Directory
    C5460 [ 38] address of Debug Directory
    0 [ 0] address of Description Directory
    0 [ 0] address of Special Directory
    0 [ 0] address of Thread Storage Directory
    816B8 [ 40] address of Load Configuration Directory
    278 [ 408] address of Bound Import Directory
    1000 [DE8] address of Import Address Table Directory
    0 [ 0] address of Delay Import Directory
    0 [ 0] address of COR20 Header Directory
    0 [ 0] address of Reserved Directory

    SECTION HEADER #1
    .text name
    C44C1 virtual size
    1000 virtual addresses
    C4600 size of raw data
    800 file pointer to raw data

    0 number of relocations
    0 number of line numbers
    60000020 flags
    Code
    (no align specified)
    Execute Read

    Debug Directories(2)
    Type Size Address Pointer
    cv 25 c549c c4c9c Format: RSDS, guid, 2, kernel32.pdb
    (10) 4 c5498 c4c98

    SECTION HEADER #2
    .data name
    FEC virtual size
    C6000 virtual address
    E00 size of raw data
    C4E00 file pointer to raw data
    0 file pointer to relocation table
    0 file pointer to line numbers
    0 number of relocations
    0 number of line numbers
    C0000040 flags
    initialized data
    (no align specified)
    Read Write

    SECTION HEADER #3
    .rsrc name
    520 virtual size
    C7000 virtual address
    600 size of raw data
    C5C00 file pointer to raw data
    0 file pointer to relocation table
    0 file pointer to line numbers
    0 number of relocations
    0 number of line numbers
    40000040 flags
    initialized data
    (no align specified)
    Read Only

    SECTION HEADER #4
    .relocname
    B098 virtual size
    C8000 virtual address
    B200 size of raw data
    C6200 file pointer to raw data
    0 file pointer to relocation table
    0 file pointer to line numbers
    0 number of relocations
    0 number of line numbers
    42000040 flags
    initialized data
    Discardable
    (no align specified)
    Read Only

    Messages and Exceptions

    After attaching to a process, a list of modules is displayed first, and then other messages may appear. For example, when we hook into calc.exe, WinDBG automatically sets a breakpoint (which is just a marker used to stop the application). Breakpoint information is displayed on the screen:

    (da8.b44): Break instruction exception - code 80000003 (first chance)

    This particular message is an exception, namely the first-chance exception. Essentially, an exception is a special condition that occurs during the execution of a program. First-chance exception means that the program stopped immediately after the exception occurred. Second-chance exception means that after the exception occurs, some operations will be performed, and then the program will stop its work.

    Registers

    After displaying messages and exceptions, the debugger outputs the state of the processor registers. Registers are special variables within the processor that store small pieces of information or keep track of the state of something in memory. The processor can process the information in these registers very quickly. This is much faster than getting information on the bus from RAM every time.

    After connecting to calc.exe, WinDBG automatically displays information about the following registers:

    eax=7ffd9000 ebx=00000000 ecx=00000000 edx=776cd23d esi=00000000 edi=00000000
    cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 efl=00000246

    Later, you can duplicate this information again using the r command:

    0:005>r
    eax=7ffd9000 ebx=00000000 ecx=00000000 edx=776cd23d esi=00000000 edi=00000000
    eip=77663540 esp=02affd9c ebp=02affdc8 iopl=0 nv up ei pl zr na pe nc
    cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 efl=00000246
    ntdll!DbgBreakPoint:
    77663540 cc int 3

    If we want to get the value of a particular register, we can execute the following command:

    0:005> r eax
    eax=7ffd9000

    Information can be obtained simultaneously from several registers as follows:

    0:005> r eax,ebp
    eax=7ffd9000 ebp=02affdc8

    Pointer to instruction

    The last command is about running instructions. Here, information is also displayed, as in the case of the r command, of what contains the EIP register. EIP is a register containing the location of the next instruction to be executed by the processor. What WinDBG displays is the equivalent of the u eip L1 command, after which WinDBG goes to the address specified in the EIP register, converts this section to assembly code and displays it on the screen.

    ntdll!DbgBreakPoint:
    77663540 cc int 3

    stay in touch

    In the following articles, we will look at how to use WinDBG in combat: breakpoints, stepping debugging, and memory viewing. Don't switch! J.

    June 22, 2010

    Previously Windbg was available separately to download. But for the latest versions, Microsoft keeps it as part of the Windows SDK. Please find the download links below.

    Windows 10

    The latest version of Windbg for Windows 7 can be downloaded from the link https://developer.microsoft.com/en-us/windows/downloads/windows-10-sdk

    Windows 7

    Download installers from the above links. Note that this does not download the whole SDK, it's just an installer. Once you run the file, you can select which tools you would like to be downloaded. If you are interested only in Windbg, you can exclude everything else and only select ‘Debugging tools’ under ‘Common Utilities’

    The above package installs windbg 6.12 version. If you want to quickly install windbg, you can go for older version(6.11) which can be downloaded from
    the link given at the end of this post.

    Once you do the installation, you can find the program in Start Menu -> All Programs -> Debugging Tools for Windows -> Windbg