{"componentChunkName":"component---src-templates-post-template-js","path":"/magical-windbg-vol1-04-en","result":{"data":{"markdownRemark":{"id":"ec69b170-ca84-59e4-b262-a036cd1436c9","html":"<blockquote>\n<p>This page has been machine-translated from the <a href=\"/magical-windbg-vol1-04\">original page</a>.</p>\n</blockquote>\n<p>In this chapter, we will analyze a simple application crash dump with WinDbg.</p>\n<!-- omit in toc -->\n<h2 id=\"table-of-contents\" style=\"position:relative;\"><a href=\"#table-of-contents\" aria-label=\"table of contents permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Table of contents</h2>\n<ul>\n<li><a href=\"#creating-an-application-crash-dump-for-analysis\">Creating an application crash dump for analysis</a></li>\n<li><a href=\"#loading-the-application-crash-dump-in-windbg\">Loading the application crash dump in WinDbg</a></li>\n<li><a href=\"#analyzing-the-crash-dump-with-the-analyze-extension\">Analyzing the crash dump with the !analyze extension</a></li>\n<li><a href=\"#reading-the-instructions-around-the-crash\">Reading the instructions around the crash</a></li>\n<li><a href=\"#appendix-analyzing-the-binary-with-ghidra\">Appendix: Analyzing the binary with Ghidra</a></li>\n<li><a href=\"#summary-of-chapter-4\">Summary of Chapter 4</a></li>\n<li><a href=\"#links-to-each-chapter\">Links to each chapter</a></li>\n</ul>\n<h2 id=\"creating-an-application-crash-dump-for-analysis\" style=\"position:relative;\"><a href=\"#creating-an-application-crash-dump-for-analysis\" aria-label=\"creating an application crash dump for analysis permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Creating an application crash dump for analysis</h2>\n<p>First, create an application crash dump for analysis.</p>\n<p>Launch <code class=\"language-text\">D4C.exe</code>, which you downloaded in Chapter 1, select menu item 1, and press Enter. <code class=\"language-text\">D4C.exe</code> will crash and a user-mode crash dump will be generated.</p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 500px; \"\n    >\n      <a\n    class=\"gatsby-resp-image-link\"\n    href=\"/static/c58f6d77ace8f688147832a7dc606615/0b533/app-crash-001.png\"\n    style=\"display: block\"\n    target=\"_blank\"\n    rel=\"noopener\"\n  >\n    <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 52.083333333333336%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAKCAYAAAC0VX7mAAAACXBIWXMAAA7EAAAOxAGVKw4bAAABE0lEQVQoz52Sy07DMBBFraKWxOPEJMSOSolInMcCpBZWbPgFXmtEoXueaz7+4rhFBCnQ0sWRvfCcuWObNSdTNKVBVZaoq9KtJs9hihyTgzFUkkCpv0nTFFHIcTt/BpsUtS0uUBTGUdcNjDHIsgxCCPi+vxZOAgPGcHn3BKYPj1wKbbtoraGVQhzHkFI64SaEocRoh+H6/gWM7+2Dt104WbiDiBxfBd19H0EQYjhguJq/gok4gSD+6+F1MicMV8LHNzCKrLBN1SneRNIrXLz/FIot+Ra2CWNlR7Z3JoJlyn+yFMpOQhlBeCMI39sO7iEQhKH9NjcL+yh0fA6qpqD6tJ+qywxUdjCWYgZhzrA7bnDx8IFPSXv1Y15jct8AAAAASUVORK5CYII='); background-size: cover; display: block;\"\n  ></span>\n  <picture>\n          <source\n              srcset=\"/static/c58f6d77ace8f688147832a7dc606615/8ac56/app-crash-001.webp 240w,\n/static/c58f6d77ace8f688147832a7dc606615/d3be9/app-crash-001.webp 480w,\n/static/c58f6d77ace8f688147832a7dc606615/b0a15/app-crash-001.webp 500w\"\n              sizes=\"(max-width: 500px) 100vw, 500px\"\n              type=\"image/webp\"\n            />\n          <source\n            srcset=\"/static/c58f6d77ace8f688147832a7dc606615/8ff5a/app-crash-001.png 240w,\n/static/c58f6d77ace8f688147832a7dc606615/e85cb/app-crash-001.png 480w,\n/static/c58f6d77ace8f688147832a7dc606615/0b533/app-crash-001.png 500w\"\n            sizes=\"(max-width: 500px) 100vw, 500px\"\n            type=\"image/png\"\n          />\n          <img\n            class=\"gatsby-resp-image-image\"\n            src=\"/static/c58f6d77ace8f688147832a7dc606615/0b533/app-crash-001.png\"\n            alt=\"Creating an application crash with D4C.exe\"\n            title=\"Creating an application crash with D4C.exe\"\n            loading=\"lazy\"\n            style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n          />\n        </picture>\n  </a>\n    </span></p>\n<p>On modern operating systems such as Windows 10, when a user-mode application crashes, the WER service starts and creates a crash report, and in that process a user-mode crash dump of the application is generated.<sup id=\"fnref-1\"><a href=\"#fn-1\" class=\"footnote-ref\">1</a></sup></p>\n<p>By default, the generated user-mode crash dump is saved in <code class=\"language-text\">C:\\Users\\&lt;user name>\\AppData\\Local\\CrashDumps</code>.</p>\n<p>Also, by default, the type of dump file generated when an application crashes is a minidump.</p>\n<p>A minidump captures the crashing thread’s register and stack information, together with the memory pages referenced by those registers, at the point when the application crash occurred.<sup id=\"fnref-2\"><a href=\"#fn-2\" class=\"footnote-ref\">2</a></sup></p>\n<p>The minimum information needed to investigate a crash can be checked even from a minidump, but if you want to perform more detailed troubleshooting, it is preferable to obtain a full dump that captures all user-mode memory regions of the target process.\n(However, as described in Chapter 1, depending on the specified options, a process minidump can sometimes contain more information than a full dump.)</p>\n<p>To change the type of dump generated when an application crash occurs, change the DWORD value <code class=\"language-text\">DumpType</code> under the registry key <code class=\"language-text\">HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\Windows Error Reporting\\LocalDumps</code> to <code class=\"language-text\">2</code>.</p>\n<p>If your environment has already been configured with <code class=\"language-text\">D4C.exe</code> to collect full memory dumps, the type of application crash dump generated has already been changed to full dump, so a full dump will also be generated when <code class=\"language-text\">D4C.exe</code> crashes.</p>\n<br>\n<p>Collecting user-mode dumps:</p>\n<p><a href=\"https://learn.microsoft.com/ja-jp/windows/win32/wer/collecting-user-mode-dumps\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">https://learn.microsoft.com/ja-jp/windows/win32/wer/collecting-user-mode-dumps</a></p>\n<br>\n<h2 id=\"loading-the-application-crash-dump-in-windbg\" style=\"position:relative;\"><a href=\"#loading-the-application-crash-dump-in-windbg\" aria-label=\"loading the application crash dump in windbg permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Loading the application crash dump in WinDbg</h2>\n<p>The application crash dump generated when <code class=\"language-text\">D4C.exe</code> crashes is saved by default in <code class=\"language-text\">C:\\Users\\&lt;user name>\\AppData\\Local\\CrashDumps</code>.</p>\n<p>To analyze it, start the 64-bit version of WinDbg as administrator, press the [Ctrl + D] shortcut key, and load the dump file collected from that folder.</p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 500px; \"\n    >\n      <a\n    class=\"gatsby-resp-image-link\"\n    href=\"/static/32016a8a77a453089befebfe67715d64/0b533/app-crash-002.png\"\n    style=\"display: block\"\n    target=\"_blank\"\n    rel=\"noopener\"\n  >\n    <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 60%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAMCAYAAABiDJ37AAAACXBIWXMAAA7EAAAOxAGVKw4bAAABq0lEQVQoz41Ti26jMBDk/3+p9wNVKy6EkEDC8QwQsHmERyEEMrd2RdSLempGGhnj2dldvChvqoZ3dQ11ZUDfWtA2JnZ7F7uDi8MfD3uiYR6w3tnQTUdyY7lyNUi3cLP3sKZY5U39DWNnITgmcLwAfhDBC460jxFGCU4po31ESRzYboCD41MSn55DnFiJvGrBqwZl/UHxIZSNrsPcGuAsQ845OGdomwZD3+N6vUKgH0a4joMi56RhSNOT1DVNjes4Ypo+dee6hvLrVcfLqwHVThGfMlRViZoO2raVFKjbDpqmwbZteJ6HjDEZPM8zbrcbJloF8qKEstJ0bE0LPC+QZRnKsqTMDbqukxTo+kGa+b6PKKbqikomu1wusgthKlBIw5UGy7JQFgUYZRbV9dTuMAySooq26yl4xCOE0cK7oe1FcMMEfpwhSBiCmCFMOPFzjenDO0FyN3w0Wd7dDadpxk+QFY7/Gv63wkfhIxfD8Qnd04ZN9/Ftywvnr7c8TdOPLYtbfkZXVhWUoqzQ0AjUNCrfUYxHxnL5x1TnmoLOdzKe0xlHmjFZXRAe8Rdh8ZUTX5wcugAAAABJRU5ErkJggg=='); background-size: cover; display: block;\"\n  ></span>\n  <picture>\n          <source\n              srcset=\"/static/32016a8a77a453089befebfe67715d64/8ac56/app-crash-002.webp 240w,\n/static/32016a8a77a453089befebfe67715d64/d3be9/app-crash-002.webp 480w,\n/static/32016a8a77a453089befebfe67715d64/b0a15/app-crash-002.webp 500w\"\n              sizes=\"(max-width: 500px) 100vw, 500px\"\n              type=\"image/webp\"\n            />\n          <source\n            srcset=\"/static/32016a8a77a453089befebfe67715d64/8ff5a/app-crash-002.png 240w,\n/static/32016a8a77a453089befebfe67715d64/e85cb/app-crash-002.png 480w,\n/static/32016a8a77a453089befebfe67715d64/0b533/app-crash-002.png 500w\"\n            sizes=\"(max-width: 500px) 100vw, 500px\"\n            type=\"image/png\"\n          />\n          <img\n            class=\"gatsby-resp-image-image\"\n            src=\"/static/32016a8a77a453089befebfe67715d64/0b533/app-crash-002.png\"\n            alt=\"Loading a user-mode full dump in WinDbg\"\n            title=\"Loading a user-mode full dump in WinDbg\"\n            loading=\"lazy\"\n            style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n          />\n        </picture>\n  </a>\n    </span></p>\n<p>In the Command window immediately after WinDbg starts, information labeled <code class=\"language-text\">Path validation summary</code> is displayed.</p>\n<p><code class=\"language-text\">Path validation summary</code> contains useful information for analysis, so let’s look at a few items.</p>\n<p>First, in the first part below, you can see the current <code class=\"language-text\">.sympath</code> information and the OS version.</p>\n<div class=\"gatsby-highlight\" data-language=\"text\"><pre class=\"language-text\"><code class=\"language-text\">Response                         Time (ms)     Location\nDeferred                                       srv*https://msdl.microsoft.com/download/symbols\nSymbol search path is: srv*https://msdl.microsoft.com/download/symbols\nExecutable search path is: \nWindows 10 Version 19045 MP (8 procs) Free x64\nProduct: WinNt, suite: SingleUserTS\nEdition build lab: 19041.1.amd64fre.vb_release.191206-1406</code></pre></div>\n<p>Next, in the lines below, <code class=\"language-text\">Debug session time</code> shows when the process crash occurred, while <code class=\"language-text\">System Uptime</code> and <code class=\"language-text\">Process Uptime</code> show the system uptime and process uptime before the application crashed, respectively.</p>\n<div class=\"gatsby-highlight\" data-language=\"text\"><pre class=\"language-text\"><code class=\"language-text\">Debug session time: Wed Sep 13 20:36:00.000 2023 (UTC + 9:00)\nSystem Uptime: 1 days 20:35:58.000\nProcess Uptime: 0 days 0:00:56.000</code></pre></div>\n<p>The following lines also show the exception code that directly caused the application crash.</p>\n<div class=\"gatsby-highlight\" data-language=\"text\"><pre class=\"language-text\"><code class=\"language-text\">This dump file has an exception of interest stored in it.\nThe stored exception information can be accessed via .ecxr.\n(2f10.598): Access violation - code c0000005 (first/second chance not available)\nFor analysis of this file, run !analyze -v\nntdll!NtWaitForMultipleObjects+0x14:\n00007fff`35fcd9a4 c3              ret</code></pre></div>\n<p>From the information <code class=\"language-text\">Access violation - code c0000005 (first/second chance not available)</code> shown here, we can easily determine that the direct cause of the application crash was an access violation.</p>\n<br>\n<p>Access violation C0000005:</p>\n<p><a href=\"https://learn.microsoft.com/ja-jp/shows/inside/c0000005\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">https://learn.microsoft.com/ja-jp/shows/inside/c0000005</a></p>\n<br>\n<p>From here, we will identify the specific processing where the problem occurred.</p>\n<h2 id=\"analyzing-the-crash-dump-with-the-analyze-extension\" style=\"position:relative;\"><a href=\"#analyzing-the-crash-dump-with-the-analyze-extension\" aria-label=\"analyzing the crash dump with the analyze extension permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Analyzing the crash dump with the !analyze extension</h2>\n<p>One of the commands I use most often when analyzing crash dumps in WinDbg is <code class=\"language-text\">!analyze -v</code>.</p>\n<p>This command uses the <code class=\"language-text\">!analyze</code> extension to display detailed information about the exception captured in the crash dump.</p>\n<br>\n<p>!analyze (WinDbg):</p>\n<p><a href=\"https://learn.microsoft.com/ja-jp/windows-hardware/drivers/debugger/-analyze\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">https://learn.microsoft.com/ja-jp/windows-hardware/drivers/debugger/-analyze</a></p>\n<br>\n<p>Commands beginning with an exclamation mark (<code class=\"language-text\">!</code>) usually mean commands that call debugger extensions.</p>\n<p>Debugger extensions can be used by loading DLLs prepared as modules separate from the debugger itself into WinDbg.</p>\n<p>WinDbg has several extensions loaded by default, and users can also create their own extensions and load them into the debugger.</p>\n<p>You can retrieve a list of the extensions currently loaded in WinDbg with the <code class=\"language-text\">.chain</code> command.</p>\n<p>When I actually run <code class=\"language-text\">.chain</code> in my environment, I get the following result.</p>\n<div class=\"gatsby-highlight\" data-language=\"text\"><pre class=\"language-text\"><code class=\"language-text\">Extension DLL chain:\n\next: image 10.0.22621.1778, API 1.0.0, \n  [path: C:\\Program Files (x86)\\Windows Kits\\10\\Debuggers\\x64\\winext\\ext.dll]\n\nELFBinComposition: image 10.0.22621.1778, API 0.0.0, \n  [path: C:\\Program Files (x86)\\Windows Kits\\10\\Debuggers\\x64\\winext\\ELFBinComposition.dll]\n\ndbghelp: image 10.0.22621.1778, API 10.0.6, \n  [path: C:\\Program Files (x86)\\Windows Kits\\10\\Debuggers\\x64\\dbghelp.dll]\n\nexts: image 10.0.22621.1778, API 1.0.0, \n  [path: C:\\Program Files (x86)\\Windows Kits\\10\\Debuggers\\x64\\WINXP\\exts.dll]\n\nuext: image 10.0.22621.1778, API 1.0.0, \n  [path: C:\\Program Files (x86)\\Windows Kits\\10\\Debuggers\\x64\\winext\\uext.dll]\n\nntsdexts: image 10.0.22621.1778, API 1.0.0, \n  [path: C:\\Program Files (x86)\\Windows Kits\\10\\Debuggers\\x64\\WINXP\\ntsdexts.dll]</code></pre></div>\n<p>However, if you look at this list, you can see that there is no extension named <code class=\"language-text\">analyze</code>.</p>\n<p>This is because, strictly speaking, the <code class=\"language-text\">!analyze</code> extension is one of the features included in the <code class=\"language-text\">ext</code> extension that WinDbg loads by default.</p>\n<p>In WinDbg, you can call an extension module by executing either <code class=\"language-text\">!&lt;alias of extension module></code> or <code class=\"language-text\">!&lt;extension name>.&lt;module name of extension module></code>.</p>\n<p>In other words, executing <code class=\"language-text\">!ext.analyze</code> gives the same output as executing <code class=\"language-text\">!analyze</code>.</p>\n<p>As an aside, you can list the modules included in the <code class=\"language-text\">ext</code> extension with <code class=\"language-text\">!help</code> or <code class=\"language-text\">!ext.help</code>.</p>\n<p>As shown below, you can confirm that, besides <code class=\"language-text\">analyze</code>, it also includes frequently used entries such as <code class=\"language-text\">address</code>.</p>\n<div class=\"gatsby-highlight\" data-language=\"text\"><pre class=\"language-text\"><code class=\"language-text\">0:000> !ext.help\nanalyze [-v][level]        - Analyzes current exception or bugcheck (levels are 0..9)\nowner [symbol!module]      - Displays the Owner for current exception or bugcheck\ncomment                    - Displays the Dump's Comment(s)\n\nerror [errorcode]          - Displays Win32 or NTSTATUS error string\ngle [-all]                 - Displays the Last Error &amp; Last Status of the current thread\n\naddress [address]          - Displays the address space layout\n        [-UsageType]       - Displays the address space regions of the given type\n\ncpuid [processor]          - Displays the CPU information for a specific or all CPUs\n\nexchain                    - Displays exception chain for the current thread\n\nfor_each_process &lt;cmd>     - Executes command for each process\nfor_each_thread &lt;cmd>      - Executes command for each thread\nfor_each_frame &lt;cmd>       - Executes command for each frame in the current thread\nfor_each_local &lt;cmd> $$&lt;n> - Executes command for each local variable in the current frame,\n                             substituting the fixed-name alias $u&lt;n> for each occurrence of $$&lt;n>\n\nimggp &lt;imagebase>          - Displays GP directory entry for 64-bit image\nimgreloc &lt;imagebase>       - Relocates modules for an image\n\nstr &lt;address>              - Displays ANSI_STRING or OEM_STRING\nustr &lt;address>             - Displays UNICODE_STRING\n\nlist [-? | parameters]     - Displays lists\n\ncppexr &lt;exraddress>        - Displays a C++ EXCEPTION_RECORD\nobja &lt;address>             - Displays OBJECT_ATTRIBUTES[32|64]\nrtlavl &lt;address>           - Displays RTL_AVL_TABLE\nstd_map &lt;address>          - Displays a std::map&lt;></code></pre></div>\n<p>Now that we have confirmed the extensions, let’s actually run the <code class=\"language-text\">!analyze -v</code> command and analyze the dump file.</p>\n<p>The output of <code class=\"language-text\">!analyze -v</code> is fairly long, so we will review it in parts.</p>\n<p>The first section displays environment information and information about the dump file.</p>\n<div class=\"gatsby-highlight\" data-language=\"text\"><pre class=\"language-text\"><code class=\"language-text\">KEY_VALUES_STRING: 1\n\n  Key  : AV.Dereference\n  Value: NullPtr\n\n  Key  : AV.Fault\n  Value: Write\n\n  Key  : Analysis.CPU.mSec\n  Value: 561\n\n  Key  : Analysis.DebugAnalysisManager\n  Value: Create\n\n  Key  : Analysis.Elapsed.mSec\n  Value: 577\n\n  Key  : Analysis.Init.CPU.mSec\n  Value: 12827\n\n  Key  : Analysis.Init.Elapsed.mSec\n  Value: 85744066\n\n  Key  : Analysis.Memory.CommitPeak.Mb\n  Value: 84\n\n  Key  : Timeline.OS.Boot.DeltaSec\n  Value: 44\n\n  Key  : Timeline.Process.Start.DeltaSec\n  Value: 7\n\n  Key  : WER.OS.Branch\n  Value: vb_release\n\n  Key  : WER.OS.Timestamp\n  Value: 2019-12-06T14:06:00Z\n\n  Key  : WER.OS.Version\n  Value: 10.0.19041.1\n\nFILE_IN_CAB:  D4C.exe.9608.dmp\n\nNTGLOBALFLAG:  0\n\nPROCESS_BAM_CURRENT_THROTTLED: 0\n\nPROCESS_BAM_PREVIOUS_THROTTLED: 0\n\nAPPLICATION_VERIFIER_FLAGS:  0</code></pre></div>\n<p>The next section shows the output of the <code class=\"language-text\">.ecxr</code> command, which displays the Register Context<sup id=\"fnref-3\"><a href=\"#fn-3\" class=\"footnote-ref\">3</a></sup> associated with the exception that occurred.</p>\n<p>This information does not need to be consulted for dumps collected manually to investigate issues such as memory leaks, but it is extremely important when investigating a crash dump like this one.</p>\n<div class=\"gatsby-highlight\" data-language=\"text\"><pre class=\"language-text\"><code class=\"language-text\">CONTEXT:  (.ecxr)\nrax=0000000000000017 rbx=0000021b6cad2460 rcx=00007ff6abb95300\nrdx=000000bfc50ff948 rsi=00007ff6abb953f8 rdi=0000021b6cad7490\nrip=00007ff6abb91412 rsp=000000bfc50ff910 rbp=0000000000000000\n r8=000000bfc50fdd28  r9=0000021b6cad9477 r10=0000000000000000\nr11=000000bfc50ff810 r12=0000000000000000 r13=0000000000000000\nr14=0000000000000000 r15=0000000000000000\niopl=0         nv up ei pl nz na po nc\ncs=0033  ss=002b  ds=002b  es=002b  fs=0053  gs=002b             efl=00010206\nD4C+0x1412:\n00007ff6`abb91412 41c706e8030000  mov     dword ptr [r14],3E8h ds:00000000`00000000=????????\nResetting default scope</code></pre></div>\n<p>Looking at the <code class=\"language-text\">.ecxr</code> output above, we can see that the application crashed at the instruction at offset <code class=\"language-text\">0x1412</code>.</p>\n<p>We can also see that the instruction that caused the crash was <code class=\"language-text\">mov   dword ptr [r14],3E8h</code>.</p>\n<div class=\"gatsby-highlight\" data-language=\"text\"><pre class=\"language-text\"><code class=\"language-text\">D4C+0x1412:\n00007ff6`abb91412 41c706e8030000  mov     dword ptr [r14],3E8h ds:00000000`00000000=????????</code></pre></div>\n<p>This instruction stores the value <code class=\"language-text\">0x3E8</code> (<code class=\"language-text\">1000</code>) into a DWORD (32-bit) region at the pointer address held in the <code class=\"language-text\">r14</code> register.</p>\n<p>However, as shown by <code class=\"language-text\">r14=0000000000000000</code>, the <code class=\"language-text\">r14</code> register does not contain a valid pointer address.</p>\n<p>In other words, we can conclude that the application crashed with an access violation because it tried to store a value to a memory address that does not exist.</p>\n<p>At this point, we have already identified the detailed cause of the application crash, but this time we will continue analyzing the dump file as-is.</p>\n<p>The next section shows output equivalent to running the <code class=\"language-text\">.exr -1</code> command.</p>\n<p>This command outputs information related to an exception that occurred in the system.</p>\n<p>If you specify <code class=\"language-text\">-1</code> as the argument, it displays information for the most recent exception.<sup id=\"fnref-4\"><a href=\"#fn-4\" class=\"footnote-ref\">4</a></sup></p>\n<div class=\"gatsby-highlight\" data-language=\"text\"><pre class=\"language-text\"><code class=\"language-text\">EXCEPTION_RECORD:  (.exr -1)\nExceptionAddress: 00007ff7f7481412 (D4C+0x0000000000001412)\n   ExceptionCode: c0000005 (Access violation)\n  ExceptionFlags: 00000000\nNumberParameters: 2\n   Parameter[0]: 0000000000000001\n   Parameter[1]: 0000000000000000\nAttempt to write to address 0000000000000000</code></pre></div>\n<p>From the <code class=\"language-text\">ExceptionAddress</code> in the result above, we can see that the exception was <code class=\"language-text\">c0000005 (Access violation)</code> and that it occurred at offset <code class=\"language-text\">0x1412</code> in <code class=\"language-text\">D4C.exe</code>.</p>\n<p>Also, when the exception is <code class=\"language-text\">c0000005 (Access violation)</code>, the two parameters displayed by <code class=\"language-text\">.exr -1</code> have the following meanings.<sup id=\"fnref-5\"><a href=\"#fn-5\" class=\"footnote-ref\">5</a></sup></p>\n<ul>\n<li><code class=\"language-text\">Parameter[0]</code>: Type of memory access (read: <code class=\"language-text\">0</code> / write: <code class=\"language-text\">1</code> / execute: <code class=\"language-text\">8</code>)</li>\n<li><code class=\"language-text\">Parameter[1]</code>: Target memory address</li>\n</ul>\n<p>In other words, from the result above, we can see that the access violation was caused by a write access to address <code class=\"language-text\">0x0</code>.</p>\n<p>Let’s continue to the next section.</p>\n<div class=\"gatsby-highlight\" data-language=\"text\"><pre class=\"language-text\"><code class=\"language-text\">PROCESS_NAME:  D4C.exe\n\nWRITE_ADDRESS:  0000000000000000 \n\nERROR_CODE: (NTSTATUS) 0xc0000005 - 0x%p ???? 0x%p ???????????????? %s ???????????????\n\nEXCEPTION_CODE_STR:  c0000005\n\nEXCEPTION_PARAMETER1:  0000000000000001\n\nEXCEPTION_PARAMETER2:  0000000000000000\n\nSTACK_TEXT:  \n00000065`1e9cf580 00007ff7`f7481a40 : {省略} : D4C+0x1412\n00000065`1e9cf840 00007fff`35e17344 : {省略} : D4C+0x1a40\n00000065`1e9cf880 00007fff`35f826b1 : {省略} : kernel32!BaseThreadInitThunk+0x14\n00000065`1e9cf8b0 00000000`00000000 : {省略} : ntdll!RtlUserThreadStart+0x21\n\nSTACK_COMMAND:  ~0s; .ecxr ; kb</code></pre></div>\n<p>The information in the first half, like the output of <code class=\"language-text\">.exr -1</code>, shows the type of the most recent exception and the parameters at the time the exception occurred.</p>\n<p>The <code class=\"language-text\">STACK_TEXT</code> in the second half shows the stack backtrace up to the exception.</p>\n<p>This stack backtrace information is equivalent to the information you can obtain with the <code class=\"language-text\">~0s; .ecxr ; kb</code> command.</p>\n<p>Breaking that command down, <code class=\"language-text\">~0s</code> and <code class=\"language-text\">.ecxr</code> obtain the Register Context for the first thread, and then <code class=\"language-text\">kb</code> outputs a stack backtrace with arguments.</p>\n<p>In other words, for this crash dump, this output is equivalent to extracting from the stack backtrace shown by <code class=\"language-text\">kb</code> only the information up to just before the exception dispatcher (<code class=\"language-text\">KiUserExceptionDispatch</code>)<sup id=\"fnref-6\"><a href=\"#fn-6\" class=\"footnote-ref\">6</a></sup> is called.</p>\n<p>If you actually run the <code class=\"language-text\">kb</code> command in WinDbg, you can obtain the following information.</p>\n<div class=\"gatsby-highlight\" data-language=\"text\"><pre class=\"language-text\"><code class=\"language-text\">0:000> kb\n# RetAddr               : Args to Child  : Call Site\n00 00007fff`33701be0    : {省略} : ntdll!NtWaitForMultipleObjects+0x14\n01 00007fff`33701ade    : {省略} : KERNELBASE!WaitForMultipleObjectsEx+0xf0\n02 00007fff`35e6f93a    : {省略} : KERNELBASE!WaitForMultipleObjects+0xe\n03 00007fff`35e6f376    : {省略} : kernel32!WerpReportFaultInternal+0x58a\n04 00007fff`337de099    : {省略} : kernel32!WerpReportFault+0xbe\n05 00007fff`35fd5330    : {省略} : KERNELBASE!UnhandledExceptionFilter+0x3d9\n06 00007fff`35fbc876    : {省略} : ntdll!RtlUserThreadStart$filt$0+0xa2\n07 00007fff`35fd221f    : {省略} : ntdll!_C_specific_handler+0x96\n08 00007fff`35f814b4    : {省略} : ntdll!RtlpExecuteHandlerForException+0xf\n09 00007fff`35fd0d2e    : {省略} : ntdll!RtlDispatchException+0x244\n0a 00007ff7`f7481412    : {省略} : ntdll!KiUserExceptionDispatcher+0x2e\n0b 00007ff7`f7481a40    : {省略} : D4C+0x1412\n0c 00007fff`35e17344    : {省略} : D4C+0x1a40\n0d 00007fff`35f826b1    : {省略} : kernel32!BaseThreadInitThunk+0x14\n0e 00000000`00000000    : {省略} : ntdll!RtlUserThreadStart+0x21</code></pre></div>\n<p>If you read the stack backtrace above in order, you can follow the entire flow: execution starts at the <code class=\"language-text\">RtlUserThreadStart</code> function, which starts a user-mode thread in Windows, then offset <code class=\"language-text\">0x1412</code> is pushed onto the stack, and then the exception dispatcher and the <code class=\"language-text\">WerpReportFault</code> function that connects to the WER service are called, leading up to creation of the crash dump.<sup id=\"fnref-7\"><a href=\"#fn-7\" class=\"footnote-ref\">7</a></sup></p>\n<p>Next, let’s look at the last section of <code class=\"language-text\">!analyze -v</code>.</p>\n<div class=\"gatsby-highlight\" data-language=\"text\"><pre class=\"language-text\"><code class=\"language-text\">SYMBOL_NAME:  D4C+1412\n\nMODULE_NAME: D4C\n\nIMAGE_NAME:  D4C.exe\n\nFAILURE_BUCKET_ID:  NULL_POINTER_WRITE_c0000005_D4C.exe!Unknown\n\nOS_VERSION:  10.0.19041.1\n\nBUILDLAB_STR:  vb_release\n\nOSPLATFORM_TYPE:  x64\n\nOSNAME:  Windows 10\n\nFAILURE_ID_HASH:  {3a8ea6b5-fbef-8da5-2baa-142fae4fc055}\n\nFollowup:     MachineOwner</code></pre></div>\n<p><code class=\"language-text\">FAILURE_BUCKET_ID</code> is one of the most important pieces of information when analyzing a dump file.</p>\n<p>When you load a crash dump file into the debugger, a signature called a BUCKET ID is generated to identify the type of crash.<sup id=\"fnref-8\"><a href=\"#fn-8\" class=\"footnote-ref\">8</a></sup> <sup id=\"fnref-9\"><a href=\"#fn-9\" class=\"footnote-ref\">9</a></sup></p>\n<p>In this dump file, <code class=\"language-text\">FAILURE_BUCKET_ID</code> is displayed as <code class=\"language-text\">NULL_POINTER_WRITE_c0000005_D4C.exe!Unknown</code>.</p>\n<p>This is another reason we can determine that the cause of the application crash was an access violation caused by writing to a NULL pointer.</p>\n<p>With that, we have now reviewed all output from the <code class=\"language-text\">!analyze -v</code> command.</p>\n<p>For a simple crash dump like this one, just reading the output of <code class=\"language-text\">!analyze -v</code> makes it easy to identify the cause of the application crash.</p>\n<h2 id=\"reading-the-instructions-around-the-crash\" style=\"position:relative;\"><a href=\"#reading-the-instructions-around-the-crash\" aria-label=\"reading the instructions around the crash permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Reading the instructions around the crash</h2>\n<p>Although we have already identified the cause of the application crash from the output of <code class=\"language-text\">!analyze -v</code>, we will continue analyzing the dump file to obtain more detailed information.</p>\n<p>From the output of <code class=\"language-text\">!analyze -v</code>, we confirmed that the instruction where the application crash occurred was <code class=\"language-text\">mov   dword ptr [r14],3E8h</code> at offset <code class=\"language-text\">0x1412</code>.</p>\n<p>In this section, we will trace the processing immediately before the crash occurred.</p>\n<p>First, let’s call <code class=\"language-text\">threads</code>, included in the <code class=\"language-text\">ext</code> extension, to list the application’s threads.</p>\n<p>From the output below, we can see that this application has only one thread—the main thread—running.</p>\n<div class=\"gatsby-highlight\" data-language=\"text\"><pre class=\"language-text\"><code class=\"language-text\">0:000> !threads\nIndexTIDTEBStackBaseStackLimit DeAlloc StackSize ThreadProc\n00000000000000000 0x000000651eac0000 0x000000651e9d0000 0x000000651e9cc0000x000000651e8d0000 0x00000000000040000x0\nTotal VM consumed by thread stacks 0x00004000</code></pre></div>\n<p>From the result above, we can see that using the main thread as the analysis target is fine, so we display a stack backtrace with the Register Context of the exception specified by running <code class=\"language-text\">~0s; .ecxr ; k</code>.</p>\n<p>Note that the <code class=\"language-text\">Args to Child</code> information obtained by the <code class=\"language-text\">kb</code> command is not very useful for x64 binaries because of the calling convention, so in the example below I display information using only the <code class=\"language-text\">k</code> command.</p>\n<div class=\"gatsby-highlight\" data-language=\"text\"><pre class=\"language-text\"><code class=\"language-text\">0:000> ~0s; .ecxr ; k\n{省略}\nD4C+0x1412:\n00007ff7`f7481412 41c706e8030000  mov     dword ptr [r14],3E8h ds:00000000`00000000=????????\n  *** Stack trace for last set context - .thread/.cxr resets it\n # Child-SP          RetAddr               Call Site\n00 00000065`1e9cf580 00007ff7`f7481a40     D4C+0x1412\n01 00000065`1e9cf840 00007fff`35e17344     D4C+0x1a40\n02 00000065`1e9cf880 00007fff`35f826b1     kernel32!BaseThreadInitThunk+0x14\n03 00000065`1e9cf8b0 00000000`00000000     ntdll!RtlUserThreadStart+0x21</code></pre></div>\n<p>In an application crash dump like this one, the topmost <code class=\"language-text\">Call Site</code> is usually the offset of the instruction that raised the exception.</p>\n<p>In the output for this dump file, the call immediately before the exception dispatcher is <code class=\"language-text\">D4C+0x1412</code>, so we can see that the crashing instruction is at offset <code class=\"language-text\">0x1412</code> in <code class=\"language-text\">D4C.exe</code>.</p>\n<p>We already confirmed from the output of <code class=\"language-text\">.ecxr</code> that this application crash was caused by an access violation at the instruction at offset <code class=\"language-text\">0x1412</code>, but let’s also inspect the instructions around that offset just to be sure.</p>\n<p>You can inspect the instructions around a specific offset by using the Disassembly window opened with [Alt + 7].</p>\n<p>When you use the Disassembly window, enter <code class=\"language-text\">!&lt;module name>+offset</code> in the Offset field at the top of the window.</p>\n<p>In other words, if you want to inspect the instruction at offset <code class=\"language-text\">0x1412</code> in <code class=\"language-text\">D4C.exe</code>, enter <code class=\"language-text\">!D4C+0x1412</code> in the Offset field at the top of the window.</p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 500px; \"\n    >\n      <a\n    class=\"gatsby-resp-image-link\"\n    href=\"/static/d296f3f1bb0cd2b669738deebdd69213/0b533/app-crash-004.png\"\n    style=\"display: block\"\n    target=\"_blank\"\n    rel=\"noopener\"\n  >\n    <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 72.91666666666666%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAPCAYAAADkmO9VAAAACXBIWXMAAA7EAAAOxAGVKw4bAAACgUlEQVQ4y3WU6W7aQBSFef+3aFW1/dFWatoqapqKplmAGK9jG7A9eIFgG9s4VGGJFDidOw2ISMXS0eBZPt/lDI1PFwxf2wG+tHycG2P8srO9LpwMTZYKTcTvXL7v9bznTI1wcuXi27mC0w9f0WCOA1U30b5VYDIbk2yKvCilfB7CsBh4GKGc1ajqudTsnsZ7LNePWCxX+DOv8bhewQ8TNFwBZIxB13VomoZ0MkFZlqiEPM8DsywkcYzpdIqqqqRms0ru2Ww2OHzi0Z0Auv+AhmHANE0URSFUohQHCTgchnJuPB4jTVOpPM8xER9+enrCVoB24CgZo9Hr9WDbtoyOxt0BisT3fRm5I7Igua4rP1LXNVarFbbbrQTtxigREdq2A0tE2FVVqKqGMIowvrvDVETpCWC7cwtV0wXYkFlYogT0sd1DsBdA3nfQdyz0mIHOzSWCgYv7MsdyPsMoDOCYGlymwxf7OA8Qi3rugDvYC+D73328a9p485Ph9ZmOkw7HqZHis5bi4w3Hqx8m3jZdfNciEXUhGjLDcrk8DuwYPVyrDFeKhRsxelEKL87gj6ZQbR/NlorLWxMtsUY1ppo/PDwcBw56DmzLlGpdX8HruyjyDHVVIBQpal0FzNRhM0vWj5pDUR6tIfnQMExoopvtdltGEceJrFMQBFAURTaLLEVrZLHRaHQcSClYzz4k4GAwkNYh43LO0e12990lEZB8eTRlR0ZoSB8SkA4Nh0N5KBIWIqAqLEVz1GGaIx8eAjeHQDIqGZbSIRilQ8amCMnYFFEYhkiSRK7RjVmv1/jfI68ebaa0OR8iyzIpgs3ncznSO93jQ1H0i8ViL+r6mv4ceIS/yNlFv1/mEDYAAAAASUVORK5CYII='); background-size: cover; display: block;\"\n  ></span>\n  <picture>\n          <source\n              srcset=\"/static/d296f3f1bb0cd2b669738deebdd69213/8ac56/app-crash-004.webp 240w,\n/static/d296f3f1bb0cd2b669738deebdd69213/d3be9/app-crash-004.webp 480w,\n/static/d296f3f1bb0cd2b669738deebdd69213/b0a15/app-crash-004.webp 500w\"\n              sizes=\"(max-width: 500px) 100vw, 500px\"\n              type=\"image/webp\"\n            />\n          <source\n            srcset=\"/static/d296f3f1bb0cd2b669738deebdd69213/8ff5a/app-crash-004.png 240w,\n/static/d296f3f1bb0cd2b669738deebdd69213/e85cb/app-crash-004.png 480w,\n/static/d296f3f1bb0cd2b669738deebdd69213/0b533/app-crash-004.png 500w\"\n            sizes=\"(max-width: 500px) 100vw, 500px\"\n            type=\"image/png\"\n          />\n          <img\n            class=\"gatsby-resp-image-image\"\n            src=\"/static/d296f3f1bb0cd2b669738deebdd69213/0b533/app-crash-004.png\"\n            alt=\"Viewing instruction code in the Disassembly window\"\n            title=\"Viewing instruction code in the Disassembly window\"\n            loading=\"lazy\"\n            style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n          />\n        </picture>\n  </a>\n    </span></p>\n<p>You can also use the <code class=\"language-text\">u / ub / uu</code> commands<sup id=\"fnref-10\"><a href=\"#fn-10\" class=\"footnote-ref\">10</a></sup> in WinDbg to inspect instructions at a specific offset.</p>\n<p>When using commands, you can specify the offset in the same format as in the Disassembly window.</p>\n<p>To retrieve the instruction at offset <code class=\"language-text\">0x1412</code>, run the <code class=\"language-text\">u !D4C+0x1412</code> command.</p>\n<p>If you do not specify any options for the <code class=\"language-text\">u</code> command, it displays the eight instructions after the specified offset. (This includes the instruction at the specified offset.)</p>\n<p>On the other hand, if you want to inspect the instruction immediately before the specified offset, you can use the <code class=\"language-text\">ub</code> command.</p>\n<p>Running <code class=\"language-text\">ub !D4C+0x1412</code> displays the eight or nine instructions before the specified offset. (It does not include the instruction at the specified offset.)</p>\n<p>If you look at the actual output of each command, you can see that the instructions before and after the specified offset are retrieved correctly, as shown below.</p>\n<div class=\"gatsby-highlight\" data-language=\"text\"><pre class=\"language-text\"><code class=\"language-text\"># Retrieve the 8 instructions starting at the specified offset with the u command (partially omitted)\n0:000> u !D4C+0x1412\nD4C+0x1412:\nmov     dword ptr [r14],3E8h\ncall    D4C+0x14e0 (00007ff7`f74814e0)\njmp     D4C+0x1431 (00007ff7`f7481431)\nlea     rcx,[D4C+0x3538 (00007ff7`f7483538)]\ncall    D4C+0x1010 (00007ff7`f7481010)\ncall    D4C+0x1740 (00007ff7`f7481740)\nlea     rcx,[D4C+0x3310 (00007ff7`f7483310)]\ncall    D4C+0x1010 (00007ff7`f7481010)\n\n\n# Retrieve the 8 (or 9) instructions before the specified offset with the ub command (partially omitted)\n0:000> ub !D4C+0x1412\nD4C+0x13e7:\njmp     D4C+0x1431 (00007ff7`f7481431)\nlea     rcx,[D4C+0x3560 (00007ff7`f7483560)]\ncall    D4C+0x1010 (00007ff7`f7481010)\nlea     rcx,[D4C+0x52e8 (00007ff7`f74852e8)]\ncall    D4C+0x14e0 (00007ff7`f74814e0)\nmov     qword ptr [rsp+38h],r14\nlea     rdx,[rsp+38h]\nlea     rcx,[D4C+0x5300 (00007ff7`f7485300)]\n\n\n# Retrieve 16 (0x10) instructions starting from the offset identified with ub (partially omitted)\n0:000> u !D4C+0x13e7 L10\nD4C+0x13e7:\njmp     D4C+0x1431 (00007ff7`f7481431)\nlea     rcx,[D4C+0x3560 (00007ff7`f7483560)]\ncall    D4C+0x1010 (00007ff7`f7481010)\nlea     rcx,[D4C+0x52e8 (00007ff7`f74852e8)]\ncall    D4C+0x14e0 (00007ff7`f74814e0)\nmov     qword ptr [rsp+38h],r14\nlea     rdx,[rsp+38h]\nlea     rcx,[D4C+0x5300 (00007ff7`f7485300)]\nmov     dword ptr [r14],3E8h\ncall    D4C+0x14e0 (00007ff7`f74814e0)\njmp     D4C+0x1431 (00007ff7`f7481431)\nlea     rcx,[D4C+0x3538 (00007ff7`f7483538)]\ncall    D4C+0x1010 (00007ff7`f7481010)\ncall    D4C+0x1740 (00007ff7`f7481740)\nlea     rcx,[D4C+0x3310 (00007ff7`f7483310)]\ncall    D4C+0x1010 (00007ff7`f7481010)</code></pre></div>\n<p>Now we have been able to inspect the instructions immediately before and after the application crash in WinDbg.</p>\n<h2 id=\"appendix-analyzing-the-binary-with-ghidra\" style=\"position:relative;\"><a href=\"#appendix-analyzing-the-binary-with-ghidra\" aria-label=\"appendix analyzing the binary with ghidra permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Appendix: Analyzing the binary with Ghidra</h2>\n<p>In general, crash dump analysis is only one part of a larger troubleshooting workflow.</p>\n<p>As in this example, if dump analysis has already identified the specific cause of the application crash and the offset of the code where the error occurred, then other approaches—such as checking the source code, live debugging, or changing settings in an environment where the problem can be reproduced—may be more effective than dump analysis for determining the deeper cause or a workaround.</p>\n<p>However, situations often arise where the analyst cannot obtain the source code or symbols of the program under investigation, making troubleshooting with those approaches difficult.</p>\n<p>One option in such cases is to learn techniques for restoring an application into assembly or pseudocode using tools called decompilers.</p>\n<p>In this book, I use version 2.3 of Ghidra, a powerful open-source decompiler, to decompile the application.</p>\n<p>Ghidra is a tool developed by the United States National Security Agency (NSA) that makes it easy to disassemble and decompile application executables.</p>\n<p>However, if the program being analyzed is written in a programming language such as .Net or Java, it is more efficient to use dedicated decompilers such as ILSpy<sup id=\"fnref-11\"><a href=\"#fn-11\" class=\"footnote-ref\">11</a></sup> or jadx<sup id=\"fnref-12\"><a href=\"#fn-12\" class=\"footnote-ref\">12</a></sup>.</p>\n<p>When doing analysis, it is best to use the most suitable tool or a combination of tools—according to the type of program being analyzed, the programming language used to develop it, the framework, and so on.</p>\n<p>Decompiling and analyzing a command-line application written in C, like <code class=\"language-text\">D4C.exe</code>, is very easy with Ghidra.</p>\n<p>First, start the Ghidra you set up in Chapter 1 and drag and drop the executable <code class=\"language-text\">D4C.exe</code> into the project screen.</p>\n<p>At that point, if Ghidra automatically analyzes the file type and indicates that it is a PE binary for the x64 platform (a Windows executable), click [OK] to load the file.</p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 500px; \"\n    >\n      <a\n    class=\"gatsby-resp-image-link\"\n    href=\"/static/dc9858e47b2615914c18e09e1ab5f24d/0b533/ghidra-appcrash-001.png\"\n    style=\"display: block\"\n    target=\"_blank\"\n    rel=\"noopener\"\n  >\n    <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 75%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAPCAYAAADkmO9VAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAB90lEQVQ4y51U2W7bQAzU/39VCxRFX9r0wal1xLo3so7VLceyak9J2us6aQIDFTDgao/Z4ZCSlaUK/bTDsHvB/vAbL/Micb9ccLiHhc4cMO1n7PYHWGGYYOO5CAIfSZKgKAqM44hhGD7EeMHtWDAOsL48fMaPRxsqy1GWBaFEVVX/hbKsYH39+Qnfvj/AcTdCZsBK8zx/Fx+tbbdbWJH/BN9e0Uv+ioxva9sOXXeLXqKua8zz/ArLssgaeRijyrbIiUQpJT7GcYyUijWQJ9M0XcHe6qYlNQXee3iPFcYJ+r6HSlMqTAjHcWHbjoDT0FqLP1rXyLIM7iZEQVmcTkfC6Qp++EIhTEmVbdtw3Sesf9mkkOdSUWLM1pVGRh7FUSS2GJJ/CCM6yJ5FtJFTfn7OZIHlv22Xtm1Rk398kSExpH8VEqExnQ8wOkbXihUMmaN13/cR+IFYcTyeU+bIEA+Z8HFty61nnzSapoavKjhJBT+MJMWmaWQPRybnwtV1g4bGzUWEpvdIFbBsKsJ6vcZqtRIFnLq3Cch8guvB8zyZC8NQEAQBdcA5K7bhmh2hpMJZQRRLAYwCji0ruagxvt2C55iUC8mRvVcqJf8VrIqksl9MZlrkHngffxUJdQO3Eo85cvXJQ4dSc6X/MqrwuU3KuzDEtxfx/+APWQpp3BDajdoAAAAASUVORK5CYII='); background-size: cover; display: block;\"\n  ></span>\n  <picture>\n          <source\n              srcset=\"/static/dc9858e47b2615914c18e09e1ab5f24d/8ac56/ghidra-appcrash-001.webp 240w,\n/static/dc9858e47b2615914c18e09e1ab5f24d/d3be9/ghidra-appcrash-001.webp 480w,\n/static/dc9858e47b2615914c18e09e1ab5f24d/b0a15/ghidra-appcrash-001.webp 500w\"\n              sizes=\"(max-width: 500px) 100vw, 500px\"\n              type=\"image/webp\"\n            />\n          <source\n            srcset=\"/static/dc9858e47b2615914c18e09e1ab5f24d/8ff5a/ghidra-appcrash-001.png 240w,\n/static/dc9858e47b2615914c18e09e1ab5f24d/e85cb/ghidra-appcrash-001.png 480w,\n/static/dc9858e47b2615914c18e09e1ab5f24d/0b533/ghidra-appcrash-001.png 500w\"\n            sizes=\"(max-width: 500px) 100vw, 500px\"\n            type=\"image/png\"\n          />\n          <img\n            class=\"gatsby-resp-image-image\"\n            src=\"/static/dc9858e47b2615914c18e09e1ab5f24d/0b533/ghidra-appcrash-001.png\"\n            alt=\"Loading an executable into a project\"\n            title=\"Loading an executable into a project\"\n            loading=\"lazy\"\n            style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n          />\n        </picture>\n  </a>\n    </span></p>\n<p>Next, double-click the loaded file to open the analysis window.</p>\n<p>If several confirmation prompts like the ones below appear, select [Yes].</p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 500px; \"\n    >\n      <a\n    class=\"gatsby-resp-image-link\"\n    href=\"/static/49a236e4cd663e17b5c9d1d25a531c5a/0b533/ghidra-appcrash-002.png\"\n    style=\"display: block\"\n    target=\"_blank\"\n    rel=\"noopener\"\n  >\n    <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 34.166666666666664%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAHCAYAAAAIy204AAAACXBIWXMAAA7EAAAOxAGVKw4bAAABFElEQVQoz6VPyU7DMBT0R/Id/BsSBw69IS5USJQsTpqmpYkJibN5ydLbYLuNQBUSByyNZt549OwhL7snFKxEWZb4zzmdTpjnGUSqAm3ToDGwhsU0nXle+Fq7zHTRZ9ZaYxgGkMc1w/69QN+1qKoKFa/ADazmnP/wuGvhZoO6Xu6sb+caQgiQm9t73D284nhMEYQBojhCksTwfN9oiiDw4Ae+8zabN9CIulyy28LzPIQ0RhhSZHkOpTRIemCmbgcppXtBCOmgzDxqhXHQ0Eq6ShY2t2SluLD8ZjKOJmSGvhfOtKykQF622GwzeLscB8aRZRkY+0DXdZeHfwe5NuzCwfwoYQ1Wa4rVs6m4/0RMqamZ/rnwC9JHDWh8fLt9AAAAAElFTkSuQmCC'); background-size: cover; display: block;\"\n  ></span>\n  <picture>\n          <source\n              srcset=\"/static/49a236e4cd663e17b5c9d1d25a531c5a/8ac56/ghidra-appcrash-002.webp 240w,\n/static/49a236e4cd663e17b5c9d1d25a531c5a/d3be9/ghidra-appcrash-002.webp 480w,\n/static/49a236e4cd663e17b5c9d1d25a531c5a/b0a15/ghidra-appcrash-002.webp 500w\"\n              sizes=\"(max-width: 500px) 100vw, 500px\"\n              type=\"image/webp\"\n            />\n          <source\n            srcset=\"/static/49a236e4cd663e17b5c9d1d25a531c5a/8ff5a/ghidra-appcrash-002.png 240w,\n/static/49a236e4cd663e17b5c9d1d25a531c5a/e85cb/ghidra-appcrash-002.png 480w,\n/static/49a236e4cd663e17b5c9d1d25a531c5a/0b533/ghidra-appcrash-002.png 500w\"\n            sizes=\"(max-width: 500px) 100vw, 500px\"\n            type=\"image/png\"\n          />\n          <img\n            class=\"gatsby-resp-image-image\"\n            src=\"/static/49a236e4cd663e17b5c9d1d25a531c5a/0b533/ghidra-appcrash-002.png\"\n            alt=\"Ghidra confirmation prompt\"\n            title=\"Ghidra confirmation prompt\"\n            loading=\"lazy\"\n            style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n          />\n        </picture>\n  </a>\n    </span></p>\n<p>For the analysis options that appear next, the default settings are fine, so click [Analyze] to start analyzing the program.</p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 500px; \"\n    >\n      <a\n    class=\"gatsby-resp-image-link\"\n    href=\"/static/450a41547d6576d133592305b8e7af07/0b533/ghidra-appcrash-003.png\"\n    style=\"display: block\"\n    target=\"_blank\"\n    rel=\"noopener\"\n  >\n    <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 59.583333333333336%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAMCAYAAABiDJ37AAAACXBIWXMAAA7EAAAOxAGVKw4bAAABiklEQVQoz5WS626CUBCEff9na6rVagRB5FyAw/2Opup09yRNbKO2/TExgvvtzDqzfeghjmPUbYuu79F0HVoWfWdVVWU/u64ndQ81DIPlzBzXg+vssHdcqEOIKJSIhKKXhpRAa408zy24LMuHqusaSinMdJxCKoP164pACcZmwlCP6KcrPddIksQOFEXxVLxQSslAQ0M59ssNIi/EVHYYjxcMpysEOeWt7PA38VIhBGYROVRRhvn8Hdutj4rcjQTrpwuEVKjoh03T2EjPxHfm81iHQhu8UOQ1AUuKPB4JOJ4RComCtvMAR3omXmpvGBFQ6hQLirzzBZr+RA4vNrZJMxvnC3jP2R1gCh3nWKy2cH1JblNyOeL4ARRlhTzL/ge0kVWMNwKmRUOwAe1wwjCdkWb5N4d/iqzokOv1BsvlCo67QxAc4FAnfX+PjGBciVvgI5f8p1ggDxiT2A4ZY5BRxDiKbOtvS3s7zM9u3X0rNkdiuz+r0bYUIcmw9LStDy8MgsAuvHcCnufafAK0aIWCX2T6hAAAAABJRU5ErkJggg=='); background-size: cover; display: block;\"\n  ></span>\n  <picture>\n          <source\n              srcset=\"/static/450a41547d6576d133592305b8e7af07/8ac56/ghidra-appcrash-003.webp 240w,\n/static/450a41547d6576d133592305b8e7af07/d3be9/ghidra-appcrash-003.webp 480w,\n/static/450a41547d6576d133592305b8e7af07/b0a15/ghidra-appcrash-003.webp 500w\"\n              sizes=\"(max-width: 500px) 100vw, 500px\"\n              type=\"image/webp\"\n            />\n          <source\n            srcset=\"/static/450a41547d6576d133592305b8e7af07/8ff5a/ghidra-appcrash-003.png 240w,\n/static/450a41547d6576d133592305b8e7af07/e85cb/ghidra-appcrash-003.png 480w,\n/static/450a41547d6576d133592305b8e7af07/0b533/ghidra-appcrash-003.png 500w\"\n            sizes=\"(max-width: 500px) 100vw, 500px\"\n            type=\"image/png\"\n          />\n          <img\n            class=\"gatsby-resp-image-image\"\n            src=\"/static/450a41547d6576d133592305b8e7af07/0b533/ghidra-appcrash-003.png\"\n            alt=\"Selecting Ghidra analysis options\"\n            title=\"Selecting Ghidra analysis options\"\n            loading=\"lazy\"\n            style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n          />\n        </picture>\n  </a>\n    </span></p>\n<p>After automatic analysis runs for a few dozen seconds to a few minutes, you will be able to inspect the decompiled result of the application in Ghidra.</p>\n<p>By default, the Ghidra analysis window is laid out as shown below.</p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 500px; \"\n    >\n      <a\n    class=\"gatsby-resp-image-link\"\n    href=\"/static/8a5e11d6e2ddff736051e860c0fe7ab8/0b533/ghidra-appcrash-004.png\"\n    style=\"display: block\"\n    target=\"_blank\"\n    rel=\"noopener\"\n  >\n    <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 60.416666666666664%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAMCAYAAABiDJ37AAAACXBIWXMAAA7EAAAOxAGVKw4bAAABwklEQVQoz41S2W7bMBDU//9aixZBEcdwIkWHZR08dFESL3m6lOHmqYEEDJYUd2fJnYku7xdkWYbiWiBOUuTXEpxzMCbAJEPDGfq+R5FzxB8MOcWylKjrjnIGdN2IcVSEkdYdovPbad9wKsyKGy6FQEwF75lAUvZImwnxleH1T4rPpCNCidutR9uOkDIQzViWlbBAqRlR0zTw3sM7B209bv0Dn/WCnFu0CsjZhKYpceSLrLXYtg0rdZgWjbhakNSOyAxKaVGNQFYPqMpiLwi59/v9v4heXn6hqmpUdQVjHc1sQCs01OoxaYfZbKgajobOwxeKvr1hll2oK7CuK5yzEFxAEqFzHsbT7b1DS2NhJNQhwuciPD1Aio5goI2H3TwRO3SksprnY4RFUYAzjpYxaG0wDKQ4M6SYx3bfdkJOtx7G6dgMf//8gTxNScV2LzDGou9ANvjqOk0KXIhjKiv16DwTw0cc43Q64/yWII4TMvuVDFyT93LaxxBEGkwfopRyN3IwfXjVNE0Yevk1wyCKlB0dDvS8B0JSgFJqN+48z3sMRg75AVrrHcbQ3PWKSFCnUMSE3H+GmVn7hP2HcGae8Rv8BVCynP5UjzP5AAAAAElFTkSuQmCC'); background-size: cover; display: block;\"\n  ></span>\n  <picture>\n          <source\n              srcset=\"/static/8a5e11d6e2ddff736051e860c0fe7ab8/8ac56/ghidra-appcrash-004.webp 240w,\n/static/8a5e11d6e2ddff736051e860c0fe7ab8/d3be9/ghidra-appcrash-004.webp 480w,\n/static/8a5e11d6e2ddff736051e860c0fe7ab8/b0a15/ghidra-appcrash-004.webp 500w\"\n              sizes=\"(max-width: 500px) 100vw, 500px\"\n              type=\"image/webp\"\n            />\n          <source\n            srcset=\"/static/8a5e11d6e2ddff736051e860c0fe7ab8/8ff5a/ghidra-appcrash-004.png 240w,\n/static/8a5e11d6e2ddff736051e860c0fe7ab8/e85cb/ghidra-appcrash-004.png 480w,\n/static/8a5e11d6e2ddff736051e860c0fe7ab8/0b533/ghidra-appcrash-004.png 500w\"\n            sizes=\"(max-width: 500px) 100vw, 500px\"\n            type=\"image/png\"\n          />\n          <img\n            class=\"gatsby-resp-image-image\"\n            src=\"/static/8a5e11d6e2ddff736051e860c0fe7ab8/0b533/ghidra-appcrash-004.png\"\n            alt=\"Ghidra analysis window\"\n            title=\"Ghidra analysis window\"\n            loading=\"lazy\"\n            style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n          />\n        </picture>\n  </a>\n    </span></p>\n<p>First, the Decompiler window on the right shows the result of decompiling application functions into pseudocode close to C.</p>\n<p>The Listing window in the center shows the disassembly of the application.</p>\n<p>The code displayed in the Listing window is basically the same disassembly you can inspect in WinDbg’s Disassembly window, but Ghidra automatically analyzes information such as the IAT and displays the results, so it often shows code that is easier to read than the disassembly you inspect in WinDbg.</p>\n<p>On the left side of the window, you can see windows for inspecting the program’s sections, symbol tree, and data types.</p>\n<p>To analyze the program, first let’s identify the <code class=\"language-text\">main</code> function, which is the first function executed by the program.</p>\n<p>When Windows executes a PE file (<code class=\"language-text\">exe</code>)<sup id=\"fnref-13\"><a href=\"#fn-13\" class=\"footnote-ref\">13</a></sup>, the value of <code class=\"language-text\">AddressOfEntryPoint</code> embedded in the PE file header is the starting point of execution.</p>\n<p>Windows begins executing the program from the address specified by <code class=\"language-text\">AddressOfEntryPoint</code>, performs several initialization steps, and then runs the <code class=\"language-text\">main</code> function.</p>\n<p>You can identify the entry point specified by <code class=\"language-text\">AddressOfEntryPoint</code> by expanding the [Functions] tree in the Symbol Tree window on the left side of Ghidra’s analysis window and finding the <code class=\"language-text\">entry</code> function.</p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 500px; \"\n    >\n      <a\n    class=\"gatsby-resp-image-link\"\n    href=\"/static/0c3068d38813d99d5fd798f9e697379c/0b533/ghidra-appcrash-005.png\"\n    style=\"display: block\"\n    target=\"_blank\"\n    rel=\"noopener\"\n  >\n    <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 100%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAACXBIWXMAAA7EAAAOxAGVKw4bAAADj0lEQVQ4y21U2XLaWBTU///EzHv+YGqWTDJx2SQG24AJGIMBSaB9RdLV1tPnyltSUdUp3bXv6T6LYZ4s2PYJtmXDPJjwgwBJkiJNMyRiSYY0y9HUDZSqUPN/PpcoqjPnNbIyR1mWaJoWNefGxdUYt9MplsvvmN/fY3L3DdPZHJ8+f8E/n/7D1bcxxrdTzLi2WCxg7k2eXWOxmmL9sML1YoLpfIGHzRr7/Q7G1Zc/8e3rCL4fIMtzehNg/bjGfD7nhQccDgd4rgvP9xCGIVwvQBil9DxBlkbI84zziHseTPMAI0lirJZLtG2Hl88lgNCQr+t6JHGCKOxARqjyFkXSoqwapElN+tDW8bowMOSyeCIa9H2vQY7HE+I45lqjNWubGsW50I+0dQlV5FxvUZUN17hXKD0fjb7CEDrz2Yyun98ATydNqeOzVVXBYrBcJyKLmvOSQAXSioHqmmdOw71rSmfUda09ef+dTo4GbAkokYuikJQjjhlZRrdiZM/8y75gvThye/kRxvmc6VclJYqi0BRN03oFrCoFhxK4bsC9khRz0k+RK6ZK2w7+PQNejy5g/Pb7v/jwYYS//r7DdMp0YPqMJ2NkWfYD5cA/60sSPHHsrApSbn9g9rCcwRhd/IHZ3ZTeDQGQ12zbZmRj1E0HL1GwvAzHUCEuegRZQ2vhpgpBXuu5n9VIyg63k2sYWehgt42pCVOiHFz3PE9HuWLkzLCGk0GbHXfYeSWtwM4tsPdqrK0YTxyfkg6XEmXfPeDz5RLWSQR/y0PJTwG0owZHHt76pb603jPxLRerg4PZU4CNHfKhBm7eY8X0M2b3H/G0WaDTAg8eOgSMmf1V3WkPTdLd+Yp/yuG22tNj2uIQKZzSXj/oZD327AmGCN8/h/4lWgIoZSZRTqmFZZ2wPxRwPCCidhF1zWTdPSNMgJhgqhWpfBjvS+4FUCiLhp3OQwKEAeu5ZAfiGXoNWskq8QNFmfpnZvT0eBTAt1z6GVAek5Ic0kWsZxqxfvNKr8tdKQoxGZum+WtA3/dfS0/Rw0A6UTZELMsUm4LScvTPmotmMlpb1qDhz5QFUDcHPiZNVJJbqSFHVTVUVM4WI38xxfIVnJubGxhyQSbi6ZDYgGUfdaX88uO+qtRg9P69Q+PJBMaE2b1+fMR2+6Sb6ZGN4e5+xchacBwHm83m1bbbLbv1Uo/lrLb9Abvdnt16j3t2/P8Bv/XzAvJ19Z4AAAAASUVORK5CYII='); background-size: cover; display: block;\"\n  ></span>\n  <picture>\n          <source\n              srcset=\"/static/0c3068d38813d99d5fd798f9e697379c/8ac56/ghidra-appcrash-005.webp 240w,\n/static/0c3068d38813d99d5fd798f9e697379c/d3be9/ghidra-appcrash-005.webp 480w,\n/static/0c3068d38813d99d5fd798f9e697379c/b0a15/ghidra-appcrash-005.webp 500w\"\n              sizes=\"(max-width: 500px) 100vw, 500px\"\n              type=\"image/webp\"\n            />\n          <source\n            srcset=\"/static/0c3068d38813d99d5fd798f9e697379c/8ff5a/ghidra-appcrash-005.png 240w,\n/static/0c3068d38813d99d5fd798f9e697379c/e85cb/ghidra-appcrash-005.png 480w,\n/static/0c3068d38813d99d5fd798f9e697379c/0b533/ghidra-appcrash-005.png 500w\"\n            sizes=\"(max-width: 500px) 100vw, 500px\"\n            type=\"image/png\"\n          />\n          <img\n            class=\"gatsby-resp-image-image\"\n            src=\"/static/0c3068d38813d99d5fd798f9e697379c/0b533/ghidra-appcrash-005.png\"\n            alt=\"Identifying the entry function\"\n            title=\"Identifying the entry function\"\n            loading=\"lazy\"\n            style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n          />\n        </picture>\n  </a>\n    </span></p>\n<p>Next, click the function <code class=\"language-text\">FUN_140001934()</code> shown in the Listing window or Decompiler window to jump to that function’s offset. (The function offset varies depending on the binary.)</p>\n<p>The decompiled result of the function <code class=\"language-text\">FUN_140001934()</code> is as follows. (Partially omitted.)</p>\n<div class=\"gatsby-highlight\" data-language=\"c\"><pre class=\"language-c\"><code class=\"language-c\">uint <span class=\"token function\">FUN_140001934</span><span class=\"token punctuation\">(</span><span class=\"token keyword\">void</span><span class=\"token punctuation\">)</span>\n<span class=\"token punctuation\">{</span>\n  <span class=\"token punctuation\">{</span><span class=\"token punctuation\">{</span> 省略 <span class=\"token punctuation\">}</span><span class=\"token punctuation\">}</span>\n  uVar4 <span class=\"token operator\">=</span> <span class=\"token function\">__scrt_initialize_crt</span><span class=\"token punctuation\">(</span><span class=\"token number\">1</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n  <span class=\"token keyword\">if</span> <span class=\"token punctuation\">(</span><span class=\"token punctuation\">(</span><span class=\"token keyword\">char</span><span class=\"token punctuation\">)</span>uVar4 <span class=\"token operator\">==</span> <span class=\"token char\">'\\0'</span><span class=\"token punctuation\">)</span> <span class=\"token punctuation\">{</span>\n    <span class=\"token function\">FUN_140001fa8</span><span class=\"token punctuation\">(</span><span class=\"token number\">7</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n  <span class=\"token punctuation\">}</span>\n  <span class=\"token keyword\">else</span> <span class=\"token punctuation\">{</span>\n      <span class=\"token punctuation\">{</span><span class=\"token punctuation\">{</span> 省略 <span class=\"token punctuation\">}</span><span class=\"token punctuation\">}</span>\n\n      puVar7 <span class=\"token operator\">=</span> <span class=\"token punctuation\">(</span>undefined <span class=\"token operator\">*</span><span class=\"token punctuation\">)</span><span class=\"token function\">_get_initial_narrow_environment</span><span class=\"token punctuation\">(</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n      puVar8 <span class=\"token operator\">=</span> <span class=\"token punctuation\">(</span>undefined8 <span class=\"token operator\">*</span><span class=\"token punctuation\">)</span><span class=\"token function\">__p___argv</span><span class=\"token punctuation\">(</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n      uVar1 <span class=\"token operator\">=</span> <span class=\"token operator\">*</span>puVar8<span class=\"token punctuation\">;</span>\n      puVar9 <span class=\"token operator\">=</span> <span class=\"token punctuation\">(</span>uint <span class=\"token operator\">*</span><span class=\"token punctuation\">)</span><span class=\"token function\">__p___argc</span><span class=\"token punctuation\">(</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n      uVar10 <span class=\"token operator\">=</span> <span class=\"token punctuation\">(</span>ulonglong<span class=\"token punctuation\">)</span><span class=\"token operator\">*</span>puVar9<span class=\"token punctuation\">;</span>\n      unaff_EBX <span class=\"token operator\">=</span> <span class=\"token function\">FUN_140001070</span><span class=\"token punctuation\">(</span>uVar10<span class=\"token punctuation\">,</span>uVar1<span class=\"token punctuation\">,</span>puVar7<span class=\"token punctuation\">,</span>in_R9<span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n\n      <span class=\"token punctuation\">{</span><span class=\"token punctuation\">{</span> 省略 <span class=\"token punctuation\">}</span><span class=\"token punctuation\">}</span>\n    <span class=\"token punctuation\">}</span>\n  <span class=\"token punctuation\">}</span>\n  <span class=\"token function\">FUN_140001fa8</span><span class=\"token punctuation\">(</span><span class=\"token number\">7</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n  LAB_140001aa0<span class=\"token operator\">:</span>\n\n  <span class=\"token function\">exit</span><span class=\"token punctuation\">(</span>unaff_EBX<span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n<span class=\"token punctuation\">}</span></code></pre></div>\n<p>The details of this code are outside the scope of this book, so I will not explain them in detail, but the function <code class=\"language-text\">FUN_140001934()</code> corresponds to the initialization process that runs when the application starts.<sup id=\"fnref-14\"><a href=\"#fn-14\" class=\"footnote-ref\">14</a></sup></p>\n<p>In particular, pay attention to the line <code class=\"language-text\">unaff_EBX = FUN_140001070(uVar10,uVar1,puVar7,in_R9);</code>, which takes <code class=\"language-text\">_get_initial_narrow_environment</code>, <code class=\"language-text\">__p___argv</code>, and <code class=\"language-text\">__p___argc</code>—symbol names identified under Ghidra 2.3’s default settings—as arguments.</p>\n<p>I could not find information about this in the official documentation, but if you search the web, including sites such as Stack Overflow, using those three values as clues, you can determine that they most likely correspond to the following processing that the Windows CRT uses to run the <code class=\"language-text\">main</code> function.</p>\n<div class=\"gatsby-highlight\" data-language=\"c\"><pre class=\"language-c\"><code class=\"language-c\"><span class=\"token keyword\">static</span> <span class=\"token keyword\">int</span> __cdecl <span class=\"token function\">invoke_main</span><span class=\"token punctuation\">(</span><span class=\"token punctuation\">)</span>\n<span class=\"token punctuation\">{</span>\n    <span class=\"token keyword\">return</span> <span class=\"token function\">main</span><span class=\"token punctuation\">(</span>__argc<span class=\"token punctuation\">,</span> __argv<span class=\"token punctuation\">,</span> <span class=\"token function\">_get_initial_narrow_environment</span><span class=\"token punctuation\">(</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n<span class=\"token punctuation\">}</span></code></pre></div>\n<p>In other words, we can conclude that the function <code class=\"language-text\">FUN_140001070()</code> called by the line <code class=\"language-text\">unaff_EBX = FUN_140001070(uVar10,uVar1,puVar7,in_R9);</code> inside <code class=\"language-text\">FUN_140001934()</code> corresponds to the <code class=\"language-text\">main</code> function of this program.</p>\n<p>If you actually jump to <code class=\"language-text\">FUN_140001070()</code> in Ghidra and check the Decompiler window, you can see code that includes strings such as <code class=\"language-text\">Welcome.</code> displayed on the console when the program starts, confirming that <code class=\"language-text\">FUN_140001070()</code> is the <code class=\"language-text\">main</code> function of <code class=\"language-text\">D4C.exe</code>.</p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 500px; \"\n    >\n      <a\n    class=\"gatsby-resp-image-link\"\n    href=\"/static/d45bec063e98219cdf4a7c63e47b7cd8/0b533/ghidra-appcrash-006.png\"\n    style=\"display: block\"\n    target=\"_blank\"\n    rel=\"noopener\"\n  >\n    <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 70.83333333333333%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAOCAYAAAAvxDzwAAAACXBIWXMAAA7EAAAOxAGVKw4bAAACO0lEQVQ4y42TC2+bQBCE/f//V5tH0yZq3FqqHWMb8zIY7gEHZ+6YDsRymiZKe2hhJbiPudnd2dNqhSCMsUkqPK0zbOMKy/UBQRDj/v4Xbj/t8XCX4Pu3dIr5Q4rF/IDVKsdmUyAMS8Tck2UCRaEwa41BfQIiMSCMOiSVR5x7bEKNx8dbACc4vu9PUwp/jqEHnOPz5GGZe+sxrpmSAqLpEVUOYdIiLpnnPbb7Cjc3X3AoaxgjMQzcxNsl/DmYD3/ETCsJaZ6B+8xSoUN89FRb4u76M3aJRl3n09+Hvza/F6+AcemQCM8YCFf4enuNfWpRVgkG7y7Qj9YLUDhEF4VUm0jM54+I0nYCdp2C8/6f0JkiUBAY0rt4PHbpEWQDq65xffWssDoD/cQZPgZKIWBYoeggsd4bpCWQiR6FNPjxc4E0r6FUCtPV/+ehlJLV8jBNjSLvYC1bpHfomGx2u0mhkAUsFb5Zw3sKCRy90UrhkBmqAdq25xE77Ag8Hg1yoVG2kt90UIJtpAV/2sOP1+BZMLZP7ydhF4UjMCOQDlDdCLRYrwMET2ALGez1Dptig22xQ1AECHWIPC8gtyxqIGFK8wJ0bHljGo5OB63HI9MCKlxwLLNUIYrHhk+R1SnyJsexJkgoNMcGbdGio3LvzpMiKGnseEtAkVsqHYEDmsbgilWu64pto6HFCR2tcOzHcdy8fWvgVJS6rie/kjhGmlK+dITRK6WxXC6ZD7TBoLUtTs4yONvePod1ryo8rt8oNjVaoOCDrwAAAABJRU5ErkJggg=='); background-size: cover; display: block;\"\n  ></span>\n  <picture>\n          <source\n              srcset=\"/static/d45bec063e98219cdf4a7c63e47b7cd8/8ac56/ghidra-appcrash-006.webp 240w,\n/static/d45bec063e98219cdf4a7c63e47b7cd8/d3be9/ghidra-appcrash-006.webp 480w,\n/static/d45bec063e98219cdf4a7c63e47b7cd8/b0a15/ghidra-appcrash-006.webp 500w\"\n              sizes=\"(max-width: 500px) 100vw, 500px\"\n              type=\"image/webp\"\n            />\n          <source\n            srcset=\"/static/d45bec063e98219cdf4a7c63e47b7cd8/8ff5a/ghidra-appcrash-006.png 240w,\n/static/d45bec063e98219cdf4a7c63e47b7cd8/e85cb/ghidra-appcrash-006.png 480w,\n/static/d45bec063e98219cdf4a7c63e47b7cd8/0b533/ghidra-appcrash-006.png 500w\"\n            sizes=\"(max-width: 500px) 100vw, 500px\"\n            type=\"image/png\"\n          />\n          <img\n            class=\"gatsby-resp-image-image\"\n            src=\"/static/d45bec063e98219cdf4a7c63e47b7cd8/0b533/ghidra-appcrash-006.png\"\n            alt=\"Confirming that FUN_140001070() is the main function\"\n            title=\"Confirming that FUN_140001070() is the main function\"\n            loading=\"lazy\"\n            style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n          />\n        </picture>\n  </a>\n    </span></p>\n<p>In Ghidra, you can rename a function to any name you want by right-clicking the function name and selecting [Rename Function].</p>\n<p>To make the analysis smoother, rename <code class=\"language-text\">FUN_140001070()</code> to <code class=\"language-text\">main</code>.</p>\n<p>You can also infer that <code class=\"language-text\">FUN_1400014e0(\"Welcome.\\n\",param_2,param_3,param_4);</code> and <code class=\"language-text\">FUN_140001010(L\"\\n0. Setting: Full memory dump(You need reboot OS.)\\n\",param_2,param_3,param_4);</code> are functions that output an ASCII string and a wide string to the console, respectively.</p>\n<p>Therefore, rename <code class=\"language-text\">FUN_1400014e0()</code> to <code class=\"language-text\">printf</code> and <code class=\"language-text\">FUN_140001010()</code> to <code class=\"language-text\">wprintf</code>.</p>\n<p>This already makes the decompiled output much easier to read.</p>\n<p>Finally, we will use Ghidra to determine the more detailed cause of the application crash.</p>\n<p>As we have already confirmed, this application crash occurred because, after selecting <code class=\"language-text\">1</code> in the first menu, the program attempted to write to an invalid address.</p>\n<p>So, let’s investigate the code at the point where the application crash occurred from the decompiled output of the <code class=\"language-text\">main</code> function.</p>\n<p>Looking at the information in the Decompiler window, we can see that the application crash occurred at the following code.</p>\n<div class=\"gatsby-highlight\" data-language=\"c\"><pre class=\"language-c\"><code class=\"language-c\"><span class=\"token keyword\">else</span> <span class=\"token keyword\">if</span> <span class=\"token punctuation\">(</span>local_38 <span class=\"token operator\">==</span> <span class=\"token number\">1</span><span class=\"token punctuation\">)</span> <span class=\"token punctuation\">{</span>\n  <span class=\"token function\">wprintf</span><span class=\"token punctuation\">(</span>L<span class=\"token string\">\"User Mode Trouble: Simple process crash.\\n\"</span><span class=\"token punctuation\">,</span>pwVar9<span class=\"token punctuation\">,</span>NewState<span class=\"token punctuation\">,</span>param_4<span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n  <span class=\"token function\">printf</span><span class=\"token punctuation\">(</span><span class=\"token string\">\"OK, Start application.\\n\"</span><span class=\"token punctuation\">,</span>pwVar9<span class=\"token punctuation\">,</span>NewState<span class=\"token punctuation\">,</span>param_4<span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n\n  local_280 <span class=\"token operator\">=</span> <span class=\"token number\">0</span><span class=\"token punctuation\">;</span>\n  pwVar9 <span class=\"token operator\">=</span> <span class=\"token punctuation\">(</span><span class=\"token class-name\">wchar_t</span> <span class=\"token operator\">*</span><span class=\"token punctuation\">)</span><span class=\"token operator\">&amp;</span>local_280<span class=\"token punctuation\">;</span>\n  uRam0000000000000000 <span class=\"token operator\">=</span> <span class=\"token number\">1000</span><span class=\"token punctuation\">;</span>\n\n  <span class=\"token function\">printf</span><span class=\"token punctuation\">(</span><span class=\"token operator\">&amp;</span>DAT_140005300<span class=\"token punctuation\">,</span>pwVar9<span class=\"token punctuation\">,</span>NewState<span class=\"token punctuation\">,</span>param_4<span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n<span class=\"token punctuation\">}</span></code></pre></div>\n<p>If you actually select the write access <code class=\"language-text\">uRam0000000000000000 = 1000;</code>, the Listing window shows that the corresponding code is at offset <code class=\"language-text\">0x1412</code>.</p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 500px; \"\n    >\n      <a\n    class=\"gatsby-resp-image-link\"\n    href=\"/static/cc2d3ea0111aea638d089baade569af0/0b533/ghidra-appcrash-007.png\"\n    style=\"display: block\"\n    target=\"_blank\"\n    rel=\"noopener\"\n  >\n    <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 52.083333333333336%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAKCAYAAAC0VX7mAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAB2ElEQVQoz32S2Y7UMBRE+/+/ineEeAA0QjD0dIYkncXuOO3dcQ43zEhsEpGsSI5TrlN1TzlnjhVjQM0rNw0pFUrZmeeJrh8YdSWEgR3P/5+dk/ce7wMpJqz1Igb2nnA2M04TbXtlvTsme8PI2+jIMlu8XShbpu47e/21TiEEoqikKAcXJ66QCwq5gJ46zl8HmrbwvF5odEOjGs7zmcvS0JkO1WqWp4XlvBBMeBFMghzE6YEslIJ3IIO6isj5wjgHLtNIa1r6e8fgBrRVGGWwvcUNjmgi21ZfBcXhkeHt5tA3yVDsyTemoaP93kgUE+MYBTdgfSJviRrlUrexle2PFE9BhPJRQkiSzZERbHGHV8G+71lNlfwEKQXJrVDrJtnll7fcvB85vq5TlEJU0nyyD7xXD7y9Nny8P/I5f+M8npnHEefgKljGGVz2kq/gFU+JmS3XvxwKsk3Sop941gPXVbDTgi4rnZRyCPo79MOCEnTtpIBoWIP6uawxEtlKFmNFYnhpOUT2Uslhk01p+V5IfpfcFE/TM334zJfhDY/mHY/rB9ao5FyiSJl12wS1/oYs41JkU2v5+amXuUPGR0ZIWlNKicsrvghumFiLuMo3QXZsknst9Z/R/gGcSQKNk/ir4wAAAABJRU5ErkJggg=='); background-size: cover; display: block;\"\n  ></span>\n  <picture>\n          <source\n              srcset=\"/static/cc2d3ea0111aea638d089baade569af0/8ac56/ghidra-appcrash-007.webp 240w,\n/static/cc2d3ea0111aea638d089baade569af0/d3be9/ghidra-appcrash-007.webp 480w,\n/static/cc2d3ea0111aea638d089baade569af0/b0a15/ghidra-appcrash-007.webp 500w\"\n              sizes=\"(max-width: 500px) 100vw, 500px\"\n              type=\"image/webp\"\n            />\n          <source\n            srcset=\"/static/cc2d3ea0111aea638d089baade569af0/8ff5a/ghidra-appcrash-007.png 240w,\n/static/cc2d3ea0111aea638d089baade569af0/e85cb/ghidra-appcrash-007.png 480w,\n/static/cc2d3ea0111aea638d089baade569af0/0b533/ghidra-appcrash-007.png 500w\"\n            sizes=\"(max-width: 500px) 100vw, 500px\"\n            type=\"image/png\"\n          />\n          <img\n            class=\"gatsby-resp-image-image\"\n            src=\"/static/cc2d3ea0111aea638d089baade569af0/0b533/ghidra-appcrash-007.png\"\n            alt=\"Checking the decompiled result for offset 0x1412\"\n            title=\"Checking the decompiled result for offset 0x1412\"\n            loading=\"lazy\"\n            style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n          />\n        </picture>\n  </a>\n    </span></p>\n<p>This offset <code class=\"language-text\">0x1412</code> matches the offset we identified when analyzing the dump file in WinDbg.</p>\n<p>Furthermore, if you inspect Ghidra’s decompiled output, you can see that the destination address for the write refers to a hard-coded value of <code class=\"language-text\">0</code>.</p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 500px; \"\n    >\n      <a\n    class=\"gatsby-resp-image-link\"\n    href=\"/static/3127ae6baa387734d092b851f3e3d315/0b533/ghidra-appcrash-008.png\"\n    style=\"display: block\"\n    target=\"_blank\"\n    rel=\"noopener\"\n  >\n    <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 20%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAECAYAAACOXx+WAAAACXBIWXMAAA7EAAAOxAGVKw4bAAABC0lEQVQY0x2PyU7CAAAF+/+f4MmDFy4aTYxRECilLBaRLtC0CBjQUrAUutgFqGNjXibvNskIoidR2yg0diq9/BUpVOjnA5pem3Yg04v69PYKrUjGykzssYaTbVhup1hfXfRQK9ExYgMtUhGqUZUHX+Qx6NIqJJ4TEal8MW5Rj8R/Gkmdp2MdPVexTJ1a1uQuvORmd8GVf08lvOY2qqAcuwj6Xme4tRm4S6x0jplMmRczJocxesmbP2aS2CyY454dZtN3giTA/ylwwwQvC9ilEUl+oMhThI7fof09RPZMRrnBSzxkdNKRfRXtVOYUGsZvmVNucV5gWzZpUopc+HR81sEHK3+FE65Zxxv+ANuAHlhVLwnlAAAAAElFTkSuQmCC'); background-size: cover; display: block;\"\n  ></span>\n  <picture>\n          <source\n              srcset=\"/static/3127ae6baa387734d092b851f3e3d315/8ac56/ghidra-appcrash-008.webp 240w,\n/static/3127ae6baa387734d092b851f3e3d315/d3be9/ghidra-appcrash-008.webp 480w,\n/static/3127ae6baa387734d092b851f3e3d315/b0a15/ghidra-appcrash-008.webp 500w\"\n              sizes=\"(max-width: 500px) 100vw, 500px\"\n              type=\"image/webp\"\n            />\n          <source\n            srcset=\"/static/3127ae6baa387734d092b851f3e3d315/8ff5a/ghidra-appcrash-008.png 240w,\n/static/3127ae6baa387734d092b851f3e3d315/e85cb/ghidra-appcrash-008.png 480w,\n/static/3127ae6baa387734d092b851f3e3d315/0b533/ghidra-appcrash-008.png 500w\"\n            sizes=\"(max-width: 500px) 100vw, 500px\"\n            type=\"image/png\"\n          />\n          <img\n            class=\"gatsby-resp-image-image\"\n            src=\"/static/3127ae6baa387734d092b851f3e3d315/0b533/ghidra-appcrash-008.png\"\n            alt=\"Where the NULL pointer reference occurs\"\n            title=\"Where the NULL pointer reference occurs\"\n            loading=\"lazy\"\n            style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n          />\n        </picture>\n  </a>\n    </span></p>\n<p>With that, we have determined that the cause of the application crash investigated here was a memory access violation caused by the developer hard-coding <code class=\"language-text\">0</code> as the destination address for the value <code class=\"language-text\">1000</code>.</p>\n<h2 id=\"summary-of-chapter-4\" style=\"position:relative;\"><a href=\"#summary-of-chapter-4\" aria-label=\"summary of chapter 4 permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Summary of Chapter 4</h2>\n<p>That concludes the analysis of a simple application crash dump.</p>\n<p>In real-world troubleshooting, you will almost never investigate a crash event that is this simple, but the basic analysis steps do not change very much.</p>\n<p>As long as the application crash dump has been generated correctly, you can investigate the type of exception that directly caused the crash and the offset of the instruction where the crash occurred from the dump file, regardless of the underlying root cause.</p>\n<p>Through this chapter, I hope you felt that dump file analysis, which may look complex at first glance, can actually make it possible to identify the cause quite easily if you just keep track of a few key checkpoints.</p>\n<h2 id=\"links-to-each-chapter\" style=\"position:relative;\"><a href=\"#links-to-each-chapter\" aria-label=\"links to each chapter permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Links to each chapter</h2>\n<ul>\n<li><a href=\"/magical-windbg-vol1-00-en\">Preface</a></li>\n<li><a href=\"/magical-windbg-vol1-01-en\">Chapter 1: Environment Setup</a></li>\n<li><a href=\"/magical-windbg-vol1-02-en\">Chapter 2: Basic WinDbg Operations</a></li>\n<li><a href=\"/magical-windbg-vol1-03-en\">Chapter 3: Prerequisites for Analysis</a></li>\n<li><a href=\"/magical-windbg-vol1-04-en\">Chapter 4: Analyzing Application Crash Dumps</a></li>\n<li><a href=\"/magical-windbg-vol1-05-en\">Chapter 5: Analyzing Full Memory Dumps from System Crashes</a></li>\n<li><a href=\"/magical-windbg-vol1-06-en\">Chapter 6: Investigating User-Mode Application Memory Leaks from Process Dumps</a></li>\n<li><a href=\"/magical-windbg-vol1-07-en\">Chapter 7: Investigating User-Mode Memory Leaks from Full Memory Dumps</a></li>\n<li><a href=\"/magical-windbg-vol1-50-en\">Appendix A: WinDbg Tips</a></li>\n<li><a href=\"/magical-windbg-vol1-51-en\">Appendix B: Analyzing Crash Dumps with Volatility 3</a></li>\n</ul>\n<div class=\"footnotes\">\n<hr>\n<ol>\n<li id=\"fn-1\">\n<p><em>Windows Internals, 7th Edition, Part 2</em>, p.564 (by Andrea Allievi, Mark E. Russinovich, Alex Ionescu, David A. Solomon / translated by 山内 和朗 / 日系 BP 社 / 2022)</p>\n<a href=\"#fnref-1\" class=\"footnote-backref\">↩</a>\n</li>\n<li id=\"fn-2\">\n<p><em>Windows Internals, 7th Edition, Part 1</em>, p.534 (by Pavel Yosifovich, Alex Ionescu, Mark E. Russinovich, David A. Solomon / translated by 山内 和朗 / 日系 BP 社 / 2018)</p>\n<a href=\"#fnref-2\" class=\"footnote-backref\">↩</a>\n</li>\n<li id=\"fn-3\">\n<p>Register Context <a href=\"https://learn.microsoft.com/ja-jp/windows-hardware/drivers/debugger/changing-contexts#register-context\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">https://learn.microsoft.com/ja-jp/windows-hardware/drivers/debugger/changing-contexts#register-context</a></p>\n<a href=\"#fnref-3\" class=\"footnote-backref\">↩</a>\n</li>\n<li id=\"fn-4\">\n<p>.exr Display Exception Record <a href=\"https://learn.microsoft.com/ja-jp/windows-hardware/drivers/debugger/-exr--display-exception-record-\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">https://learn.microsoft.com/ja-jp/windows-hardware/drivers/debugger/-exr—display-exception-record-</a></p>\n<a href=\"#fnref-4\" class=\"footnote-backref\">↩</a>\n</li>\n<li id=\"fn-5\">\n<p>Access violation C0000005 <a href=\"https://learn.microsoft.com/ja-jp/shows/inside/c0000005\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">https://learn.microsoft.com/ja-jp/shows/inside/c0000005</a></p>\n<a href=\"#fnref-5\" class=\"footnote-backref\">↩</a>\n</li>\n<li id=\"fn-6\">\n<p><em>Windows Internals, 7th Edition, Part 2</em>, p.91 (by Andrea Allievi, Mark E. Russinovich, Alex Ionescu, David A. Solomon / translated by 山内和朗 / 日系 BP 社 / 2022)</p>\n<a href=\"#fnref-6\" class=\"footnote-backref\">↩</a>\n</li>\n<li id=\"fn-7\">\n<p><em>Windows Internals, 7th Edition, Part 2</em>, p.565 (by Andrea Allievi, Mark E. Russinovich, Alex Ionescu, David A. Solomon / translated by 山内和朗 / 日系 BP 社 / 2022)</p>\n<a href=\"#fnref-7\" class=\"footnote-backref\">↩</a>\n</li>\n<li id=\"fn-8\">\n<p><em>インサイド Windows 第 6 版 下</em>, p.624 (by Mark E. Russinovich, David A. Solomon, Alex Ionescu / translated by 株式会社クイープ / 日系 BP 社 / 2013)</p>\n<a href=\"#fnref-8\" class=\"footnote-backref\">↩</a>\n</li>\n<li id=\"fn-9\">\n<p>Using the !analyze extension <a href=\"https://learn.microsoft.com/ja-jp/windows-hardware/drivers/debugger/using-the--analyze-extension\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">https://learn.microsoft.com/ja-jp/windows-hardware/drivers/debugger/using-the—analyze-extension</a></p>\n<a href=\"#fnref-9\" class=\"footnote-backref\">↩</a>\n</li>\n<li id=\"fn-10\">\n<p>u, ub, uu Unassemble <a href=\"https://learn.microsoft.com/ja-jp/windows-hardware/drivers/debugger/u--unassemble-\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">https://learn.microsoft.com/ja-jp/windows-hardware/drivers/debugger/u—unassemble-</a></p>\n<a href=\"#fnref-10\" class=\"footnote-backref\">↩</a>\n</li>\n<li id=\"fn-11\">\n<p>ILSpy <a href=\"https://github.com/icsharpcode/ILSpy\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">https://github.com/icsharpcode/ILSpy</a></p>\n<a href=\"#fnref-11\" class=\"footnote-backref\">↩</a>\n</li>\n<li id=\"fn-12\">\n<p>jadx <a href=\"https://github.com/skylot/jadx\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">https://github.com/skylot/jadx</a></p>\n<a href=\"#fnref-12\" class=\"footnote-backref\">↩</a>\n</li>\n<li id=\"fn-13\">\n<p>PE format <a href=\"https://learn.microsoft.com/ja-jp/windows/win32/debug/pe-format\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">https://learn.microsoft.com/ja-jp/windows/win32/debug/pe-format</a></p>\n<a href=\"#fnref-13\" class=\"footnote-backref\">↩</a>\n</li>\n<li id=\"fn-14\">\n<p>CRT initialization <a href=\"https://learn.microsoft.com/ja-jp/cpp/c-runtime-library/crt-initialization?view=msvc-170\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">https://learn.microsoft.com/ja-jp/cpp/c-runtime-library/crt-initialization?view=msvc-170</a></p>\n<a href=\"#fnref-14\" class=\"footnote-backref\">↩</a>\n</li>\n</ol>\n</div>","fields":{"slug":"/magical-windbg-vol1-04-en","tagSlugs":["/tag/magical-win-dbg/","/tag/windows/","/tag/win-dbg/","/tag/english/"]},"frontmatter":{"date":"2023-11-15","description":"This is the web edition of Magical WinDbg - Enjoying Windows Dump Analysis and Troubleshooting by Feel - VOL.1, distributed at Tech Book Fest 15.","tags":["Magical WinDbg","Windows","WinDbg","English"],"title":"Magical WinDbg VOL.1 [Chapter 4: Analyzing Application Crash Dumps]","socialImage":{"publicURL":"/static/2dbf3e09d59db889dc9dc41adcc8e827/magical-windbg-vol1.png"}}}},"pageContext":{"slug":"/magical-windbg-vol1-04-en"}},"staticQueryHashes":["251939775","401334301","825871152"]}