{"componentChunkName":"component---src-templates-post-template-js","path":"/magical-windbg-vol2-01-en","result":{"data":{"markdownRemark":{"id":"4ef73994-843b-57ef-87ea-eecdcdfd6c96","html":"<blockquote>\n<p>This page has been machine-translated from the <a href=\"/magical-windbg-vol2-01\">original page</a>.</p>\n</blockquote>\n<p>This chapter explains the environment setup procedure used in this book.</p>\n<p>Execution and debugging of the binaries used in this book assume that you will use a virtual machine.</p>\n<p>I recommend using Hyper-V, which is included with the Pro editions of Windows 10/11.</p>\n<p>However, even when using the Home edition of Windows 10/11, you can still create a virtual machine by using third-party virtualization applications such as VirtualBox or VMware.</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=\"#about-the-environment-used-in-this-book\">About the Environment Used in This Book</a></li>\n<li><a href=\"#create-the-virtual-machine\">Create the Virtual Machine</a></li>\n<li><a href=\"#set-up-the-virtual-machine\">Set Up the Virtual Machine</a></li>\n<li><a href=\"#install-windbg\">Install WinDbg</a></li>\n<li><a href=\"#install-debugging-tools-for-windows\">Install Debugging Tools for Windows</a></li>\n<li><a href=\"#install-sysinternals-utilities\">Install Sysinternals Utilities</a></li>\n<li><a href=\"#register-the-symbol-server-in-windbg-and-sysinternals\">Register the Symbol Server in WinDbg and Sysinternals</a></li>\n<li><a href=\"#install-ghidra-1102\">Install Ghidra 11.0.2</a></li>\n<li><a href=\"#install-binary-ninja\">Install Binary Ninja</a></li>\n<li><a href=\"#install-other-analysis-tools\">Install Other Analysis Tools</a></li>\n<li><a href=\"#prepare-for-kernel-debugging-with-windbg\">Prepare for Kernel Debugging with WinDbg</a></li>\n<li><a href=\"#perform-kernel-debugging-over-the-network\">Perform Kernel Debugging over the Network</a></li>\n<li><a href=\"#download-the-target-programs\">Download the Target Programs</a></li>\n<li><a href=\"#links-to-each-chapter\">Links to Each Chapter</a></li>\n</ul>\n<h2 id=\"about-the-environment-used-in-this-book\" style=\"position:relative;\"><a href=\"#about-the-environment-used-in-this-book\" aria-label=\"about the environment used in this book 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>About the Environment Used in This Book</h2>\n<p>The content of this book has been verified in the following environment.</p>\n<p>OS : Windows 10 Pro 22H2</p>\n<p>Because this book assumes that you will prepare a virtual machine, I recommend using a system with at least an Intel Core i3 CPU and at least 8 GB of RAM so that you can work reasonably comfortably.</p>\n<h2 id=\"create-the-virtual-machine\" style=\"position:relative;\"><a href=\"#create-the-virtual-machine\" aria-label=\"create the virtual machine 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>Create the Virtual Machine</h2>\n<p>This book does not explain the detailed procedure for installing a virtual machine.</p>\n<p>If you are using Windows 10/11 Pro, Enterprise, or Education, I recommend using Hyper-V, which is available free of charge.</p>\n<p>For instructions on enabling Hyper-V and creating a virtual machine, you can follow the official documentation below.</p>\n<br>\n<p>Install Hyper-V on Windows 10:</p>\n<p><a href=\"https://learn.microsoft.com/ja-jp/virtualization/hyper-v-on-windows/quick-start/enable-hyper-v\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">https://learn.microsoft.com/ja-jp/virtualization/hyper-v-on-windows/quick-start/enable-hyper-v</a></p>\n<br>\n<p>If your current OS edition is Windows 10/11 Home, you cannot use Hyper-V.</p>\n<p>In that case, you can use a virtual machine platform such as VirtualBox, which can be installed for free. (At least at the time of writing, I confirmed that the then-latest version, VirtualBox 7.0.14, could be installed on Windows 10/11 Home and used to create virtual machines. However, because that version has been reported to contain known vulnerabilities that are easy to exploit, I recommend installing the latest available version whenever possible.)</p>\n<p>VirtualBox can be installed using the installer available from the download page below.</p>\n<br>\n<p>Download VirtualBox:</p>\n<p><a href=\"https://www.virtualbox.org/wiki/Downloads\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">https://www.virtualbox.org/wiki/Downloads</a></p>\n<br>\n<p>To install VirtualBox 7.0.14, you also need to run <code class=\"language-text\">vc_redist.x64.exe</code>, which can be downloaded from the URL below, and install the latest redistributable package.</p>\n<br>\n<p>vc_redist.x64.exe:</p>\n<p><a href=\"https://aka.ms/vs/17/release/vc_redist.x64.exe\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">https://aka.ms/vs/17/release/vc_redist.x64.exe</a></p>\n<br>\n<p>Once you have prepared a virtual machine platform such as Hyper-V or VirtualBox, create a Windows 10 virtual machine.</p>\n<p>In general, regardless of which virtualization platform you use, you start by installing the OS from an ISO image file for OS installation.</p>\n<p>When setting up the Windows virtual machine used for analysis in this book, use the evaluation-version OS ISO that can be downloaded below. (Downloading it requires entering an email address and other information.)</p>\n<p>After installing the evaluation OS, you can use the full functionality of Windows 10 for 90 days after installation.</p>\n<br>\n<p>Windows 10 Enterprise (Evaluation):</p>\n<p><a href=\"https://www.microsoft.com/ja-jp/evalcenter/evaluate-windows-10-enterprise\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">https://www.microsoft.com/ja-jp/evalcenter/evaluate-windows-10-enterprise</a></p>\n<br>\n<h2 id=\"set-up-the-virtual-machine\" style=\"position:relative;\"><a href=\"#set-up-the-virtual-machine\" aria-label=\"set up the virtual machine 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>Set Up the Virtual Machine</h2>\n<p>Once the virtual machine for running the program to be analyzed is ready, perform the setup needed to install the device driver and do kernel debugging.</p>\n<p>First, run the following three commands in a Command Prompt started with administrator privileges, and then reboot the OS.</p>\n<div class=\"gatsby-highlight\" data-language=\"powershell\"><pre class=\"language-powershell\"><code class=\"language-powershell\">bcdedit <span class=\"token operator\">/</span><span class=\"token function\">set</span> testsigning on\nbcdedit <span class=\"token operator\">/</span>debug on\nbcdedit <span class=\"token operator\">/</span>dbgsettings serial debugport:1 baudrate:115200</code></pre></div>\n<p>Running these commands enables installation of the test-signed driver <sup id=\"fnref-1\"><a href=\"#fn-1\" class=\"footnote-ref\">1</a></sup> and kernel debugging over a COM port <sup id=\"fnref-2\"><a href=\"#fn-2\" class=\"footnote-ref\">2</a></sup> on the target virtual machine.</p>\n<p>On systems since Windows Vista, all drivers installed on the system must have a valid signature. In particular, on systems running Windows 10 version 1607 or later, drivers must have a valid signature issued by Microsoft.<sup id=\"fnref-3\"><a href=\"#fn-3\" class=\"footnote-ref\">3</a></sup> <sup id=\"fnref-4\"><a href=\"#fn-4\" class=\"footnote-ref\">4</a></sup></p>\n<p>However, if you run <code class=\"language-text\">bcdedit /set testsigning on</code> on Windows to enable installation of test-signed drivers, you can install drivers signed with a test self-signed certificate or similar means.</p>\n<p>For that reason, you need to enable test-signing mode in order to install and run the kernel driver used in this book on the system.</p>\n<p>When test-signing mode is enabled on the system, “Test Mode” is displayed in the lower-right corner of the desktop, 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: 656px; \"\n    >\n      <a\n    class=\"gatsby-resp-image-link\"\n    href=\"/static/9ac4f2c13d5437ca339955668c281b3b/748f4/test-signing-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,iVBORw0KGgoAAAANSUhEUgAAABQAAAAPCAYAAADkmO9VAAAACXBIWXMAAA7DAAAOwwHHb6hkAAAD0ElEQVQ4y02SfUzUdRzHv9/fA5synWN0M+ThwBsuZbY2V241Q0FAQBFMCmHTaGW4mLaVth4otzQ3J3rj+e7gHro7QJzZCpJOSG9hJlLqrBVWC4I0ezB5vjvOd+/f5h/98dn39/vj9/q93p/3V8gPpyHd0xBtPO2cJk79DKR1FvJ4CEptBFptFDHHo4itj2JJyzzi6iLQq0JQn/0NWtE1aJu+grbxAvSsPgjhJ8AzBeGcgnTwuYXTyB/UcawziHeFkeyPIskXQdqpKCyf3EfqmXnEVIehlhrAqwReJPA8tA0GsJ02Xn7snoRonSSQZwNPK8/aCSx1h5DmvY/EtjDM7nmkGXDPPPTdE1C3D0PfcgVa3pfQsr8gMEBg5yyEbwbCsGwjxDYB2cCx3oM4dg8m2yySHWEkNM0hqZlQWwTL6uegV45C3ca4my8RGCSwD9r6zwk8OQfR8QDqom0rx8Zp5Hv9LBJ887B0ACmeCFK9USxvB5IcIei7bkIrod3mAQIvEHgOWqYBPB2B6AoTytMX5j4jkIwn7SHI5hAWtU7hIfskTC0TSLRPweygacM09J03oBV/Da2QcXMZN8sA9hL4EWFdtGxnq0bjTu7P9i/3+DfEiT8hjv4Bcfh3iIPjUN8eQ8yBUSyoHoZWNkQgyygM/g94lsBTjNbJ/fkmGJkgx12a/cW4dyBrb0MeGYd8bwTK/p+gvPI9ZOW3UHZcZsPc3VbaFTBuTj+vTOABsIsNd7AML0tw3YWw/0M7A3YL8oNRyHd/gXxjGHLfd1D2XIPywhDUisvQSmm3lXYFvC65LCSrF9rTPQaQsHbaeWjXypjNd3j/bjHqGOShXyFqbkIe+AHKvhtQqq5CqbwCtZx221lGEe3y+2kYgL7hLIHdxrUhyEsrF2PaCWsk7MQYgSOQ79PuHdrtZ9S916G8zLjPM2457Z4JQi/i7vLPQc/phbq+B8q6Twn0EeTm4ltvQ7Rw+XU0O0bYkZ8hD/4I+RZhr12HrP4GykuDUHZdhFoWhFLSD6UgACWPsOzPEJvTg9hsw/Akd+hnKR7GdtC0ic1a+YOj4xCHRhjZ2CFjv8rYVQRXDkGyFFPlINJ3D8K88xLM5QNIrxiA5bkghHr4PE36oNQEIGv6ob7Zi5jXu6Hv7Ya252NoL56BqOiELPVD2eaHWuyHvsmJhBIXVu3wwlLiRHqxE+Z8G1JyWyDiV67BwtQMLEp5BMqafCx9Yi0yHl+NtXlb8Oi6jXgssxBicRJE7MNYkP4UEjPLYErOgLbEjPjk1YhbtgqWjCex2LQCC+OW4z8vHLJ2Mm1Q5QAAAABJRU5ErkJggg=='); background-size: cover; display: block;\"\n  ></span>\n  <picture>\n          <source\n              srcset=\"/static/9ac4f2c13d5437ca339955668c281b3b/8ac56/test-signing-001.webp 240w,\n/static/9ac4f2c13d5437ca339955668c281b3b/d3be9/test-signing-001.webp 480w,\n/static/9ac4f2c13d5437ca339955668c281b3b/31099/test-signing-001.webp 656w\"\n              sizes=\"(max-width: 656px) 100vw, 656px\"\n              type=\"image/webp\"\n            />\n          <source\n            srcset=\"/static/9ac4f2c13d5437ca339955668c281b3b/8ff5a/test-signing-001.png 240w,\n/static/9ac4f2c13d5437ca339955668c281b3b/e85cb/test-signing-001.png 480w,\n/static/9ac4f2c13d5437ca339955668c281b3b/748f4/test-signing-001.png 656w\"\n            sizes=\"(max-width: 656px) 100vw, 656px\"\n            type=\"image/png\"\n          />\n          <img\n            class=\"gatsby-resp-image-image\"\n            src=\"/static/9ac4f2c13d5437ca339955668c281b3b/748f4/test-signing-001.png\"\n            alt=\"After enabling test-signing mode\"\n            title=\"After enabling test-signing mode\"\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>Note that when test-signing mode is enabled, you can install drivers that do not have a Microsoft signature, which creates the risk that a malicious driver could be installed on the system.</p>\n<p>Therefore, be sure to enable test-signing mode only inside a virtual machine.</p>\n<h2 id=\"install-windbg\" style=\"position:relative;\"><a href=\"#install-windbg\" aria-label=\"install 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>Install WinDbg</h2>\n<p>To analyze the program, install the latest version of WinDbg on your computer.</p>\n<p>Because kernel debugging will be performed, be sure to install WinDbg on the host machine that manages the virtual machine.</p>\n<p>Of course, there is no problem with also installing it inside the virtual machine for user-mode debugging.</p>\n<p>If your environment can use the WinGet package manager, you can easily install the latest WinDbg by running the following command in Command Prompt or PowerShell.</p>\n<div class=\"gatsby-highlight\" data-language=\"powershell\"><pre class=\"language-powershell\"><code class=\"language-powershell\">winget install Microsoft<span class=\"token punctuation\">.</span>WinDbg</code></pre></div>\n<p>If you cannot use the WinGet package manager, download the WinDbg installer from the URL below and install WinDbg manually.</p>\n<br>\n<p>Install the Windows debugger:</p>\n<p><a href=\"https://learn.microsoft.com/ja-jp/windows-hardware/drivers/debugger/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">https://learn.microsoft.com/ja-jp/windows-hardware/drivers/debugger/</a></p>\n<br>\n<h2 id=\"install-debugging-tools-for-windows\" style=\"position:relative;\"><a href=\"#install-debugging-tools-for-windows\" aria-label=\"install debugging tools for windows 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>Install Debugging Tools for Windows</h2>\n<p>Next, install Debugging Tools for Windows on the machine where you will perform the analysis.</p>\n<p>Debugging Tools for Windows includes debuggers such as WinDbg Classic <sup id=\"fnref-5\"><a href=\"#fn-5\" class=\"footnote-ref\">5</a></sup> and tools such as GFlags <sup id=\"fnref-6\"><a href=\"#fn-6\" class=\"footnote-ref\">6</a></sup> that are useful for troubleshooting Windows environments.</p>\n<p>There are several ways to install Debugging Tools for Windows, but in this book we use the Windows SDK (10.0.22621) to install it.</p>\n<p>First, go to the Windows SDK download page at the URL below and download winsdksetup.exe from [Download the installer].</p>\n<br>\n<p>Windows SDK:</p>\n<p><a href=\"https://developer.microsoft.com/ja-jp/windows/downloads/windows-sdk/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">https://developer.microsoft.com/ja-jp/windows/downloads/windows-sdk/</a></p>\n<br>\n<p>Next, double-click the downloaded winsdksetup.exe and run it.</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/4243068539b87bc45f865df668fc4dde/0b533/winsdksetup-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: 73.75%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAPCAYAAADkmO9VAAAACXBIWXMAAA7EAAAOxAGVKw4bAAABsUlEQVQ4y51U2W7CMBDk/78NwQMVEk8IEo6Q20lIyDXdWce0pQi1WFpsb5z1HBtm+8MBaZIiiRNEYSxzKvsEYRgijmOEUYgsy9C27dO43W6o6xp93+s7My6yNEUUxTDGaJFxHPHOKMsSs67rcLlcNFj0fD5jGIZ/FXIAiqKwCBmdRNt2SuN6vaKqGJXSqa+15GrN6762a+Z4uQNwL2hMjuPxKChDTRoJnSVPGsW0Lwqjs80ZeV78QKoFWZ2Qfd9DEAQweS46JmJEjlS07Xt5PtEiMzvbNQel2mw2aggZKULS5IY305jvwRwpUgJHWyVhlJVcmuEonZILEC1IhNxst1ttD0vVKG3OueRYwOSWLhmwENfsDl5SVaWCUpdZkBu6GwRnvZkch95K4UR30jwOx5DvaEEmeLBpGuviRMtJ4AwpixLuLIu77uAZ6kikd4S99CINIGUGJSDd4QHROMmjiJ6MyeVRDtzgeR58z8d+t1OXaYTrL0e1aWqcTid9Bnw5/qsPX30Bj/FqqMt4cxAVC7g2oob8H5jxh7pRw78Gz/PLWiwWWK0+sF6vMZ/PsVwu8QktAI2JUKzRxQAAAABJRU5ErkJggg=='); background-size: cover; display: block;\"\n  ></span>\n  <picture>\n          <source\n              srcset=\"/static/4243068539b87bc45f865df668fc4dde/8ac56/winsdksetup-001.webp 240w,\n/static/4243068539b87bc45f865df668fc4dde/d3be9/winsdksetup-001.webp 480w,\n/static/4243068539b87bc45f865df668fc4dde/b0a15/winsdksetup-001.webp 500w\"\n              sizes=\"(max-width: 500px) 100vw, 500px\"\n              type=\"image/webp\"\n            />\n          <source\n            srcset=\"/static/4243068539b87bc45f865df668fc4dde/8ff5a/winsdksetup-001.png 240w,\n/static/4243068539b87bc45f865df668fc4dde/e85cb/winsdksetup-001.png 480w,\n/static/4243068539b87bc45f865df668fc4dde/0b533/winsdksetup-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/4243068539b87bc45f865df668fc4dde/0b533/winsdksetup-001.png\"\n            alt=\"Installing Debugging Tools for Windows\"\n            title=\"Installing Debugging Tools for Windows\"\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>By following the installer’s instructions with the default settings, you will eventually reach a screen where you choose which packages to install.</p>\n<p>It does not matter which items you download here, but make sure that [Debugging Tools for Windows] is checked.</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/18062a9c40ea76c2449d9f48fc9ad448/0b533/winsdksetup-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: 73.75%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAPCAYAAADkmO9VAAAACXBIWXMAAA7EAAAOxAGVKw4bAAABwElEQVQ4y41T13LDMAzz//9e+5TUo/Xe2/FGCTlO7euK7hDKCgWSIKUFSYauH9HeesEg+wG3YfvmnrYfJ0zLimGcMUxn8D9iENBfW5cFeZYhy3Nl0yRBWZZomgZlkaMqK8RRjKqqoNa64q+lTdME0zDwbr3DEui6IdaCLmemZSIvCviej7pufiVZJcgOjQd9f4PruvB9H2EYwiNBU58uxXECQ4IEweaT55n4eUiS9ESsCLuukwwt2LYNz/Vgf3ygkMx2p0VkSUQK13WQpqnypyS0XdviJrbv+61k/gzDAE+yY4ZBEKjI3GdZri6SNE1iCebCcRw4d8s7dV2jvZM/CMdxRBRFCls5Bajtrsuz61EyM2RmRVGq1JcDyU54FP43nEu+l0liYm/Srs1/RCfCR8nxVnYqnWMTeP5Tlj/vtxk9ZPjVlJBZsiky7M9mp3AsmZnFcfwAx4YNYnP+a8S3plAnakYdPW+znDeejeNGyAA8o+UzLKWBk7xlLn7vc6sI53lGKwNKdF2rhpVB+NymebsURSEcGfzr9apeTMb3L6C/49i4XC9qFrVn5uzoQ51NwxStQ7y8vkiAi5JGf9NVZZ/hlYjYXXFasgAAAABJRU5ErkJggg=='); background-size: cover; display: block;\"\n  ></span>\n  <picture>\n          <source\n              srcset=\"/static/18062a9c40ea76c2449d9f48fc9ad448/8ac56/winsdksetup-002.webp 240w,\n/static/18062a9c40ea76c2449d9f48fc9ad448/d3be9/winsdksetup-002.webp 480w,\n/static/18062a9c40ea76c2449d9f48fc9ad448/b0a15/winsdksetup-002.webp 500w\"\n              sizes=\"(max-width: 500px) 100vw, 500px\"\n              type=\"image/webp\"\n            />\n          <source\n            srcset=\"/static/18062a9c40ea76c2449d9f48fc9ad448/8ff5a/winsdksetup-002.png 240w,\n/static/18062a9c40ea76c2449d9f48fc9ad448/e85cb/winsdksetup-002.png 480w,\n/static/18062a9c40ea76c2449d9f48fc9ad448/0b533/winsdksetup-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/18062a9c40ea76c2449d9f48fc9ad448/0b533/winsdksetup-002.png\"\n            alt=\"Selecting Debugging Tools for Windows\"\n            title=\"Selecting Debugging Tools for Windows\"\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>Run the installer with [Debugging Tools for Windows] checked.</p>\n<p>After installation completes, confirm that windbg.exe and gflags.exe are present in <code class=\"language-text\">C:\\Program Files (x86)\\Windows Kits\\10\\Debuggers\\x64</code>.</p>\n<p>The <code class=\"language-text\">windbg.exe</code> that can be installed through the Windows SDK is the traditional debugger, also known as WinDbg Classic.</p>\n<p>The latest version of WinDbg and WinDbg Classic use the same debugger commands and windows, but the latest version of WinDbg provides powerful debugger features such as JavaScript debugger scripts and Time Travel Debugging (TTD).</p>\n<p>In this book, we use the latest version of WinDbg installed in the [Install WinDbg] section above rather than WinDbg Classic.</p>\n<h2 id=\"install-sysinternals-utilities\" style=\"position:relative;\"><a href=\"#install-sysinternals-utilities\" aria-label=\"install sysinternals utilities 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>Install Sysinternals Utilities</h2>\n<p>Note: Sysinternals utilities are not used in this book, so installing them is optional.</p>\n<p>Next, download Sysinternals <sup id=\"fnref-9\"><a href=\"#fn-9\" class=\"footnote-ref\">9</a></sup>, which includes useful tools such as Process Monitor <sup id=\"fnref-7\"><a href=\"#fn-7\" class=\"footnote-ref\">7</a></sup> and Process Explorer <sup id=\"fnref-8\"><a href=\"#fn-8\" class=\"footnote-ref\">8</a></sup>.</p>\n<p>This book does not go into detail about these tools.</p>\n<p>If you want to learn more, the official documentation or “Windows Sysinternals徹底解説” <sup id=\"fnref-10\"><a href=\"#fn-10\" class=\"footnote-ref\">10</a></sup>, for example, should be helpful.</p>\n<p>To install these tools all at once, visit the URL below and click [Sysinternals Suite].</p>\n<br>\n<p>Sysinternals Utilities:</p>\n<p><a href=\"https://learn.microsoft.com/ja-jp/sysinternals/downloads/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">https://learn.microsoft.com/ja-jp/sysinternals/downloads/</a></p>\n<br>\n<p>By extracting the ZIP file downloaded there, you will be able to use tools such as Process Monitor and Process Explorer.</p>\n<h2 id=\"register-the-symbol-server-in-windbg-and-sysinternals\" style=\"position:relative;\"><a href=\"#register-the-symbol-server-in-windbg-and-sysinternals\" aria-label=\"register the symbol server in windbg and sysinternals 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>Register the Symbol Server in WinDbg and Sysinternals</h2>\n<p>When using WinDbg or Process Monitor (Procmon) for troubleshooting, obtaining the correct symbols is extremely important.</p>\n<p>Symbols <sup id=\"fnref-11\"><a href=\"#fn-11\" class=\"footnote-ref\">11</a></sup> are information such as the names of functions and variables that are not included in executable files such as exe and dll files.</p>\n<p>When using tools such as WinDbg, obtaining and referencing the correct symbols makes analysis much smoother.</p>\n<p>In general, the symbol information used for analyzing dump files can be obtained from Microsoft’s public symbol server <sup id=\"fnref-12\"><a href=\"#fn-12\" class=\"footnote-ref\">12</a></sup>.</p>\n<p>However, symbol information for some non-public modules and symbol information for software independently developed by third parties cannot be downloaded from Microsoft’s public symbol server.</p>\n<p>If the program being analyzed was developed by the user, pdb or dbg files generated when the program is built can be loaded into the debugger and used as symbol information.</p>\n<p>In this section, we configure WinDbg and Process Monitor so that they can retrieve symbols from Microsoft’s public symbol server.</p>\n<p>Although this book does not use it, you may also want to apply the same configuration to Process Explorer if necessary.</p>\n<p>To configure the symbol server, start WinDbg with administrator privileges and open [File] > [Settings] > [Debugging Settings].</p>\n<p>Enter the following in [Default Symbol Path] in the window that appears, and click [OK].</p>\n<div class=\"gatsby-highlight\" data-language=\"powershell\"><pre class=\"language-powershell\"><code class=\"language-powershell\">srv*https:<span class=\"token operator\">/</span><span class=\"token operator\">/</span>msdl<span class=\"token punctuation\">.</span>microsoft<span class=\"token punctuation\">.</span>com/download/symbols</code></pre></div>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 878px; \"\n    >\n      <a\n    class=\"gatsby-resp-image-link\"\n    href=\"/static/64f5510165051b2d259d74a7768ff263/94829/windbg-symbol-setting-01.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: 78.33333333333333%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAQCAYAAAAWGF8bAAAACXBIWXMAAA7DAAAOwwHHb6hkAAACiklEQVQ4y41UTW/TQBANd+5ISBTuRYh/Vz5uVOVCBTeu/BMQlyKRpqjigtQk/khsx3acxN92bOcxbzduC+WApZdde2fezryZyeD0s4mPZy4+fbMx9SLkaYK8KFCWJQpZ/wd5niNNU2RZhsH9N5d4cDzE158mPD9EHCdYrdZYrzfKIE33kH22B9+TJL0GfdbrtfIb3Hs9wuG7EQx7jixJkIgxb6RRGIZYLBaIokhFkMh5HMeKhBn0KAq9bjYxBoOX53j+4Qd+jU3MZzZ8P0DTNGJQwXVd2LYNb+EhCAKEAp7zIpLzEl5Asq7rVOSK8OnpBSa2g0Ci4Uc+VVVjuVwqZ0ZLAsrA1AhGzfNeGuI6QhIacw/RMkQoRlVVYbttUNe12nPV2ulU+Y3gntnsdhDs9hG+GuHZ+wtESaki4wFR11u0bavAdIJlBHfhS3GkqiJHXlTIqF21xbbpsG13ksWe8PB0hDDOFWF3i7CqKHiu2ijNSyHLUQhZoQhLZHmBSuzoI5yIFeGLczx5O8QyKe4Q9inz8YMQs7kjTqmQNGIHtPLTtBJd0wphH+HREI9OhpLyDWFfFLYMhWcbbTYb0VgXifuchdg3M89vinJ0joOTuxGyKL7vwzAMOM4cpmmpFlKwLHk3MZUzwzAxmUykmKEQFzrCg78i7An7cer7sq9uDy1JrRqbhctE42vCf2moJyZWoHMret2ufL8neJ6mtwjD+E8NaeB5HizLhCHpMX1qGkhxODXc8xs1jlar/Z9EqQkfC2Gc6T7supuUORF04riRnHpRQ0s0tGTVU6QzoE+WFbooD4+/48uliZnjy/xqOM5CwXVJFqi9LePZYzbz1Pe5TNh4PMF0auLqaozfNWqcrSUVJjQAAAAASUVORK5CYII='); background-size: cover; display: block;\"\n  ></span>\n  <picture>\n          <source\n              srcset=\"/static/64f5510165051b2d259d74a7768ff263/8ac56/windbg-symbol-setting-01.webp 240w,\n/static/64f5510165051b2d259d74a7768ff263/d3be9/windbg-symbol-setting-01.webp 480w,\n/static/64f5510165051b2d259d74a7768ff263/6749f/windbg-symbol-setting-01.webp 878w\"\n              sizes=\"(max-width: 878px) 100vw, 878px\"\n              type=\"image/webp\"\n            />\n          <source\n            srcset=\"/static/64f5510165051b2d259d74a7768ff263/8ff5a/windbg-symbol-setting-01.png 240w,\n/static/64f5510165051b2d259d74a7768ff263/e85cb/windbg-symbol-setting-01.png 480w,\n/static/64f5510165051b2d259d74a7768ff263/94829/windbg-symbol-setting-01.png 878w\"\n            sizes=\"(max-width: 878px) 100vw, 878px\"\n            type=\"image/png\"\n          />\n          <img\n            class=\"gatsby-resp-image-image\"\n            src=\"/static/64f5510165051b2d259d74a7768ff263/94829/windbg-symbol-setting-01.png\"\n            alt=\"Configuring the Default Symbol Path window\"\n            title=\"Configuring the Default Symbol Path 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>Next, run Procmon64.exe with administrator privileges from the SysinternalsSuite obtained in the [Install Sysinternals Utilities] section.</p>\n<p>From the menu at the top of the Procmon window, click [Options] > [Configure Symbols…].</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/e9eeba7b98afd8eed8b01bc6b167546c/0b533/procmon-symbol-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: 60%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAMCAYAAABiDJ37AAAACXBIWXMAAA7EAAAOxAGVKw4bAAAB40lEQVQoz5VT226bQBDl/6VIVfPQh771H6JWauRGSdTkoQ8pvgEmLra57bLscgkYDPh0IHHrtFWbjnQ4EuyemTMzaGaQQsYRokggTRJEQkAIBcNLYbsSSkq0XYd/xn4/kCa4QMwyiDjGauMhZwFmboiTTwne3UQIfQ8PRYGyLH+g2m7hshgOSxDyEG3bkN6euIVmLxywVQFntYJpLVGul9AJPPCwWTvYuD4YJwciBicXjKCUwujmDme3Or7MbilJgS0l6ciJVlUVtlU5HOozt5SpooqSyMdiqiPyVshiqqJM0BTqCdQKwbGlavuo6xp5nj9a/lM76qbFxVziw12ISzPBpZXifJbiI+F8nuL9WOFbIIez3VF/e9ta/zhGH0XV4O1nhVcjjtMRw5trhdOrHK+vMuIMJxcZJmvVS6Db49ld7aB8/LKj5uYyhO9YcJcmioSj7a0+yCfEyBKJx9M/7/1m+fChnxbnHKZhwTAXcL0AsUwgpCJWA0upcFzMXwV3TYO1F+L+fgnHcWDbNhjjtKvRkIgxRoLy5YL1roHtbDCZTKDrOibjMfSvOizLgkd7GQbhsBUvFuwnx8IAxtyAYRiYE0+nU/i+j5h+gL7K/xI8bH23754NrKFW7Ha7AYd1+VXwO/1tk6Gq5q4FAAAAAElFTkSuQmCC'); background-size: cover; display: block;\"\n  ></span>\n  <picture>\n          <source\n              srcset=\"/static/e9eeba7b98afd8eed8b01bc6b167546c/8ac56/procmon-symbol-001.webp 240w,\n/static/e9eeba7b98afd8eed8b01bc6b167546c/d3be9/procmon-symbol-001.webp 480w,\n/static/e9eeba7b98afd8eed8b01bc6b167546c/b0a15/procmon-symbol-001.webp 500w\"\n              sizes=\"(max-width: 500px) 100vw, 500px\"\n              type=\"image/webp\"\n            />\n          <source\n            srcset=\"/static/e9eeba7b98afd8eed8b01bc6b167546c/8ff5a/procmon-symbol-001.png 240w,\n/static/e9eeba7b98afd8eed8b01bc6b167546c/e85cb/procmon-symbol-001.png 480w,\n/static/e9eeba7b98afd8eed8b01bc6b167546c/0b533/procmon-symbol-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/e9eeba7b98afd8eed8b01bc6b167546c/0b533/procmon-symbol-001.png\"\n            alt=\"Configure Symbols settings\"\n            title=\"Configure Symbols settings\"\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>By default, <code class=\"language-text\">C:\\WINDOWS\\SYSTEM32\\dbghelp.dll</code> is registered for [DbgHelp.dll path(version 6.0 or later)].</p>\n<p>However, <code class=\"language-text\">C:\\WINDOWS\\SYSTEM32\\dbghelp.dll</code> usually does not satisfy the requirement of version 6.0 or later, so you need to specify the path to a dbghelp.dll that does.</p>\n<p>A dbghelp.dll that meets that requirement is located directly under <code class=\"language-text\">C:\\Program Files (x86)\\Windows Kits\\10\\Debuggers\\x64</code>, alongside WinDbg x64 and the other tools installed in the [Install Debugging Tools for Windows] section.</p>\n<p>Therefore, specify the following path for [DbgHelp.dll path(version 6.0 or later)].</p>\n<div class=\"gatsby-highlight\" data-language=\"powershell\"><pre class=\"language-powershell\"><code class=\"language-powershell\">C:\\Program Files <span class=\"token punctuation\">(</span>x86<span class=\"token punctuation\">)</span>\\Windows Kits\\10\\Debuggers\\x64\\dbghelp<span class=\"token punctuation\">.</span>dll</code></pre></div>\n<p>Also, for [Symbol paths:], specify the same Microsoft symbol server address you used for WinDbg.</p>\n<div class=\"gatsby-highlight\" data-language=\"powershell\"><pre class=\"language-powershell\"><code class=\"language-powershell\">srv*https:<span class=\"token operator\">/</span><span class=\"token operator\">/</span>msdl<span class=\"token punctuation\">.</span>microsoft<span class=\"token punctuation\">.</span>com/download/symbols</code></pre></div>\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/6c17ed61bf717d4b603ba711b9911bc9/0b533/procmon-symbol-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: 81.25%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAQCAYAAAAWGF8bAAAACXBIWXMAAA7EAAAOxAGVKw4bAAACnUlEQVQ4y3VU2XLaQBDk/78pD3lIpVKxMWAQkpDQfcs60I0EdGYWbJzgbFXX7K52e6fn0EwLCzRtjbquMfQdqrZFT+i6HnXboe1anC8Q43LGl+N8PuN0Ogk7C4MI5duA8nCA7fhoogBOnsK1DVSBi7c0R5H5KIsc3bGElNRQwwg7N4LspLA8m8gmXOhRJp0pqoHYaWCYFtTdHr3vQKZD86dfqOw9HMeDbUjI6ZF+yPHdLvBsufi5lPHtaYOVNkdHipqmJdILZv0wkKsTsixHFIZIyIZegCwvyKMjWjpc1y3GcUTfD7iMdH6acOx7NNWBwnBBkiQoy1LIn03TSUyapkEcRYgIcZyIdUUXquoa3wOFRNiqEvPDoaJvV+R5Lr4Jwn6cxIQPbSUJm/UG69UrFosFVssVXmm+XCyxfFngZT6HvJVhGAZ0TYdpmvD9gByIxX1BOE5XQn7J2O8JhrB84X3uui5cx6F4XsFrx3YoYW9CCUt+JKQNVVEgrSXI0lZ4y97w3LZt+J5P3viCyCUUFGOWWRSFeOCDcPiQXEFVd1iTZNMigiAUCKhEPJJl0Z5LpLzmfU5aSXfY2vQAK/yLkD+qpg/F8KA5EXQ3xp7hJWLNMMMMWTsia0ak9UA4Ii5bWKTggZBd1nYathsJ0oYkbxkyhUEV0nfkvSIrYs7hkOjclsKhqqoIxQMhb3DWOBF7fQ+P4vIet7v14P2DgMLBpXaP4a0OecNzPVECTMD1xhmsm/pmG2F76m3uebZd19F/oBFJuXv4iZALVFym7FUfBXwFFzn3uxdn1L+UsCRHmqaijCzLeiTkDZYQUvsFQSDsZ3Bben6I35KJHy8KnmULuq5Bonjqun4nPN4I+U/R3GT9D+0Xknvqae53vs/jD/VFshBwppCnAAAAAElFTkSuQmCC'); background-size: cover; display: block;\"\n  ></span>\n  <picture>\n          <source\n              srcset=\"/static/6c17ed61bf717d4b603ba711b9911bc9/8ac56/procmon-symbol-002.webp 240w,\n/static/6c17ed61bf717d4b603ba711b9911bc9/d3be9/procmon-symbol-002.webp 480w,\n/static/6c17ed61bf717d4b603ba711b9911bc9/b0a15/procmon-symbol-002.webp 500w\"\n              sizes=\"(max-width: 500px) 100vw, 500px\"\n              type=\"image/webp\"\n            />\n          <source\n            srcset=\"/static/6c17ed61bf717d4b603ba711b9911bc9/8ff5a/procmon-symbol-002.png 240w,\n/static/6c17ed61bf717d4b603ba711b9911bc9/e85cb/procmon-symbol-002.png 480w,\n/static/6c17ed61bf717d4b603ba711b9911bc9/0b533/procmon-symbol-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/6c17ed61bf717d4b603ba711b9911bc9/0b533/procmon-symbol-002.png\"\n            alt=\"Setting the symbol server in Procmon\"\n            title=\"Setting the symbol server in Procmon\"\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 completes the symbol server configuration.</p>\n<h2 id=\"install-ghidra-1102\" style=\"position:relative;\"><a href=\"#install-ghidra-1102\" aria-label=\"install ghidra 1102 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>Install Ghidra 11.0.2</h2>\n<p>Note: Ghidra 11.0.2 is not used in this book, so installing it is optional.</p>\n<p>Next, set up the reverse engineering tool Ghidra 11.0.2.</p>\n<p>This book does not explain Ghidra itself or how to use it in detail, but the built-in Help and books such as a practical guide to Ghidra <sup id=\"fnref-13\"><a href=\"#fn-13\" class=\"footnote-ref\">13</a></sup> and a comprehensive guide to mastering Ghidra <sup id=\"fnref-14\"><a href=\"#fn-14\" class=\"footnote-ref\">14</a></sup> should be useful references.</p>\n<p>To set up Ghidra, download the Ghidra 11.0.2 package (<code class=\"language-text\">ghidra_11.0.2_PUBLIC_20240326.zip</code>) from the GitHub Releases page below and extract it.</p>\n<br>\n<p>Ghidra Release Page:</p>\n<p><a href=\"https://github.com/NationalSecurityAgency/ghidra/releases\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">https://github.com/NationalSecurityAgency/ghidra/releases</a></p>\n<br>\n<p>Next, download the Windows x64 MSI Installer from the page below in order to install JDK 17, which is required to run Ghidra.</p>\n<br>\n<p>Java Downloads:</p>\n<p><a href=\"https://www.oracle.com/jp/java/technologies/downloads/#jdk17-windows\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">https://www.oracle.com/jp/java/technologies/downloads/#jdk17-windows</a></p>\n<br>\n<p>Run the downloaded JDK 17 MSI installer and complete the installation of JDK 17.</p>\n<p>After installation is complete, launch Ghidra by double-clicking ghidraRun.bat in the extracted <code class=\"language-text\">ghidra_11.0.2_PUBLIC_20240326.zip</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/f4181953724ed3e06043574694a36498/0b533/ghidra-setup-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: 66.25%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAANCAYAAACpUE5eAAAACXBIWXMAAA7EAAAOxAGVKw4bAAABMElEQVQ4y52T646CMBBGef+H25hNjMqlC6VAkZugyx2+7dSA6x9vTU4CneF02g7G76XADCA/HhF4HqJIIggCFEWBvu/Rdd1TmqZBXdfI8xxGLrc4X1olCrHZfMM0TTDGtJQSsix7CSogDEMYRbxH109auNt+Ybfba4QIdGKapi9Bi7uuC+OU2KrkQU1kGIdal9+2rT6GeX4VygaklDAc28YPc1WFEa7Ty7h/ezTuhJz78FSptEUKfMoqXFahc5imaV3xY+EykSTJGvh0SBlfhTRIOI6jZhiGt6B+JQ/dwyrknMP3hbrtAqeyRFWdFdUTzmteWV1gMn4TRqopLcuCYzv6LKhRqbcecWvsVBfi8X9CCsRxfNeoz6At0h9F0DNznJuQZL7v66AQ4m3ou4Np4w8qFebNnCdcUQAAAABJRU5ErkJggg=='); background-size: cover; display: block;\"\n  ></span>\n  <picture>\n          <source\n              srcset=\"/static/f4181953724ed3e06043574694a36498/8ac56/ghidra-setup-001.webp 240w,\n/static/f4181953724ed3e06043574694a36498/d3be9/ghidra-setup-001.webp 480w,\n/static/f4181953724ed3e06043574694a36498/b0a15/ghidra-setup-001.webp 500w\"\n              sizes=\"(max-width: 500px) 100vw, 500px\"\n              type=\"image/webp\"\n            />\n          <source\n            srcset=\"/static/f4181953724ed3e06043574694a36498/8ff5a/ghidra-setup-001.png 240w,\n/static/f4181953724ed3e06043574694a36498/e85cb/ghidra-setup-001.png 480w,\n/static/f4181953724ed3e06043574694a36498/0b533/ghidra-setup-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/f4181953724ed3e06043574694a36498/0b533/ghidra-setup-001.png\"\n            alt=\"Setting up Ghidra\"\n            title=\"Setting up Ghidra\"\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>Once Ghidra has launched, create a project with any name from [File] > [New Project].</p>\n<h2 id=\"install-binary-ninja\" style=\"position:relative;\"><a href=\"#install-binary-ninja\" aria-label=\"install binary ninja 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>Install Binary Ninja</h2>\n<p>In addition to Ghidra, there are other strong options for analyzing Windows programs, including IDA and Binary Ninja.</p>\n<p>You can install Binary Ninja by downloading the free installer from [Download For Windows] at the URL below.</p>\n<br>\n<p>Binary Ninja 4.0 Free:</p>\n<p><a href=\"https://binary.ninja/free/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">https://binary.ninja/free/</a></p>\n<br>\n<p>For instructions on installing Binary Ninja and its basic operations, please refer to the official page at the link below.</p>\n<br>\n<p>Binary Ninja 4.0 Getting Started:</p>\n<p><a href=\"https://docs.binary.ninja/getting-started.html\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">https://docs.binary.ninja/getting-started.html</a></p>\n<br>\n<p>Incidentally, if you want to learn more about how to use Binary Ninja, I personally recommend the official YouTube channel of VECTOR 35, the company behind Binary Ninja.</p>\n<br>\n<p>YouTube VECTOR 35:</p>\n<p><a href=\"https://www.youtube.com/@Vector35\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">https://www.youtube.com/@Vector35</a></p>\n<br>\n<h2 id=\"install-other-analysis-tools\" style=\"position:relative;\"><a href=\"#install-other-analysis-tools\" aria-label=\"install other analysis tools 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>Install Other Analysis Tools</h2>\n<p>In addition to the tools introduced so far, this book uses PEStudio for analyzing Windows programs.</p>\n<p>Although this book does not use them, PE-bear and CFF Explorer included in Explorer Suite are also convenient tools for similar purposes.</p>\n<p>I will omit the detailed setup procedure, but each tool can be downloaded from the links below.</p>\n<br>\n<p>PEStudio:</p>\n<p><a href=\"https://www.winitor.com/download\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">https://www.winitor.com/download</a></p>\n<br>\n<br>\n<p>PE-bear:</p>\n<p><a href=\"https://github.com/hasherezade/pe-bear\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">https://github.com/hasherezade/pe-bear</a></p>\n<br>\n<br>\n<p>Explorer Suite:</p>\n<p><a href=\"https://ntcore.com/explorer-suite/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">https://ntcore.com/explorer-suite/</a></p>\n<br>\n<h2 id=\"prepare-for-kernel-debugging-with-windbg\" style=\"position:relative;\"><a href=\"#prepare-for-kernel-debugging-with-windbg\" aria-label=\"prepare for kernel debugging with 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>Prepare for Kernel Debugging with WinDbg</h2>\n<p>Verify that the virtual machine configured in the [Set Up the Virtual Machine] section can be kernel-debugged over a COM port from WinDbg installed on the host machine.</p>\n<p>If you are using Hyper-V, open the settings screen for the target virtual machine, and under the hardware settings for [COM 1], change [Attachment] to [Named pipe] and set the pipe name to [com1].</p>\n<p>As shown in the screen below, it is fine as long as the value shown in [Named pipe path] is <code class=\"language-text\">\\\\.\\pipe\\com1</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: 702px; \"\n    >\n      <a\n    class=\"gatsby-resp-image-link\"\n    href=\"/static/8a46403f1264813cb589ae6d08bac88f/d6331/hyper-v-com-port-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: 42.5%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAJCAYAAAAywQxIAAAACXBIWXMAAA7DAAAOwwHHb6hkAAABW0lEQVQoz4WSCYvCMBCF8///lKAIHqB4dT1737Zqa7d4oG/zZlHERTbwmGmSfnNFuZ6L47HC6XRCXddit9stFosF5l9zWJaFzWaD1WoFx3Fgmqb4tOv1WizPl8sloiiCshwLaZridrvhfr+Di+DhcIhms4nJZILpdIput4vBYIDxeIxGo4F+vy/+bGag3W6j1WpJIsq0XR3ZFvr1ehXg4XCQ6L1eD57noaoq2dvtdtjv909xj3r4tCpOUgSBjzhOdOlHnM9nuK6LNEmkNIrBGL0oCtE76PVbBWEM3/cli9+CIcBEA9mb0WgkvcvzXDLkGf1XcZ8B6SvPD+Vn0tlHLgJ4Icsy2LatKwikdAZOdEUEvOsBVoRFYSiARw8JJIyT7nQ6MAxDgK+lfZJyAw3U/ePFy+UiWTIrTp5BmBXtf6AncGJnSPIS9XeFUg+FveTbIqQsS1FR/B3AJ/0ASEyekBL68cYAAAAASUVORK5CYII='); background-size: cover; display: block;\"\n  ></span>\n  <picture>\n          <source\n              srcset=\"/static/8a46403f1264813cb589ae6d08bac88f/8ac56/hyper-v-com-port-001.webp 240w,\n/static/8a46403f1264813cb589ae6d08bac88f/d3be9/hyper-v-com-port-001.webp 480w,\n/static/8a46403f1264813cb589ae6d08bac88f/de2ca/hyper-v-com-port-001.webp 702w\"\n              sizes=\"(max-width: 702px) 100vw, 702px\"\n              type=\"image/webp\"\n            />\n          <source\n            srcset=\"/static/8a46403f1264813cb589ae6d08bac88f/8ff5a/hyper-v-com-port-001.png 240w,\n/static/8a46403f1264813cb589ae6d08bac88f/e85cb/hyper-v-com-port-001.png 480w,\n/static/8a46403f1264813cb589ae6d08bac88f/d6331/hyper-v-com-port-001.png 702w\"\n            sizes=\"(max-width: 702px) 100vw, 702px\"\n            type=\"image/png\"\n          />\n          <img\n            class=\"gatsby-resp-image-image\"\n            src=\"/static/8a46403f1264813cb589ae6d08bac88f/d6331/hyper-v-com-port-001.png\"\n            alt=\"Configure the COM port on a Hyper-V virtual machine\"\n            title=\"Configure the COM port on a Hyper-V virtual machine\"\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>If you are using VirtualBox, open the settings screen for the virtual machine you created, open the [Serial Ports] settings, and on the [Port 1] tab enable the [Enable Serial Port] checkbox.</p>\n<p>Set [Port Number] to [COM1], [Port Mode] to [Host Pipe], enter <code class=\"language-text\">\\\\.\\pipe\\com1</code> for [Path/Address], and save the settings.</p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 723px; \"\n    >\n      <a\n    class=\"gatsby-resp-image-link\"\n    href=\"/static/7270374eade660e856cdb508d50fbd15/c67d4/v-box-com-port-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: 67.5%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAOCAYAAAAvxDzwAAAACXBIWXMAAA7DAAAOwwHHb6hkAAABg0lEQVQ4y61T2U7DMBD0//8bD4hCUZUqodRtkiZxbjvn4N2S1g8FUcDSyNJmM57ZQ6SpQpIkqOsa0zRhnme+x3H8EYZhgNYaxhh0XQdxjFP7YUDf9yirCkEQQErJpJRM8eV2QTEXRN62LYSMM0yWkE5lCUnt6XRCHEV8K6WQZRk7oB8WNE3DMRdFUUAcLKHRLVut64YJIktGSne7d06kh8jWAiIje3ToPwIdiotYlejtx8kGKYlqEYYh9nuJ1eoZ2+2WFRrTXZU5hO5hy0mWY+oNvcXEVB8iJVWbzQa+7yPPc4THIyqr1lXlNodqTm7E45uCH1fYlzOKpsM4nJtDSuIotiXIWc3Sya9AOSRCPEnb2bRDkM/IaoO/HLYc2Tk8WwZbXuzci0tTZJIjV5ll12itLbdGvyIcx+nSCP0fhG4Nbo3C3TXsuv7cRauQXri1Ztd166Ftvqo1ytZ8DnrL7oisLEsIGtoFtCXfobDzKKMUD68BXvwDvK0Pz/N499frNS/EB9NhQZYHbjs9AAAAAElFTkSuQmCC'); background-size: cover; display: block;\"\n  ></span>\n  <picture>\n          <source\n              srcset=\"/static/7270374eade660e856cdb508d50fbd15/8ac56/v-box-com-port-001.webp 240w,\n/static/7270374eade660e856cdb508d50fbd15/d3be9/v-box-com-port-001.webp 480w,\n/static/7270374eade660e856cdb508d50fbd15/6c8c7/v-box-com-port-001.webp 723w\"\n              sizes=\"(max-width: 723px) 100vw, 723px\"\n              type=\"image/webp\"\n            />\n          <source\n            srcset=\"/static/7270374eade660e856cdb508d50fbd15/8ff5a/v-box-com-port-001.png 240w,\n/static/7270374eade660e856cdb508d50fbd15/e85cb/v-box-com-port-001.png 480w,\n/static/7270374eade660e856cdb508d50fbd15/c67d4/v-box-com-port-001.png 723w\"\n            sizes=\"(max-width: 723px) 100vw, 723px\"\n            type=\"image/png\"\n          />\n          <img\n            class=\"gatsby-resp-image-image\"\n            src=\"/static/7270374eade660e856cdb508d50fbd15/c67d4/v-box-com-port-001.png\"\n            alt=\"Configure the COM port on a VirtualBox virtual machine\"\n            title=\"Configure the COM port on a VirtualBox virtual machine\"\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 configuring the COM port on the virtual machine created with Hyper-V or VirtualBox, start WinDbg and attach the kernel debugger.</p>\n<p>When using the newer version of WinDbg, choose [File] > [Start Debugging] > [Attach to Kernel].</p>\n<p>Open the [Attach to Kernel] settings screen, set [Baud Rate] on the [COM] tab to 115200, and set [Port] to <code class=\"language-text\">\\\\.\\pipe\\com1</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: 882px; \"\n    >\n      <a\n    class=\"gatsby-resp-image-link\"\n    href=\"/static/2e0fbe3e61d94ea09b2e17aa2131a5d5/90712/attach-to-kerne-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: 77.91666666666667%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAQCAYAAAAWGF8bAAAACXBIWXMAAA7DAAAOwwHHb6hkAAACrklEQVQ4y4VUPW/TUBS1YECCBXYW+AHszBQQv4GRhRmQECAEgomPCSQW6MwCv4ClSKhAP2ibljhpEieOv57tfDiO49hJk8O9z0maVAUsHfnJfu/43HPPtfL2m4WXKyY+77hI+zH6/T6Gw6HEYDCY3ZMkQZqmx4LPMHiPcubpLyi3V3H53R7CpgfbEXAcB7Ztw3VduW40Guh0OgiC4L9QLr3Zw8XXOdz6VIZj6CiVK9A0DaVSCaqqIp/Po16vy83tdnvh8PQj/JzXDOXCqxzOv8jh5sd9OK0IltuAK4RUyMp6vR5tDEmpgKDnfIiVd7td6HoNel2Xe33fzwhPP9mE8mAdN5ZVdMMO6oaJalWTKiuVCq2rcrMQLgyjLonY19FohDiOkaSJ9JjB75Szz8jDhxu4+iGPOAxQ0aooFAooFouy7ExVOFPBxo/HYxx3RVEE5dzzLSj313HlPREGAqZlwzRNCS6t1WplJduOXPeJ8ODgQJLOY5Hw3hqWiDAJLVg2wbKI2ERAnoRhKL0REw8j8vQo2QLhqcfk4d2fsuReQ4dFMeGDnufNusqE3JSqSc3yA7SiBFE6Qm84lhiN50o+8WgDyp2MsOOTMvKKFTI4LrVaTXabP+JOPpTlMqYmJFQBBzqVNkjCkxPC68sFaL+3UdZIpeXAMC3ZcYe6GwSZQo88tcmSgDxtNlMJz0uJuC8nJop6h4TXSOFuTsWXTQtfdzysbAv8KIb4XgixqobQdAGMR/jXxZmdU6hirWxgq2RiX7Ohlk0Uq6RUBDDcDjVJ0LzGMm+sZpq9ecgcHipUYQobumnAtgyYNIa+J2TYGewhx+a4+eXmCWom53RGuMTBDppwPZ9eNLIu8wE5rx3y1V6Y2aOYJiIjpNhwDgdxF+3Jhmn+pj8ADvn8D+FvxH8AFth/IXJK19YAAAAASUVORK5CYII='); background-size: cover; display: block;\"\n  ></span>\n  <picture>\n          <source\n              srcset=\"/static/2e0fbe3e61d94ea09b2e17aa2131a5d5/8ac56/attach-to-kerne-001.webp 240w,\n/static/2e0fbe3e61d94ea09b2e17aa2131a5d5/d3be9/attach-to-kerne-001.webp 480w,\n/static/2e0fbe3e61d94ea09b2e17aa2131a5d5/9d646/attach-to-kerne-001.webp 882w\"\n              sizes=\"(max-width: 882px) 100vw, 882px\"\n              type=\"image/webp\"\n            />\n          <source\n            srcset=\"/static/2e0fbe3e61d94ea09b2e17aa2131a5d5/8ff5a/attach-to-kerne-001.png 240w,\n/static/2e0fbe3e61d94ea09b2e17aa2131a5d5/e85cb/attach-to-kerne-001.png 480w,\n/static/2e0fbe3e61d94ea09b2e17aa2131a5d5/90712/attach-to-kerne-001.png 882w\"\n            sizes=\"(max-width: 882px) 100vw, 882px\"\n            type=\"image/png\"\n          />\n          <img\n            class=\"gatsby-resp-image-image\"\n            src=\"/static/2e0fbe3e61d94ea09b2e17aa2131a5d5/90712/attach-to-kerne-001.png\"\n            alt=\"Attach the kernel debugger with WinDbg\"\n            title=\"Attach the kernel debugger with 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>If [Break on Connection] is checked, WinDbg automatically breaks when it attaches to the machine as a kernel debugger, and the system on the VM side stops.</p>\n<p>When WinDbg has attached to the system as a kernel debugger, the OS version and other information are displayed as in the screen below, and you can enter commands in WinDbg’s command 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: 782px; \"\n    >\n      <a\n    class=\"gatsby-resp-image-link\"\n    href=\"/static/445895c8b26fd4e0d0b6b5cbca207451/2e195/windbg-kernel-attach-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: 76.66666666666666%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAPCAYAAADkmO9VAAAACXBIWXMAAA7DAAAOwwHHb6hkAAAB10lEQVQ4y4VUibKCMAzs//+hB1JulPsQQdC8bmjeQ58zdiYTjrLZ3aSoIs+pKArquo7quqa2balpGrrf7/R4PGgcR76epomezydhbfP7tTrs93Q4HMhxHDoejxRFEYVhSLktBKBhuDJo13ZcUOJ2u5lnLfV9z4Su1ysp3IBRWVXMsCxLqsx1drnw9TAMvHGeZ9ouYba9hyKltUtpmvIHkCeBimDZGzDY4nk+F6yrmjOK9GYP9glbLLXf7eh0OpH2PPJ9n8HP5zPLBVOwzPOMwRurAIDiK2Icp18Fyvc0e+YHwZoNE9d1uUgcx+xtYN4VBkhYQBrifXFTfGYW8Mdg6Jl7BEABhGfIWZZxLsuKJULytrviqXINE1dr0iZC8wEywBMjHR2/2Obk1gKwhMeSLbc/QHiATqMqvEHHCwbIGQABUACiQZA6zwsty2Jn9XU2FR4CzHGOpF1NkWEHZmAKiWCL+exM0eebb2iEePnCcB3eYWUHaYYpMsZltO+kIV8BMUdNA6nr9DOQDYxKksTc/XQzSgjs/XQcFTZh9i6mi5g/iSiK7cytJwggUCAZXUb8A4zjiL2Cb0mS8HhgIyQixBIZZMno8EeGoC4y5C8j51L+ON/W9lz/ABx6gCPPr/YZAAAAAElFTkSuQmCC'); background-size: cover; display: block;\"\n  ></span>\n  <picture>\n          <source\n              srcset=\"/static/445895c8b26fd4e0d0b6b5cbca207451/8ac56/windbg-kernel-attach-001.webp 240w,\n/static/445895c8b26fd4e0d0b6b5cbca207451/d3be9/windbg-kernel-attach-001.webp 480w,\n/static/445895c8b26fd4e0d0b6b5cbca207451/c0b7e/windbg-kernel-attach-001.webp 782w\"\n              sizes=\"(max-width: 782px) 100vw, 782px\"\n              type=\"image/webp\"\n            />\n          <source\n            srcset=\"/static/445895c8b26fd4e0d0b6b5cbca207451/8ff5a/windbg-kernel-attach-001.png 240w,\n/static/445895c8b26fd4e0d0b6b5cbca207451/e85cb/windbg-kernel-attach-001.png 480w,\n/static/445895c8b26fd4e0d0b6b5cbca207451/2e195/windbg-kernel-attach-001.png 782w\"\n            sizes=\"(max-width: 782px) 100vw, 782px\"\n            type=\"image/png\"\n          />\n          <img\n            class=\"gatsby-resp-image-image\"\n            src=\"/static/445895c8b26fd4e0d0b6b5cbca207451/2e195/windbg-kernel-attach-001.png\"\n            alt=\"WinDbg after attaching the kernel debugger\"\n            title=\"WinDbg after attaching the kernel debugger\"\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>When the kernel debugger is debugging the kernel of the virtual machine, the virtual machine itself stops running.</p>\n<p>For that reason, if you are connected to the virtual machine remotely using Hyper-V Enhanced Session or RDP, the screen will black out and remote access will be disconnected.</p>\n<p>When performing kernel debugging on a virtual machine built with Hyper-V, I recommend using console access with Enhanced Session disabled.</p>\n<p>If you want to resume system operation, run the <code class=\"language-text\">g</code> command.</p>\n<h2 id=\"perform-kernel-debugging-over-the-network\" style=\"position:relative;\"><a href=\"#perform-kernel-debugging-over-the-network\" aria-label=\"perform kernel debugging over the network 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>Perform Kernel Debugging over the Network</h2>\n<p>In the previous section, we set up a kernel debugger connection that uses a COM port, but data transfer over a COM port is extremely slow even when the baud rate is set to its maximum value of 115200.</p>\n<p>You probably will not notice much delay when running ordinary debugger commands such as lm or k, but when using commands that require large amounts of data transfer, such as the <code class=\"language-text\">.dump</code> command <sup id=\"fnref-15\"><a href=\"#fn-15\" class=\"footnote-ref\">15</a></sup>, it can take several hours or more to finish if you are using a COM port.</p>\n<p>In such cases, I recommend setting up kernel debugging over the network instead of using a COM port.</p>\n<p>You can set up network-based kernel debugging manually, but using kdnet.exe is more reliable.<sup id=\"fnref-16\"><a href=\"#fn-16\" class=\"footnote-ref\">16</a></sup></p>\n<p>To use kernel debugging over the network, first prepare an environment where the host machine that performs debugging and the target virtual machine can communicate over IPv4.</p>\n<p>If you are using Hyper-V as the virtualization platform, it is a good idea to create an internal virtual switch from [Virtual Switch Manager], attach it to the virtual machine, and assign fixed static IPv4 addresses.</p>\n<p>In this book, I assign <code class=\"language-text\">192.168.50.1/25</code> to the host machine and <code class=\"language-text\">192.168.50.12/25</code> to the virtual machine.</p>\n<p>Once network connectivity between the host machine and the virtual machine has been established, next run Command Prompt as Administrator inside the virtual machine and execute <code class=\"language-text\">\"C:\\Program Files (x86)\\Windows Kits\\10\\Debuggers\\x64\\kdnet.exe\"</code>.</p>\n<p>kdnet.exe is located in the folder where Debugging Tools for Windows was installed in the [Install Debugging Tools for Windows] section.</p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 682px; \"\n    >\n      <a\n    class=\"gatsby-resp-image-link\"\n    href=\"/static/a8db3b45be79d88c5c924ad83d7a2bc5/160a3/kd-setup-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: 9.166666666666668%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAACCAYAAABYBvyLAAAACXBIWXMAAA7DAAAOwwHHb6hkAAAAYklEQVQI1y2NOxIAIQhDt7WzWBXxh6P3v2JWWKuEvEx41loQEZRSMMZAjBG1VvOa5ZzRWsPo/WQCZgbf7t7bmPFzK3t0QM2cEyklhBBskIjMq2pHVTlzub3XnhH9mfcezjl8jQo0Ft+8/rQAAAAASUVORK5CYII='); background-size: cover; display: block;\"\n  ></span>\n  <picture>\n          <source\n              srcset=\"/static/a8db3b45be79d88c5c924ad83d7a2bc5/8ac56/kd-setup-001.webp 240w,\n/static/a8db3b45be79d88c5c924ad83d7a2bc5/d3be9/kd-setup-001.webp 480w,\n/static/a8db3b45be79d88c5c924ad83d7a2bc5/57e27/kd-setup-001.webp 682w\"\n              sizes=\"(max-width: 682px) 100vw, 682px\"\n              type=\"image/webp\"\n            />\n          <source\n            srcset=\"/static/a8db3b45be79d88c5c924ad83d7a2bc5/8ff5a/kd-setup-001.png 240w,\n/static/a8db3b45be79d88c5c924ad83d7a2bc5/e85cb/kd-setup-001.png 480w,\n/static/a8db3b45be79d88c5c924ad83d7a2bc5/160a3/kd-setup-001.png 682w\"\n            sizes=\"(max-width: 682px) 100vw, 682px\"\n            type=\"image/png\"\n          />\n          <img\n            class=\"gatsby-resp-image-image\"\n            src=\"/static/a8db3b45be79d88c5c924ad83d7a2bc5/160a3/kd-setup-001.png\"\n            alt=\"Validating the network adapter with kdnet.exe\"\n            title=\"Validating the network adapter with kdnet.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>If running kdnet.exe without any options displays <code class=\"language-text\">Network debugging is supported by this Microsoft Hypervisor Virtual Machine</code>, then continue by running <code class=\"language-text\">\"C:\\Program Files (x86)\\Windows Kits\\10\\Debuggers\\x64\\kdnet.exe\" &lt;HostComputerIPAddress> &lt;YourDebugPort></code>.</p>\n<p>At this point, specify the IP address of the host machine that will perform debugging (<code class=\"language-text\">192.168.50.1</code>) as HostComputerIPAddress, and specify the port number that you will later configure in WinDbg on the host machine (default: 50000).</p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 871px; \"\n    >\n      <a\n    class=\"gatsby-resp-image-link\"\n    href=\"/static/e1124a7258cb1e3c2f66a5f1a59b520e/9d5da/kd-setup-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: 16.249999999999996%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAADCAYAAACTWi8uAAAACXBIWXMAAA7DAAAOwwHHb6hkAAAAiElEQVQI11WP2wqEMAxEfS9autJb2tqL+v+fONtkccGHwwwTSCZLiISUEkIIQoxR1DknnohgrRX/zB6891N/Ge8wxmDp40TvHTln1FpxjoHWGsbU67rQaptU3PeN4zhkVkqWI/v+wbZt0FoL7BdK+dWOGyVKcoAbWOv+H5RSJGfPbdZ1hVLqxRefV0zndQnsHAAAAABJRU5ErkJggg=='); background-size: cover; display: block;\"\n  ></span>\n  <picture>\n          <source\n              srcset=\"/static/e1124a7258cb1e3c2f66a5f1a59b520e/8ac56/kd-setup-002.webp 240w,\n/static/e1124a7258cb1e3c2f66a5f1a59b520e/d3be9/kd-setup-002.webp 480w,\n/static/e1124a7258cb1e3c2f66a5f1a59b520e/81b74/kd-setup-002.webp 871w\"\n              sizes=\"(max-width: 871px) 100vw, 871px\"\n              type=\"image/webp\"\n            />\n          <source\n            srcset=\"/static/e1124a7258cb1e3c2f66a5f1a59b520e/8ff5a/kd-setup-002.png 240w,\n/static/e1124a7258cb1e3c2f66a5f1a59b520e/e85cb/kd-setup-002.png 480w,\n/static/e1124a7258cb1e3c2f66a5f1a59b520e/9d5da/kd-setup-002.png 871w\"\n            sizes=\"(max-width: 871px) 100vw, 871px\"\n            type=\"image/png\"\n          />\n          <img\n            class=\"gatsby-resp-image-image\"\n            src=\"/static/e1124a7258cb1e3c2f66a5f1a59b520e/9d5da/kd-setup-002.png\"\n            alt=\"Setting up kernel debugging with kdnet.exe\"\n            title=\"Setting up kernel debugging with kdnet.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>When you run this command, you will get output containing <code class=\"language-text\">key=&lt;KEY string></code> as shown in the image above, so copy the string after <code class=\"language-text\">key=</code>.</p>\n<p>Next, start WinDbg on the host machine, enter the port number configured with kdnet.exe and the copied string after <code class=\"language-text\">key=</code> into [Port number] and [Key] on the [Net] tab of [Attach to Kernel], and click [OK].</p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 915px; \"\n    >\n      <a\n    class=\"gatsby-resp-image-link\"\n    href=\"/static/ae401115a071d8cb066b330b02fb554c/4255a/kd-setup-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: 58.75%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAMCAYAAABiDJ37AAAACXBIWXMAAA7DAAAOwwHHb6hkAAACD0lEQVQoz42S32vTUBzFrwp788EXn3zRJ//RYX+s4gaDUYfPMnC6MX3agyDSCWJhXbLSn2maJrn52SRtmnS1x29uVrc5Ngwckpsfn/s954StVSpg6+v4cHqKiefB4Byc5DgObNuG67oIguC/xV7u7uL52yoOGw0Mez20Ox00m03I5zJkSUK/34fv+xiPx0Iebep6rriXKVuvlK3Zi2oVz3Z2cCTLCGgi07IwmUwQRZHYMQzDv9Nyk+dni8MXgBy0ep69y55sbWHtdQV7DQncCaHrIxiGAZM+Dgl6BXQwncZY4v6DPd3exsONDexLMkI/QF/po0c2u90uFEWhPC2Ro84dGM5YiHsBLD+C5YV0HWI8TTBJf5MWYI83N8EKBXw8kxC5HlrtFtrtjgAOh5rIJZvQsrKCyB7B43iGNJ0jSVOhdH6B+UUuAr4Be1XAgUQtuxzKQIWqqtA0TUBWlgMqJEkSJLMZFovFP0aXWC5zsUdklxWKOJTqmHomtJFOOeoi7OgywyzwlCa5gRCAy/P1DB+UywL4qVFHaBsYkM3MqkVt2zSZ5/mikGy6K9DyxvV15cBiEfv1n/DNEXRDh6Hrom11oMCxs1JuA+8SYxmwVML7kxq65y1opoPhiGOo53KoRYPftnznb8NKBCyX8O57Dce1Fr78GOFzTcXxLwvf5BBfz0KcyI7IMo5j+hen9+oPzgVkpn5qXQoAAAAASUVORK5CYII='); background-size: cover; display: block;\"\n  ></span>\n  <picture>\n          <source\n              srcset=\"/static/ae401115a071d8cb066b330b02fb554c/8ac56/kd-setup-003.webp 240w,\n/static/ae401115a071d8cb066b330b02fb554c/d3be9/kd-setup-003.webp 480w,\n/static/ae401115a071d8cb066b330b02fb554c/632b0/kd-setup-003.webp 915w\"\n              sizes=\"(max-width: 915px) 100vw, 915px\"\n              type=\"image/webp\"\n            />\n          <source\n            srcset=\"/static/ae401115a071d8cb066b330b02fb554c/8ff5a/kd-setup-003.png 240w,\n/static/ae401115a071d8cb066b330b02fb554c/e85cb/kd-setup-003.png 480w,\n/static/ae401115a071d8cb066b330b02fb554c/4255a/kd-setup-003.png 915w\"\n            sizes=\"(max-width: 915px) 100vw, 915px\"\n            type=\"image/png\"\n          />\n          <img\n            class=\"gatsby-resp-image-image\"\n            src=\"/static/ae401115a071d8cb066b330b02fb554c/4255a/kd-setup-003.png\"\n            alt=\"Configure the host-side WinDbg to listen for network kernel debugging\"\n            title=\"Configure the host-side WinDbg to listen for network kernel debugging\"\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>When you start network-based kernel debugging in WinDbg, <code class=\"language-text\">Waiting to reconnect...</code> appears in the debugging console.</p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 805px; \"\n    >\n      <a\n    class=\"gatsby-resp-image-link\"\n    href=\"/static/62913c287cc04aa9897df0519d1ea612/c946b/kd-setup-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: 25.416666666666664%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAFCAYAAABFA8wzAAAACXBIWXMAAA7DAAAOwwHHb6hkAAAAw0lEQVQY031P7Q6DIAzk/Z/RzaigTlFBwcTPW9tliz+2NWnuCr22p8I0YaIMIaDrOozjiKZpiPfw3sE5h77vEWOAGwYMlNzL74zbtmHfd8HjOKDWdaXPAXmeo65r2NYiTe9UF6jKEkWhZUFJPMsyaK3Rtq0Mm+dZkJOPWpYFavRetrLIWitojBFk4ePxQh7I/yzii36F4ka+jG1VVUWiDp7ssPUYI3Ev3NNitvSO8zy/prolidgzRiMj23zBv/iIL/U1ntIzgF6TtHPnAAAAAElFTkSuQmCC'); background-size: cover; display: block;\"\n  ></span>\n  <picture>\n          <source\n              srcset=\"/static/62913c287cc04aa9897df0519d1ea612/8ac56/kd-setup-004.webp 240w,\n/static/62913c287cc04aa9897df0519d1ea612/d3be9/kd-setup-004.webp 480w,\n/static/62913c287cc04aa9897df0519d1ea612/82ef0/kd-setup-004.webp 805w\"\n              sizes=\"(max-width: 805px) 100vw, 805px\"\n              type=\"image/webp\"\n            />\n          <source\n            srcset=\"/static/62913c287cc04aa9897df0519d1ea612/8ff5a/kd-setup-004.png 240w,\n/static/62913c287cc04aa9897df0519d1ea612/e85cb/kd-setup-004.png 480w,\n/static/62913c287cc04aa9897df0519d1ea612/c946b/kd-setup-004.png 805w\"\n            sizes=\"(max-width: 805px) 100vw, 805px\"\n            type=\"image/png\"\n          />\n          <img\n            class=\"gatsby-resp-image-image\"\n            src=\"/static/62913c287cc04aa9897df0519d1ea612/c946b/kd-setup-004.png\"\n            alt=\"Start a network-based kernel debugging connection in WinDbg\"\n            title=\"Start a network-based kernel debugging connection 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 this state, if you reboot the virtual machine that was configured with kdnet.exe, WinDbg on the host machine will attach to the kernel of the virtual machine over the network, and network-based kernel debugging becomes possible.</p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 794px; \"\n    >\n      <a\n    class=\"gatsby-resp-image-link\"\n    href=\"/static/18a8503c934068cc9b9577fb2b914f85/7de01/kd-setup-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: 56.25%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAALCAYAAAB/Ca1DAAAACXBIWXMAAA7DAAAOwwHHb6hkAAAB1UlEQVQoz3VSa4/TQAzM//8twIkTSHxGJ/EPuIo2yabNa5tHs02aV5MOY/cqIQ5WGnlfHttje8uywLkGxhhYa1EWhe4PhxhZmiKOExyPR+R5hiAIkGUZCv4ZxxHTNGGc3izP8zzDq6qSDlaR0UkcIxKKo7U50jTRu/0+QlEWuF5nxf+WV5YNyvKMtp1IcELT9Bj6hVGBmRjHVffjeMPtD8fbTXB7B8+YF0b/jkP8giT5gWHY8MEQgWJZxIZYV9n7zM6n3ZFy+HeGvv8Vv7YfqdszNpsPCMPP2G4/qd3vv8D3n7HbPSmMkbcnyvENl0vOrK/ouo5JDKywY7ArPOcGiuyQ23vp1jrq6WDzhuUPqOsOVdXidOrfzhc0bqTzyqwXbYQQiZUGe2ka83PNi4mRekbu0PcXOpYMUOi5KI48V9qMeRKySQmkuw8r+mnJr68/WV7IDufspiW5NKbB+XymPamVsUmSRMcly3KS1/cyz9LMVv9Ilkoo4xDHMZsSU6OImvlEQP32SDiDMpPynjOgOEs2Qrau67uGaJejKKLgOyWQvcyfoK5qFVxIhOAufKtwzinxg+RRrmZoTIiAJRuSWXvUj5J+3/c6/UL00EruRXjBQ7u/8RuBP0TvwSVXxgAAAABJRU5ErkJggg=='); background-size: cover; display: block;\"\n  ></span>\n  <picture>\n          <source\n              srcset=\"/static/18a8503c934068cc9b9577fb2b914f85/8ac56/kd-setup-005.webp 240w,\n/static/18a8503c934068cc9b9577fb2b914f85/d3be9/kd-setup-005.webp 480w,\n/static/18a8503c934068cc9b9577fb2b914f85/ae710/kd-setup-005.webp 794w\"\n              sizes=\"(max-width: 794px) 100vw, 794px\"\n              type=\"image/webp\"\n            />\n          <source\n            srcset=\"/static/18a8503c934068cc9b9577fb2b914f85/8ff5a/kd-setup-005.png 240w,\n/static/18a8503c934068cc9b9577fb2b914f85/e85cb/kd-setup-005.png 480w,\n/static/18a8503c934068cc9b9577fb2b914f85/7de01/kd-setup-005.png 794w\"\n            sizes=\"(max-width: 794px) 100vw, 794px\"\n            type=\"image/png\"\n          />\n          <img\n            class=\"gatsby-resp-image-image\"\n            src=\"/static/18a8503c934068cc9b9577fb2b914f85/7de01/kd-setup-005.png\"\n            alt=\"Start kernel debugging over the network in WinDbg\"\n            title=\"Start kernel debugging over the network 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>If network-based kernel debugging does not work properly, check the network connectivity between the host machine and the virtual machine, and also confirm whether communication by WinDbg is allowed through Microsoft Defender Firewall on the host machine.</p>\n<h2 id=\"download-the-target-programs\" style=\"position:relative;\"><a href=\"#download-the-target-programs\" aria-label=\"download the target programs 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>Download the Target Programs</h2>\n<p>Download the DoP programs analyzed in this book from the release page below.</p>\n<p>In this book, the goal is to analyze these DoP programs and identify two Flags.</p>\n<p>The Flag format is <code class=\"language-text\">^FLAG\\{[\\x20-\\x7E]+\\}$</code>.</p>\n<br>\n<p>DoP -The dream of a pumpkin-:</p>\n<p><a href=\"https://github.com/kash1064/ctf-and-windows-debug/releases/tag/v1.0/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">https://github.com/kash1064/ctf-and-windows-debug/releases/tag/v1.0/</a></p>\n<br>\n<p>From the release page, you can download the following two files.</p>\n<div class=\"gatsby-highlight\" data-language=\"bash\"><pre class=\"language-bash\"><code class=\"language-bash\">DoPClient.exe<span class=\"token punctuation\">(</span>SHA256:59D52D6AF3479A75B21784916B8C73396971E75142A1AF0C0900C843E4491710<span class=\"token punctuation\">)</span>\n\nDoPDriver.sys<span class=\"token punctuation\">(</span>SHA256:4C2F4F26A8F19083CE699B83F91C4430D03EB62DDECA509A16E66FCD7FE46D3D<span class=\"token punctuation\">)</span></code></pre></div>\n<p>Please copy the two downloaded files into the same folder inside the virtual machine that you created for debugging.</p>\n<p>Note that in most CTF challenges, symbol files used for analyzing the target, such as PDB files, are not provided.</p>\n<p>Even when debugging is done for troubleshooting rather than for a CTF, it is rare to be able to obtain the proper symbol files unless the reader is directly involved in developing that software.</p>\n<p>For that reason, this book also debugs unknown files without symbol files.</p>\n<p>Analyzing an unknown program without symbol files using only WinDbg is extremely difficult, but you can debug efficiently by combining it with analysis tools such as IDA, Ghidra, and Binary Ninja.</p>\n<p>Incidentally, these tools also include debugging features, so it is not strictly necessary to use WinDbg.</p>\n<p>However, powerful features such as automating debugger operations with scripts, as used in this book, are not available in the free editions of IDA or Binary Ninja, where functionality is limited.</p>\n<p>In this book, I therefore use WinDbg, which offers full functionality including these advanced features, to analyze the user-mode program and the kernel driver.</p>\n<p>To run the DoP programs, depending on your environment you may need to install the latest redistributable package beforehand by running <code class=\"language-text\">vc_redist.x64.exe</code>, which can be downloaded from the URL below.</p>\n<br>\n<p>vc_redist.x64.exe:</p>\n<p><a href=\"https://aka.ms/vs/17/release/vc_redist.x64.exe\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">https://aka.ms/vs/17/release/vc_redist.x64.exe</a></p>\n<br>\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-vol2-00-en\">Preface</a></li>\n<li><a href=\"/magical-windbg-vol2-01-en\">Chapter 1: Environment Setup</a></li>\n<li><a href=\"/magical-windbg-vol2-02-en\">Chapter 2: Surface Analysis of DoPClient and DoPDriver</a></li>\n<li><a href=\"/magical-windbg-vol2-03-en\">Chapter 3: Static Analysis of DoPClient</a></li>\n<li><a href=\"/magical-windbg-vol2-04-en\">Chapter 4: Dynamic Analysis of DoPClient</a></li>\n<li><a href=\"/magical-windbg-vol2-05-en\">Chapter 5: Static Analysis of DoPDriver</a></li>\n<li><a href=\"/magical-windbg-vol2-06-en\">Chapter 6: Dynamic Analysis of DoPDriver</a></li>\n</ul>\n<div class=\"footnotes\">\n<hr>\n<ol>\n<li id=\"fn-1\">\n<p>Enable Loading of Test-Signed Drivers <a href=\"https://learn.microsoft.com/ja-jp/windows-hardware/drivers/install/the-testsigning-boot-configuration-option\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">https://learn.microsoft.com/ja-jp/windows-hardware/drivers/install/the-testsigning-boot-configuration-option</a></p>\n<a href=\"#fnref-1\" class=\"footnote-backref\">↩</a>\n</li>\n<li id=\"fn-2\">\n<p>Setting Up Kernel-Mode Debugging of a Virtual Machine Manually using a Virtual COM Port <a href=\"https://learn.microsoft.com/ja-jp/windows-hardware/drivers/debugger/attaching-to-a-virtual-machine--kernel-mode-\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">https://learn.microsoft.com/ja-jp/windows-hardware/drivers/debugger/attaching-to-a-virtual-machine—kernel-mode-</a></p>\n<a href=\"#fnref-2\" class=\"footnote-backref\">↩</a>\n</li>\n<li id=\"fn-3\">\n<p>Signing a Driver <a href=\"https://learn.microsoft.com/ja-jp/windows-hardware/drivers/develop/signing-a-driver\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">https://learn.microsoft.com/ja-jp/windows-hardware/drivers/develop/signing-a-driver</a></p>\n<a href=\"#fnref-3\" class=\"footnote-backref\">↩</a>\n</li>\n<li id=\"fn-4\">\n<p>Driver Signing Policy <a href=\"https://learn.microsoft.com/ja-jp/windows-hardware/drivers/install/kernel-mode-code-signing-policy--windows-vista-and-later-\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">https://learn.microsoft.com/ja-jp/windows-hardware/drivers/install/kernel-mode-code-signing-policy—windows-vista-and-later-</a></p>\n<a href=\"#fnref-4\" class=\"footnote-backref\">↩</a>\n</li>\n<li id=\"fn-5\">\n<p>What is WinDbg? <a href=\"https://learn.microsoft.com/ja-jp/windows-hardware/drivers/debugger/windbg-overview?source=recommendations\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">https://learn.microsoft.com/ja-jp/windows-hardware/drivers/debugger/windbg-overview?source=recommendations</a></p>\n<a href=\"#fnref-5\" class=\"footnote-backref\">↩</a>\n</li>\n<li id=\"fn-6\">\n<p>GFlags <a href=\"https://learn.microsoft.com/ja-jp/windows-hardware/drivers/debugger/gflags\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">https://learn.microsoft.com/ja-jp/windows-hardware/drivers/debugger/gflags</a></p>\n<a href=\"#fnref-6\" class=\"footnote-backref\">↩</a>\n</li>\n<li id=\"fn-7\">\n<p>Process Monitor <a href=\"https://learn.microsoft.com/ja-jp/sysinternals/downloads/procmon\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">https://learn.microsoft.com/ja-jp/sysinternals/downloads/procmon</a></p>\n<a href=\"#fnref-7\" class=\"footnote-backref\">↩</a>\n</li>\n<li id=\"fn-8\">\n<p>Process Explorer <a href=\"https://learn.microsoft.com/ja-jp/sysinternals/downloads/process-explorer\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">https://learn.microsoft.com/ja-jp/sysinternals/downloads/process-explorer</a></p>\n<a href=\"#fnref-8\" class=\"footnote-backref\">↩</a>\n</li>\n<li id=\"fn-9\">\n<p>Sysinternals <a href=\"https://learn.microsoft.com/ja-jp/sysinternals\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">https://learn.microsoft.com/ja-jp/sysinternals</a></p>\n<a href=\"#fnref-9\" class=\"footnote-backref\">↩</a>\n</li>\n<li id=\"fn-10\">\n<p>Windows Sysinternals徹底解説 : 無償ツールで極めるトラブルシューティングテクニック (Mark E. Russinovich・Aaron Margosis 著 / 山内 和朗 訳 / 日経BP社 / 2017 年)</p>\n<a href=\"#fnref-10\" class=\"footnote-backref\">↩</a>\n</li>\n<li id=\"fn-11\">\n<p>Symbols and Symbol Files <a href=\"https://learn.microsoft.com/ja-jp/windows-hardware/drivers/debugger/symbols-and-symbol-files\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">https://learn.microsoft.com/ja-jp/windows-hardware/drivers/debugger/symbols-and-symbol-files</a></p>\n<a href=\"#fnref-11\" class=\"footnote-backref\">↩</a>\n</li>\n<li id=\"fn-12\">\n<p>Using a Symbol Server <a href=\"https://learn.microsoft.com/ja-jp/windows-hardware/drivers/debugger/using-a-symbol-server\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">https://learn.microsoft.com/ja-jp/windows-hardware/drivers/debugger/using-a-symbol-server</a></p>\n<a href=\"#fnref-12\" class=\"footnote-backref\">↩</a>\n</li>\n<li id=\"fn-13\">\n<p>Reverse Engineering Tool Ghidra Practical Guide: From Security Contest Basics to Malware Analysis (Shota Nakajima, Yasukazu Kotake, Hiroaki Hara, Kohei Kawabata / Mynavi Publishing / 2020)</p>\n<a href=\"#fnref-13\" class=\"footnote-backref\">↩</a>\n</li>\n<li id=\"fn-14\">\n<p>Mastering Ghidra: A Complete Reverse Engineering Manual from the Basics (Chris Eagle, Kara Nance / technical supervision by Tomohisa Ishikawa / translated by Shota Nakajima, Yasukazu Kotake, Hiroaki Hara / O’Reilly Japan / 2022)</p>\n<a href=\"#fnref-14\" class=\"footnote-backref\">↩</a>\n</li>\n<li id=\"fn-15\">\n<p>.dump (Create Dump File) <a href=\"https://learn.microsoft.com/ja-jp/windows-hardware/drivers/debuggercmds/-dump--create-dump-file-\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">https://learn.microsoft.com/ja-jp/windows-hardware/drivers/debuggercmds/-dump—create-dump-file-</a></p>\n<a href=\"#fnref-15\" class=\"footnote-backref\">↩</a>\n</li>\n<li id=\"fn-16\">\n<p>Automatically Setting Up a KDNET Network Kernel Debugging Connection <a href=\"https://learn.microsoft.com/ja-jp/windows-hardware/drivers/debugger/setting-up-a-network-debugging-connection-automatically\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">https://learn.microsoft.com/ja-jp/windows-hardware/drivers/debugger/setting-up-a-network-debugging-connection-automatically</a></p>\n<a href=\"#fnref-16\" class=\"footnote-backref\">↩</a>\n</li>\n</ol>\n</div>","fields":{"slug":"/magical-windbg-vol2-01-en","tagSlugs":["/tag/magical-win-dbg/","/tag/windows/","/tag/win-dbg/","/tag/english/"]},"frontmatter":{"date":"2024-05-26","description":"This is the web edition of Magical WinDbg 2 - Learn User-Mode & Kernel Debugging Through CTFs -, distributed at Tech Book Fest 16.","tags":["Magical WinDbg","Windows","WinDbg","English"],"title":"Magical WinDbg VOL.2 [Chapter 1: Environment Setup]","socialImage":{"publicURL":"/static/e9bfc3718fd53ab58623a496fc9a302e/magical-windbg-vol2.png"}}}},"pageContext":{"slug":"/magical-windbg-vol2-01-en"}},"staticQueryHashes":["251939775","401334301","825871152"]}