C++ 如何使用 WinDbg 分析 VC++ 应用程序的故障转储?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/734272/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to use WinDbg to analyze the crash dump for VC++ application?
回答by John Dibling
Here are some general steps that will get you on your way:
以下是一些可助您顺利进行的一般步骤:
First, you must change your compiler's settings so that it creates PDB files, even for release builds. Later versions of the Visual C++compiler do this by default, but in many versions of Visual C++ you must do this yourself. Create program database files, and then keep an archive of those files along with each build of your application. It is critical that every build of your applications has its own set of PDBs. You can't just reuse the same ones you made with build 10 to examining the dumps generated by build 15, for example. Over the life of your project, you will end up with a ton of PDBs, so be prepared for that.
首先,您必须更改编译器的设置,以便它创建 PDB 文件,即使对于发布版本也是如此。更高版本的Visual C++编译器默认执行此操作,但在许多版本的 Visual C++ 中,您必须自己执行此操作。创建程序数据库文件,然后在每次构建应用程序时保存这些文件的存档。应用程序的每个构建都有自己的一组 PDB,这一点至关重要。例如,您不能仅重用与构建 10 相同的那些来检查构建 15 生成的转储。在项目的整个生命周期中,您最终会得到大量 PDB,因此请为此做好准备。
Next, you need to be able to identify the exact version of your application which generated the dump file. If you are creating your own MiniDumps (by calling MiniDumpWriteDump()for example), probably the easiest way to do this is to simply make part of the filename of the MiniDump the complete version number of your application. You'll need to have a reasonable version numbering scheme in place for this to work. In my shop, we increment the build number across all branches by one every time the autobuilder creates a build.
接下来,您需要能够识别生成转储文件的应用程序的确切版本。如果您正在创建自己的 MiniDump(例如通过调用MiniDumpWriteDump()),可能最简单的方法是简单地将 MiniDump 的文件名的一部分作为应用程序的完整版本号。您需要有一个合理的版本编号方案才能使其工作。在我的商店中,每次自动构建器创建构建时,我们都会将所有分支的构建号加一。
Now that you have received the dump file from the customer, you know the precise version of the application that created the dump, and you have found the PDB files for this build.
现在您已经从客户那里收到转储文件,您知道创建转储的应用程序的准确版本,并且您已经找到了此构建的 PDB 文件。
Now you need to go through your source control's history and find the source code for this exact version of the software. The best way to do this is to apply 'labels' to your branches every time you make a build. Set the value of the label to the exact version number, and it becomes easy to find in the history.
现在,您需要查看源代码管理的历史记录并找到该软件的确切版本的源代码。最好的方法是在每次构建时将“标签”应用于分支。将标签的值设置为确切的版本号,在历史记录中就变得容易了。
You're almost ready to fire up WinDbg/Visual C++:
您几乎已准备好启动 WinDbg/Visual C++:
- Get the complete source tree for that version of your application. Put it in a separate place on your hard drive, say
c:\app_build_1.0.100
for application version 1.0 build #100. - Get the binaries for that exact version of your application and put them somewhere on your hard drive. It might be easiest simply to install that version of your application to get the binaries.
- Put the PDB files in the same location as the binaries in step 2.
- 获取该版本应用程序的完整源代码树。把它放在你硬盘上的一个单独的地方,比如
c:\app_build_1.0.100
应用程序版本 1.0 build #100。 - 获取该应用程序的确切版本的二进制文件,并将它们放在硬盘驱动器上的某个位置。简单地安装该版本的应用程序以获取二进制文件可能是最简单的。
- 将 PDB 文件放在与步骤 2 中的二进制文件相同的位置。
Now you have two options for viewing the dump file. You can use Visual Studioor WinDbg. Using Visual Studio is easier, but WinDbg is much more powerful. Most of the time the functionality in Visual Studio will suffice.
现在您有两种查看转储文件的选项。您可以使用Visual Studio或 WinDbg。使用 Visual Studio 更容易,但 WinDbg 更强大。大多数情况下,Visual Studio 中的功能就足够了。
To use Visual Studio, all you have to do is open the dump file like it is a project. Once opened, "run" the dump file (F5by default) and if all the paths are set correctly it will take you right to the code that crashed, give you a call stack, etc.
要使用 Visual Studio,您所要做的就是像打开项目一样打开转储文件。打开后,“运行”转储文件(F5默认情况下),如果所有路径都设置正确,它会将您带到崩溃的代码,给您一个调用堆栈等。
To use WinDbg, you have to jump through a couple of hoops:
要使用 WinDbg,您必须跳过几个环节:
- Start WinDbg
- Open the dump file. (Ctrl+ Dby default)
- Tell WinDbg to go get the correct MicroSoft symbol files. Type
.symfix
. This may take a few moments as it will pull a ton of stuff down from the Internet. - Tell WinDbg where the symbols (PDB files) are. Type
.sympath+ c:\pdblocation
, substituting wherever you put the PDB files for the pathname. Make sure you get the plus sign in there with no whitespace between.sympath
and the+
sign or else you'll screw up step 3. - Tell WinDbg where the source code is. Type
.srcpath c:\app_build_1.0.100
substituting the path where you got code from source control for this version of the software. - Tell WinDbg to analyze the dump file. Type
!analyze -v
- 启动 WinDbg
- 打开转储文件。( Ctrl+D默认)
- 告诉 WinDbg 去获取正确的 MicroSoft 符号文件。键入
.symfix
。这可能需要一些时间,因为它会从 Internet 上下载大量内容。 - 告诉 WinDbg 符号(PDB 文件)在哪里。键入
.sympath+ c:\pdblocation
,用您放置 PDB 文件的任何位置替换路径名。确保你在那里得到加号,.sympath
并且和+
符号之间没有空格,否则你会搞砸第 3 步。 - 告诉 WinDbg 源代码在哪里。键入
.srcpath c:\app_build_1.0.100
代你得到了从源头控制代码,这个版本的软件的路径。 - 告诉 WinDbg 分析转储文件。类型
!analyze -v
After a few moments, if everything is configured correctly, WinDbg will take you right to the location of your crash. At this point you have a million options for digging deep into your application's memory space, the state of critical sections, windows, etc. But that is waybeyond the scope of this post.
片刻之后,如果一切配置正确,WinDbg 将带您到崩溃的位置。在这一点上你有深挖应用程序的内存空间,关键部分,Windows等的状态万股期权但是,这是方法超出了本文的范围。
Good luck!
祝你好运!
回答by Colin Smith
(see the "Dump" sections below)
(请参阅下面的“转储”部分)
Basic Tutorials and Demonstrations of Using WinDbg
使用WinDbg的基本教程和演示
- Installing and Configuring WinDbg (Windows Debug Tools)
- Mike Taulty - A word for WinDBG
- WinDbg Tutorials
- Windows Debuggers: Part 1: A WinDbg Tutorial
Different Ways to "Start"/Attach WinDBG
“启动”/附加 WinDBG 的不同方式
- Start Debugging with Windbg (includes how to debug an .msi)
- How to debug a Windows service
- Setting up Windows Debugging
Workspaces
工作区
Understanding how Workspaces work...
了解工作区的工作原理...
- Pimp up your debugger: Creating a custom workspace for windbg debugging
- Uncovering How Workspaces Work in WinDbg
Cmdtree
命令树
A "cmdtree" allows you to define a "menu" of debugger commands for easy access to frequently used commands without having to remember the terse command names.
“cmdtree”允许您定义调试器命令的“菜单”,以便轻松访问常用命令,而无需记住简洁的命令名称。
You don't have to put all the command definitions into the same cmdtree text file....you can keep them separate and load multiple ones if you wish (they then get their own window).
您不必将所有命令定义放入同一个 cmdtree 文本文件中……如果您愿意,您可以将它们分开并加载多个(然后它们会获得自己的窗口)。
- Amazing helper .cmdtree
- How do I make a cmdtree window dock at startup in WinDBG
- Making it easier to debug .net dumps in windbg using .cmdtree
- Microshaoft Cmdtree
- Special Command—Execute Commands from a Customized User Interface with .cmdtree
- 惊人的帮手 .cmdtree
- 如何在 WinDBG 中启动时制作 cmdtree 窗口停靠
- 使用 .cmdtree 更轻松地在 windbg 中调试 .net 转储
- Microshaoft命令树
- 特殊命令 - 使用 .cmdtree 从自定义用户界面执行命令
Startup Script
启动脚本
You can use the -c option on the command line to automatically run a WinDBG script when you start WinDBG.
您可以在命令行上使用 -c 选项在启动 WinDBG 时自动运行 WinDBG 脚本。
Gives opportunity to turn on DML (Debugger markup language) mode, load particular extensions, set .NET exception breakpoints, set kernel flags (e.g. when kernel debugging you might need to change the DbgPrint mask so you see tracing information....ed nt!Kd_DEFAULT_Mask 0xffffffff), load cmdtrees, etc.
提供机会打开 DML(调试器标记语言)模式、加载特定扩展、设置 .NET 异常断点、设置内核标志(例如,在内核调试时您可能需要更改 DbgPrint 掩码以便您看到跟踪信息....ed nt !Kd_DEFAULT_Mask 0xffffffff),加载 cmdtrees 等。
An example script:
一个示例脚本:
$$ Include a directory to search for extensions
$$ (point to a source controlled or UNC common directory so that all developers get access)
.extpath+"c:\svn\DevTools\WinDBG\Extensions"
$$ When debugging a driver written with the Windows Driver Framework/KMDF
$$ load this extension that comes from the WinDDK.
!load C:\WinDDK00.16385.1\bin\x86\wdfkd.dll
!wdftmffile C:\WinDDK00.16385.1\tools\tracing\i386\wdf01009.tmf
$$ load some extensions
.load msec.dll
.load byakugan.dll
.load odbgext.dll
.load sosex
.load psscor4
$$ Make commands that support DML (Debugger Markup Language) use it
.prefer_dml 1
.dml_start
$$ Show NTSTATUS codes in hex by default
.enable_long_status 1
$$ Set default extension
.setdll psscor4
$$ Show all loaded extensions
.chain /D
$$ Load some command trees
.cmdtree c:\svn\DevTools\WinDBG\cmdtree\cmdtree1.txt
.cmdtree c:\svn\DevTools\WinDBG\cmdtree\cmdtree2.txt
$$ Show some help for the extensions
!wdfkd.help
!psscor4.help
.help /D
Command Cheat Sheets
命令备忘单
- Crash Dump Analysis Poster v3.0
- SOS Cheat Sheet (.NET 2.0/3.0/3.5)
- WinDbg cheat sheet (Art of Dev)
- WinDbg Kernel-Mode Extension Commands Flashcards
Extensions
扩展
"Extensions" allow you to extend the range of commands/features supported inside WinDBG.
“扩展”允许您扩展 WinDBG 内支持的命令/功能的范围。
- bigLasagne (bldbgexts & blwdbgue)
- assembly syntax highlighting and a driver mapping tool) - BigLib Number Reader
- Byakugan
- detect antidebugging methods, vista heap visualization/emulation, track buffers in memory - Call Flow Analyzer + KnExt
- CmdHist
- records every command you executed in your debug session so you can re-execute easily - Core Analyzer
- check heap structures for corruption, detect objects shared by threads, etc - dom WinDBG Extension
- (!stlpvector, !idt, !unhex, !grep, etc) - dumppe
- dumps PE file from memory - Image Viewer Extension (Vladimir Vuki?evi?)
- Intel UEFI Development Kit Debugger Tool
- debug UEFI firmware - leaktrap
- GDI/USER handle tracker to aid in leak detection - Mona(requires PyKD)
- set of commands to aid in advanced analysis/find exploits - MSEC
- provides automated crash analysis and security risk assessment - narly
- lists info about loaded modules such as if using SafeSEH, ASLR, DEP, /GS (Buffer Security Checks) - netext(Rodney Viana)
- (!wservice - list WCF service objects, !wconfig - show .config lines, !whttp - list HttpContexts, !wselect/!wfrom - support SQL like queries on arrays) - ODbgExt
- open debugger extensions - OllyMigrate
- pass debuggee to another debugger without restarting - Psscor2
- a superset of SOS for assisting in debugging .NET 2.0 managed code - Psscor4
- a superset of SOS for assisting in debugging .NET 4 managed code - PyDBGExt
- allows python scripting to be used - PyKD
- allows Python to be used to script WinDBG - sdbgext (Nynaeve)
-(!valloc, !vallocrwx, !heapalloc, !heapfree, !remotecall, !remotecall64, !loaddll, !unloaddll, !close, !killthread, !adjpriv, !ret) - SieExtPub
-legacy extension...now built into WinDBG in ext.dll - SOSEX
- more commands for helping to debug managed NET 2.0 or 4.0 code - SPT/SDBGExt2 (Steve Niemitz)
- (!DumpHttpContext, !DumpASPNetRequests, !DumpSqlConnectionPools, !DumpThreadPool, etc) - Uniqstack
- source to a debugger extension (need an OSR Online account to access it) - viscope
- code coverage graph - Wait Chain Traversal/wct.dll (Codeplex Debugging Extensions
- display wait chains of application threads (helps find deadlocks) - windbgshark
- integrates Wireshark protocol analyser to enable VM traffic manipulation and analysis - WinDBG Extensions (Sasha Goldstein)
- Tracer, WCT, heap_stat, bkb, traverse_map, traverse_vector) - WinDBG Highlight(ColorWindbg.dll) [Use Google Translate to translate link]
- asm syntax highlighting
- bigLasagne (bldbgexts & blwdbgue)
- 程序集语法高亮和驱动程序映射工具) - BigLib 数字阅读器
- 的Byakugan
-检测反调试方法,远景堆可视化/仿真,轨道缓冲器存储器 - 呼叫流分析器 + KnExt
- CmdHist
- 记录您在调试会话中执行的每个命令,以便您可以轻松地重新执行 - 核心分析器
- 检查堆结构是否损坏,检测线程共享的对象等 - dom WinDBG 扩展
-(!stlpvector、!idt、!unhex、!grep 等) - dumppe
- 从内存中转储 PE 文件 - 图像查看器扩展 (Vladimir Vuki?evi?)
- Intel UEFI Development Kit Debugger Tool
- 调试 UEFI 固件 - 泄漏陷阱
- GDI/USER 句柄跟踪器以帮助进行泄漏检测 - Mona(需要 PyKD)
- 帮助高级分析/查找漏洞的命令集 - MSEC
- 提供自动崩溃分析和安全风险评估 - narly
- 列出有关加载模块的信息,例如是否使用 SafeSEH、ASLR、DEP、/GS(缓冲区安全检查) - netext(Rodney Viana)
- (!wservice - 列出 WCF 服务对象,!wconfig - 显示 .config 行,!whttp - 列出 HttpContexts,!wselect/!wfrom - 支持类似 SQL 的数组查询) - ODbgExt
- 打开调试器扩展 - OllyMigrate
- 将调试对象传递给另一个调试器而无需重新启动 - Psscor2
- 用于协助调试 .NET 2.0 托管代码的 SOS 超集 - Psscor4
- 用于协助调试 .NET 4 托管代码的 SOS 超集 - PyDBGExt
- 允许使用 python 脚本 - PyKD
- 允许使用 Python 编写 WinDBG 脚本 - sdbgext (Nynaeve)
-(!valloc, !vallocrwx, !heapalloc, !heapfree, !remotecall, !remotecall64, !loaddll, !unloaddll, !close, !killthread, !adjpriv, !ret) - SieExtPub
-legacy 扩展...现在内置于 ext.dll 中的 WinDBG - SOSEX
- 帮助调试托管 NET 2.0 或 4.0 代码的更多命令 - SPT/SDBGExt2 (Steve Niemitz)
- (!DumpHttpContext, !DumpASPNetRequests, !DumpSqlConnectionPools, !DumpThreadPool, etc) - Uniqstack
- 调试器扩展的源代码(需要一个 OSR Online 帐户才能访问它) - viscope
- 代码覆盖率图 - Wait Chain Traversal/wct.dll(Codeplex Debugging Extensions
- 显示应用程序线程的等待链(帮助发现死锁) - windbgshark
- 集成 Wireshark 协议分析器以启用 VM 流量操作和分析 - WinDBG 扩展 (Sasha Goldstein)
- Tracer、WCT、heap_stat、bkb、traverse_map、traverse_vector) - WinDBG Highlight(ColorWindbg.dll) [使用谷歌翻译翻译链接]
- asm 语法高亮
Write your own extension
编写自己的扩展
- Tools of the Trade: Part IV - Developing WinDbg Extension DLLs
- The Basics of Debugger Extensions: Short Term Effort, Long Term Gain
Using WinDBG to Debug Managed Code
使用 WinDBG 调试托管代码
- Breaking on an Exception
- Breaking on specific CLR Exception
- Debugging .Net framework source code within Windbg
- Debugging exceptions in managed code using Windbg
- Debugging managed code using WinDbg and SOS.dll
- Debugging with WinDbg. Deadlocks in Applications.
- MANAGED DEBUGGING with WINDBG. Introduction and Index
- Setting .NET breakpoints in Windbg for applications that crash on startup
- 打破异常
- 打破特定的 CLR 异常
- 在 Windbg 中调试 .Net 框架源代码
- 使用 Windbg 调试托管代码中的异常
- 使用 WinDbg 和 SOS.dll 调试托管代码
- 使用 WinDbg 进行调试。应用程序中的死锁。
- 使用 WINDBG 管理调试。介绍与索引
- 在 Windbg 中为启动时崩溃的应用程序设置 .NET 断点
Scripting (C#, PS, Python, WinDBG)
脚本(C#、PS、Python、WinDBG)
- KDAR (Kernel Debugger Anti Rootkit)
- a collection of WinDBG scripts - Sysnative BSOD Scripts/Processing Apps
- WinDBG Script library
- a collection of WinDBG scripts - Scripting MDbg and DbgHostLib
- allows managed code to script the Managed Debugger (MDBG) and the DbgEng - ExtCS
- allows control of WinDBG via C# scripts - PowerDBG
- allows control of WinDBG via Powershell scripts - Pykd
- allows control of WinDBG via Python scripts - windbglib
- python wrapper library around the pykd extension for WinDBG, mimicking immlib (so you can use scripts originally written for Immunity Debugger)
- KDAR (Kernel Debugger Anti Rootkit)
- WinDBG 脚本的集合 - Sysnative BSOD 脚本/处理应用程序
- WinDBG 脚本库
- WinDBG 脚本的集合 - 编写 MDbg 和 DbgHostLib 脚本
- 允许托管代码为托管调试器 (MDBG) 和 DbgEng 编写脚本 - ExtCS
- 允许通过 C# 脚本控制 WinDBG - PowerDBG
- 允许通过 Powershell 脚本控制 WinDBG - Pykd
- 允许通过 Python 脚本控制 WinDBG - windbglib
- 围绕 WinDBG pykd 扩展的 python 包装库,模仿 immlib(因此您可以使用最初为 Immunity Debugger 编写的脚本)
Debuggers/Tools that use the dbgeng.dll API/WinDBG Tools
使用 dbgen.dll API/WinDBG 工具的调试器/工具
- A Simple Dbgeng Based User Mode Debugger
- Acorns.Debugging NET Deadlock Detector(uses cdb.exe) (download)
- CLR Managed Debugger(MDBG)
- DbgHost - How to control a debugging engine
- Debug Diagnostic Tool v1.2(DebugDiag), Ver 2.0+ DebugDiag Blog
- Dynamorio- dynamic binary instrumentation tool which can interact with WinDBG
- IDA+ WinDBG plugin
- GUI WinDBG
- LeakShell(find managed leaks)
- mdbglib - Managed Debug API
- PyDbgEng
- python wrapper for Windows Debugging Engine - SOSNET- a WinDBG Fork/alternative shell that concentrates on using the SOS extension and supports C# scripting
- SOSNET O2 fork- fork of SOSNET that uses Rosyln for the C# REPL (read-eval-print-loop) scripting engine
- VDB/Vivisect(kenshoto) - provides a cross-platform debugging API layered on WinDBG
- WinAppDbg+ Heappie-WinAppDbg
- Writing a basic Windows debugger
- 一个简单的基于 Dbgen 的用户模式调试器
- Acorns.Debugging NET 死锁检测器(使用 cdb.exe)(下载)
- CLR 托管调试器(MDBG)
- DbgHost - 如何控制调试引擎
- 调试诊断工具 v1.2(DebugDiag), Ver 2.0+ DebugDiag 博客
- Dynamorio- 可以与 WinDBG 交互的动态二进制检测工具
- IDA+ WinDBG 插件
- 图形用户界面
- LeakShell(查找管理泄漏)
- mdbglib - 托管调试 API
- PyDbgEng
- Windows 调试引擎的 python 包装器 - SOSNET- 专注于使用 SOS 扩展并支持 C# 脚本的 WinDBG Fork/替代 shell
- SOSNET O2 fork- SOSNET 的 fork,它使用 Rosyln 作为 C# REPL (read-eval-print-loop) 脚本引擎
- VDB/Vivisect(kenshoto) - 在 WinDBG 上提供跨平台调试 API
- WinAppDbg+ Heappie-WinAppDbg
- 编写一个基本的 Windows 调试器
Different Ways to Generate Crash Dump Files for Post-Mortem Analysis
为事后分析生成故障转储文件的不同方法
- DebugDiag 2.0
- Dump Cheat Sheet
- includes how to generate dump from Hyper-V, VMWare ESX, and XenServer VMs. - Citrix SystemDump
- Keyboard Keypress Combination
- MiniDumpWriteDump
- (via WIN32 API call inside your application). (Example for C# applications) - NMI Switch, or (here)
(hardware based feature to generate an NMI...usually found on high-end servers e.g. HPor you can obtain an add-in PCI card "Universal PCI Dump Switch"). Microsoft NMI technology background. - Procdump
- System|Advanced System Settings|Startup and Recovery
(registry info),
(how to configure a Complete (Full) Memory Dump),
(how to enable Complete Memory Dump),
(how to enable Complete Memory Dump on Windows 7 when PC has lots of memory...normally not available when more than 2GB of memory) - Task Manager "Create Dump File"
- UserDump, instructions(very old tool)
- UserModeProcessDumper, instructions
- Visual Studio "Save Dump As…"
- WER (Windows Error Reporting....local dumps)
- WinDBG
- 调试诊断 2.0
- Dump Cheat Sheet
- 包括如何从 Hyper-V、VMWare ESX 和 XenServer VM 生成转储。 - 思杰系统转储
- 键盘按键组合
- MiniDumpWriteDump
-(通过应用程序内的 WIN32 API 调用)。(C# 应用程序示例) - NMI 开关,或(此处)
(生成 NMI 的基于硬件的功能......通常在高端服务器上找到,例如HP或者您可以获得附加 PCI 卡“通用 PCI 转储开关”)。微软 NMI 技术背景。 - 转储
- 系统|高级系统设置|启动和恢复
(注册表信息),
(如何配置完整(完整)内存转储),
(如何启用完整内存转储),
(当PC有很多时,如何在Windows 7上启用完整内存转储内存...当内存超过 2GB 时通常不可用) - 任务管理器“创建转储文件”
- UserDump,说明(非常老的工具)
- UserModeProcessDumper,说明
- Visual Studio“将转储另存为...”
- WER(Windows 错误报告....本地转储)
- 数据库
Dump Analysis Tools
转储分析工具
- BlueScreenView- finds the minidump .dmp files saved by Windows after a BSOD, and extracts information about what caused the crash
- Debug.Analyzer(can analyse dump files and plug-ins can be written in .NET)
- SAD - Simple After Dump(postmortem analyzer)
- Volatility- framework for analyzing "memory" recorded in dump files (cheat sheet)
- BlueScreenView- 查找 BSOD 后 Windows 保存的 minidump .dmp 文件,并提取有关导致崩溃的原因的信息
- Debug.Analyzer(可以分析转储文件,插件可以用.NET编写)
- SAD - 转储后简单(事后分析器)
- 波动性- 用于分析转储文件中记录的“内存”的框架(备忘单)
Dump related Tools
转储相关工具
- Citrix dumpcheck - checks consistency of dump file (looks like it's been abandoned link+ link)
- dumpchk(part of Debugging Tools) - checks consistency of a Dump file
- MoonSols Windows Memory Toolkit(formerly windd) - converts various raw memory dump files into WinDBG compatible dmp files
- vm2dmp- Microsoft Hyper-V VM State to Memory Dump Converter
- vmss2core- converts VMWare snapshot file into a core dump file (download), (instructions)
- Citrix dumpcheck - 检查转储文件的一致性(看起来它已被放弃link+ link)
- dumpchk(调试工具的一部分) - 检查转储文件的一致性
- MoonSols Windows Memory Toolkit(以前称为windd) - 将各种原始内存转储文件转换为与 WinDBG 兼容的 dmp 文件
- vm2dmp- Microsoft Hyper-V VM 状态到内存转储转换器
- vmss2core- 将 VMWare 快照文件转换为核心转储文件(下载),(说明)
Kernel Debugging Virtual Machines
内核调试虚拟机
- VMKD- Virtual Machine KD Extensions
- VirtualKD- (kernel debugger support for OS's hosted in VMWare/VirtualBox)
Videos
视频
- .NET Cracking 101 #2 - WinDbg basics
- .NET Debugging for the Production Environment (Channel9)
- dotnetConf - Advanced Debugging with WinDbg and SOS
- David Truxall "Debugging with WinDBG"
- Mike Taulty Debugging Memory Leaks
- oredev 2009 Session: Debugging .NET Applications with WinDbg
- Pluralsight Advanced Windows Debugging
(plus various other ones at Pluralsight) - Tess Ferrandez WinDBG (Channel9)
- .NET 破解 101 #2 - WinDbg 基础知识
- 生产环境的 .NET 调试(Channel9)
- dotnetConf - 使用 WinDbg 和 SOS 进行高级调试
- David Truxall“使用 WinDBG 调试”
- Mike Taulty 调试内存泄漏
- oredev 2009 会议:使用 WinDbg 调试 .NET 应用程序
- Pluralsight 高级 Windows 调试
(以及 Pluralsight 的其他各种调试) - Tess Ferrandez WinDBG (Channel9)
Blogs
博客
Some blogs (mixture of native and managed code debugging).
一些博客(本机和托管代码调试的混合)。
- Advanced .NET Debugging
- All Your Base Are Belong To Us(Sasha Goldshtein)
- Analyze-v
- ASP.NET Debugging
- Cyberiafreak(threading and advanced windows prog and debugging)
- Debug Analyzer.NET
- Debug and Beyond
- Debugging Experts Magazine Online
- Debugging Toolbox(Windbg scripts, debugging and troubleshooting tools and techniques to help you isolate software problems.)
- Decrypt my World
- greggm's WebLog
- Junfeng Zhang's Windows Programming Notes
- Kristoffer's tidbits
- Mark Russinovich's Blog
- Mike Stalls .NET Debugging Blog
- Naveen's Blog
- Never Doubt Thy Debugger (Carlo)
- Notes from a Dark Corner
- Ntdebugging Blog(Microsoft Global Escalation Services team)
- Nynaeve. Adventures in Windows debugging and reverse engineering
- PFE Developer Notes for the Field
- Visual Studio Debugger Team
- WinDbg by Volker von Einem
- 高级 .NET 调试
- 你所有的基地都属于我们(Sasha Goldshtein)
- 分析-v
- ASP.NET 调试
- Cyberiafreak(线程和高级 Windows 编程和调试)
- 调试分析器.NET
- 调试和超越
- 调试专家杂志在线
- 调试工具箱(Windbg 脚本、调试和故障排除工具和技术,可帮助您隔离软件问题。)
- 解密我的世界
- greggm 的网络日志
- 张俊峰的Windows编程笔记
- 克里斯托弗的花絮
- 马克·鲁西诺维奇的博客
- Mike Stalls .NET 调试博客
- 纳文的博客
- 永远不要怀疑你的调试器 (Carlo)
- 来自黑暗角落的笔记
- Ntdebugging 博客(Microsoft 全球升级服务团队)
- 尼娜芙。Windows 调试和逆向工程的冒险
- 现场 PFE 开发人员说明
- Visual Studio 调试器团队
- 沃尔克·冯·艾因 (Volker von Einem) 的 WinDbg
Advanced Articles and Tutorial Resources
高级文章和教程资源
- Advanced Debugging Techniques in WinDbg
- Debugging Applications for MS.Net and Windows (Powerpoint Slides)
- Debugging STL Containers with WinDbg
- Debug Tutorials 1-7 (CodeProject-Toby Opferman)
- Debugging.tv
- Developmentor WinDBG Tagged articles
- Dr Fu's Security Blog - Malware Analysis Tutorials - Reverse Engineering Approach
- Exploit writing tutorial part 5 : How debugger modules & plugins can speed up basic exploit development
- Hunting Rootkits
- Remote Microsoft Windows Server OS Kernel Debugging Using Dell Windows Debugger Utility (DWDU)(DELL(TM) Windows(R) Debugger Utility 1.1 README)
- WinDbg 中的高级调试技术
- 调试 MS.Net 和 Windows 应用程序(Powerpoint 幻灯片)
- 使用 WinDbg 调试 STL 容器
- 调试教程 1-7(CodeProject-Toby Opferman)
- 调试.tv
- 开发者或 WinDBG 标记文章
- 傅博士的安全博客 - 恶意软件分析教程 - 逆向工程方法
- 漏洞利用编写教程第 5 部分:调试器模块和插件如何加速基本漏洞利用开发
- 狩猎Rootkit
- 使用 Dell Windows Debugger Utility (DWDU) 进行远程 Microsoft Windows Server OS 内核调试(DELL(TM) Windows(R) Debugger Utility 1.1 README)
Alternative Debuggers
替代调试器
- Bokken- (Inguma) (GUI for radare)
- BugDbg
- Debug++(not released yet)
- Debuggy
- Discoloured Ring 0 Debugger(download)
- edb(Linux)
- FDBG
- GoBug
- Hades (Ring 3 debugger with anti debugger detection strategy)
- Hopper(Linux, OSX and Windows) (Windows debugging not currently implemented)
- Hyperdbg
- IDA Debugger
- ImmunityDebugger
- Nanomite
- Obsidian (non-intrusive debugger)
- OllyDBG
- PEBrowse
- RaceVB6(VB6 P-Code debugger)
- radare
- radare2ui(GUI for radare)
- Rasta Ring 0 Debugger(RR0D)
- Syser Kernel Debugger
- TRW 2000(very old debugger circa W9x) + dions plugin archive
- VisualDux Debugger
- Wintruder(extendable debugger)
- WKTVDebugger(a debugger for Visual Basic P-Code) (download)
- x64_dbg
- Zeta Debugger
- Bokken- (Inguma)(雷达图形用户界面)
- 错误数据库
- 调试++(尚未发布)
- 调试
- 变色环 0 调试器(下载)
- edb(Linux)
- FDBG
- 错误
- Hades (Ring 3 debugger with anti debugger detection strategy)
- Hopper(Linux、OSX 和 Windows)(当前未实现 Windows 调试)
- 超级数据库
- IDA 调试器
- 免疫调试器
- 纳米粒
- Obsidian(非侵入式调试器)
- 奥莉DBG
- PE浏览
- RaceVB6(VB6 P代码调试器)
- 雷达
- radare2ui(radare 的GUI)
- Rasta Ring 0 调试器(RR0D)
- 系统内核调试器
- TRW 2000(大约 W9x 的非常老的调试器)+ dions 插件存档
- VisualDux 调试器
- Wintruder(可扩展调试器)
- WKTVDebugger(Visual Basic P-Code 的调试器)(下载)
- x64_dbg
- Zeta 调试器
Other Links
其他链接
- Collaborative RCE Tool Library
- huge collection of debugger and system level tools - cr4zyserb
- huge collection of plugins and other debugging tools - How to Write a Windows Debugger References (Devon Straw)
- large collection of links giving you detailed information that you would need if you wanted to write your own debugger e.g. PDB file format, .DMP file formats, PE File structure, how to record stack traces, etc, etc. - Tuts4You
- unpackers, IDA, OllyDBG, Immunity Debugger plugins, etc.
- 协作 RCE 工具库
- 大量调试器和系统级工具 - cr4zyserb
- 大量插件和其他调试工具 - 如何编写 Windows 调试器参考 (Devon Straw)
- 大量链接为您提供详细信息,如果您想编写自己的调试器,例如 PDB 文件格式、.DMP 文件格式、PE 文件结构、如何记录堆栈痕迹等。 - Tuts4You
- 解包器、IDA、OllyDBG、Immunity Debugger 插件等。
回答by LanceSc
This is a really broad question.
这是一个非常广泛的问题。
- The first step is to load the dump file into a WinDbg instance.
- Next, you need to make sure you have a symbols setup.
- Finally, you can run the command
!analyze -v
to get a basic analysis performed on it. You need to have symbol information available for your code to make dump files worthwhile.
- 第一步是将转储文件加载到 WinDbg 实例中。
- 接下来,您需要确保您有一个符号设置。
- 最后,您可以运行该命令
!analyze -v
以对其执行基本分析。您需要为代码提供可用的符号信息,以使转储文件有价值。
The website Memory Dump, Software Trace, Debugging, Malware, Victimware and Intelligence Analysis Portalhas been very informative for me. I also really enjoyed the book, Advanced Windows Debuggingby Mario Hewardt and Daniel Pravat.
网站内存转储、软件跟踪、调试、恶意软件、受害者软件和情报分析门户对我来说非常有用。我也很喜欢这本书,Mario Hewardt 和 Daniel Pravat所著的Advanced Windows Debugging。
回答by womp
Tess Ferrandez has a great set of basic tutorials and labsto get started with Windbg. I highly recommend them.
Tess Ferrandez 有一套很棒的基础教程和实验室,可以帮助您开始使用 Windbg。我强烈推荐他们。