{"componentChunkName":"component---src-templates-post-template-js","path":"/himitsukichi-ctf-rev-ghidra-dynamic-en","result":{"data":{"markdownRemark":{"id":"69fb072b-beb0-5d0a-866a-94a90da7d2e8","html":"<blockquote>\n<p>This page has been machine-translated from the <a href=\"/himitsukichi-ctf-rev-ghidra-dynamic\">original page</a>.</p>\n</blockquote>\n<p>This article was written as part of <a href=\"https://adventar.org/calendars/7550\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">CTF Advent Calendar 2022 Day18</a>.</p>\n<p>It was my first time participating in an Advent Calendar, and I was looking forward to it.</p>\n<p>Yesterday’s article was Ark’s ”<a href=\"https://blog.arkark.dev/2022/12/17/best-web-challs/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">Introducing the most interesting web challenges of 2022</a>“.</p>\n<p>Tomorrow’s article is Satoooon’s “Taking a rough look at CTFTime statistics”.</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=\"#theme-of-this-article\">Theme of This Article</a></li>\n<li><a href=\"#about-the-program-used\">About the Program Used</a></li>\n<li>\n<p><a href=\"#using-the-ghidra-debugger-on-linux\">Using the Ghidra Debugger on Linux</a></p>\n<ul>\n<li><a href=\"#starting-the-debugger\">Starting the Debugger</a></li>\n<li><a href=\"#setting-breakpoints-and-running-the-program\">Setting Breakpoints and Running the Program</a></li>\n<li><a href=\"#enabling-standard-input-in-the-ghidra-debugger\">Enabling Standard Input in the Ghidra Debugger</a></li>\n<li><a href=\"#inspecting-register-and-memory-information\">Inspecting Register and Memory Information</a></li>\n<li><a href=\"#obtaining-the-flag\">Obtaining the Flag</a></li>\n</ul>\n</li>\n<li>\n<p><a href=\"#using-the-ghidra-debugger-on-windows\">Using the Ghidra Debugger on Windows</a></p>\n<ul>\n<li><a href=\"#starting-the-debugger-1\">Starting the Debugger</a></li>\n<li><a href=\"#setting-breakpoints\">Setting Breakpoints</a></li>\n<li><a href=\"#viewing-register-information\">Viewing Register Information</a></li>\n<li><a href=\"#obtaining-the-flag-1\">Obtaining the Flag</a></li>\n</ul>\n</li>\n<li><a href=\"#summary\">Summary</a></li>\n</ul>\n<h2 id=\"theme-of-this-article\" style=\"position:relative;\"><a href=\"#theme-of-this-article\" aria-label=\"theme of this article 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>Theme of This Article</h2>\n<p>In this article, we use the Ghidra debugger feature added in version 10.0 to solve simple Reversing challenges on both Windows and Linux.</p>\n<p>My original plan was to write about analyzing an Android NDK library loaded via dlopen from a custom binary, but I spent about five days failing to get it working in my own environment, so I pivoted to this topic instead.</p>\n<p>It has been quite a while since it was announced that a debugger would be integrated into Ghidra starting with version 10.0.</p>\n<p>The Ghidra debugger relies on WinDbg on Windows and GDB on Linux, and it allows dynamic analysis of user-mode applications. However, I almost never see it used in CTF writeups.</p>\n<p>I myself tried the debugger once while it was still in preview, and honestly found it a bit uncomfortable to use, so I never touched it again after that.</p>\n<p>Some time has passed since then, and I still don’t see much information about the Ghidra debugger, so I decided to poke around, and write up how to use it along with my impressions.</p>\n<p>I’ll work through the process of solving simple dynamic-analysis Rev challenges using the Ghidra debugger.</p>\n<h2 id=\"about-the-program-used\" style=\"position:relative;\"><a href=\"#about-the-program-used\" aria-label=\"about the program used 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 Program Used</h2>\n<p>This time we use a program built from the following code.</p>\n<div class=\"gatsby-highlight\" data-language=\"c\"><pre class=\"language-c\"><code class=\"language-c\"><span class=\"token macro property\"><span class=\"token directive-hash\">#</span><span class=\"token directive keyword\">include</span> <span class=\"token string\">&lt;stdio.h></span></span>\n<span class=\"token macro property\"><span class=\"token directive-hash\">#</span><span class=\"token directive keyword\">include</span> <span class=\"token string\">&lt;string.h></span></span>\n\n<span class=\"token keyword\">char</span> flag<span class=\"token punctuation\">[</span><span class=\"token number\">30</span><span class=\"token punctuation\">]</span> <span class=\"token operator\">=</span> <span class=\"token punctuation\">{</span><span class=\"token number\">0x4b</span><span class=\"token punctuation\">,</span><span class=\"token number\">0x6a</span><span class=\"token punctuation\">,</span><span class=\"token number\">0x6e</span><span class=\"token punctuation\">,</span><span class=\"token number\">0x6a</span><span class=\"token punctuation\">,</span><span class=\"token number\">0x77</span><span class=\"token punctuation\">,</span><span class=\"token number\">0x70</span><span class=\"token punctuation\">,</span><span class=\"token number\">0x76</span><span class=\"token punctuation\">,</span><span class=\"token number\">0x68</span><span class=\"token punctuation\">,</span><span class=\"token number\">0x6a</span><span class=\"token punctuation\">,</span><span class=\"token number\">0x60</span><span class=\"token punctuation\">,</span><span class=\"token number\">0x6b</span><span class=\"token punctuation\">,</span><span class=\"token number\">0x6a</span><span class=\"token punctuation\">,</span><span class=\"token number\">0x40</span><span class=\"token punctuation\">,</span><span class=\"token number\">0x57</span><span class=\"token punctuation\">,</span><span class=\"token number\">0x45</span><span class=\"token punctuation\">,</span><span class=\"token number\">0x78</span><span class=\"token punctuation\">,</span><span class=\"token number\">0x7a</span><span class=\"token punctuation\">,</span><span class=\"token number\">0x6c</span><span class=\"token punctuation\">,</span><span class=\"token number\">0x76</span><span class=\"token punctuation\">,</span><span class=\"token number\">0x5c</span><span class=\"token punctuation\">,</span><span class=\"token number\">0x74</span><span class=\"token punctuation\">,</span><span class=\"token number\">0x33</span><span class=\"token punctuation\">,</span><span class=\"token number\">0x6d</span><span class=\"token punctuation\">,</span><span class=\"token number\">0x5c</span><span class=\"token punctuation\">,</span><span class=\"token number\">0x67</span><span class=\"token punctuation\">,</span><span class=\"token number\">0x71</span><span class=\"token punctuation\">,</span><span class=\"token number\">0x62</span><span class=\"token punctuation\">,</span><span class=\"token number\">0x22</span><span class=\"token punctuation\">,</span><span class=\"token number\">0x22</span><span class=\"token punctuation\">,</span><span class=\"token number\">0x7e</span><span class=\"token punctuation\">}</span><span class=\"token punctuation\">;</span>\n\n<span class=\"token keyword\">int</span> <span class=\"token function\">super_secure_checker</span><span class=\"token punctuation\">(</span><span class=\"token keyword\">char</span> c<span class=\"token punctuation\">,</span> <span class=\"token keyword\">int</span> i<span class=\"token punctuation\">)</span>\n<span class=\"token punctuation\">{</span>\n    <span class=\"token keyword\">if</span> <span class=\"token punctuation\">(</span>c <span class=\"token operator\">==</span> <span class=\"token punctuation\">(</span>flag<span class=\"token punctuation\">[</span>i<span class=\"token punctuation\">]</span><span class=\"token operator\">^</span><span class=\"token number\">0x3</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">)</span> <span class=\"token keyword\">return</span> <span class=\"token number\">1</span><span class=\"token punctuation\">;</span>\n    <span class=\"token keyword\">else</span> <span class=\"token keyword\">return</span> <span class=\"token number\">0</span><span class=\"token punctuation\">;</span>\n<span class=\"token punctuation\">}</span>\n\n<span class=\"token keyword\">int</span> <span class=\"token function\">main</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 keyword\">char</span> password<span class=\"token punctuation\">[</span><span class=\"token number\">0x100</span><span class=\"token punctuation\">]</span><span class=\"token punctuation\">;</span>\n\n    <span class=\"token function\">printf</span><span class=\"token punctuation\">(</span><span class=\"token string\">\"Input yout password: \"</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n    <span class=\"token function\">scanf</span><span class=\"token punctuation\">(</span><span class=\"token string\">\"%s\"</span><span class=\"token punctuation\">,</span> password<span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n    \n    <span class=\"token keyword\">int</span> len <span class=\"token operator\">=</span> <span class=\"token function\">strlen</span><span class=\"token punctuation\">(</span>password<span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n    <span class=\"token keyword\">if</span> <span class=\"token punctuation\">(</span>len <span class=\"token operator\">!=</span> <span class=\"token number\">30</span><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\">\"Wrong!!\\n\"</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n        <span class=\"token keyword\">return</span> <span class=\"token number\">0</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 keyword\">for</span> <span class=\"token punctuation\">(</span><span class=\"token keyword\">int</span> i <span class=\"token operator\">=</span> <span class=\"token number\">0</span><span class=\"token punctuation\">;</span> i <span class=\"token operator\">&lt;</span> <span class=\"token number\">30</span><span class=\"token punctuation\">;</span> i<span class=\"token operator\">++</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 function\">super_secure_checker</span><span class=\"token punctuation\">(</span>password<span class=\"token punctuation\">[</span>i<span class=\"token punctuation\">]</span><span class=\"token punctuation\">,</span> i<span class=\"token punctuation\">)</span><span class=\"token punctuation\">)</span> <span class=\"token punctuation\">{</span>\n                <span class=\"token keyword\">continue</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 function\">printf</span><span class=\"token punctuation\">(</span><span class=\"token string\">\"Wrong!!\\n\"</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n                <span class=\"token keyword\">return</span> <span class=\"token number\">0</span><span class=\"token punctuation\">;</span>\n            <span class=\"token punctuation\">}</span>\n        <span class=\"token punctuation\">}</span>\n    <span class=\"token punctuation\">}</span>\n    <span class=\"token function\">printf</span><span class=\"token punctuation\">(</span><span class=\"token string\">\"Correct!!\\n\"</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n    <span class=\"token keyword\">return</span> <span class=\"token number\">0</span><span class=\"token punctuation\">;</span>\n<span class=\"token punctuation\">}</span></code></pre></div>\n<p>The code is straightforward and works as follows:</p>\n<ol>\n<li><strong>Reads a password from standard input.</strong></li>\n<li><strong>If the password is exactly 30 characters, passes each character one by one to the <code class=\"language-text\">super_secure_checker</code> function.</strong></li>\n<li><strong>Compares the hardcoded value XOR’d with 0x3 against the input value; returns <code class=\"language-text\">Correct</code> if all characters match.</strong></li>\n</ol>\n<p>This is a typical reversing challenge of the type solvable by brute-force through dynamic analysis or symbol inspection.</p>\n<p>Since the logic is very simple, it is also possible to overwrite the return value register of <code class=\"language-text\">super_secure_checker</code> on each call and retrieve the password one character at a time as it is expanded into the register.</p>\n<p>Of course, a password this simple could easily be recovered through static analysis as well, but since the goal of this article is to use the Ghidra debugger, we’ll solve it via dynamic analysis instead.</p>\n<h2 id=\"using-the-ghidra-debugger-on-linux\" style=\"position:relative;\"><a href=\"#using-the-ghidra-debugger-on-linux\" aria-label=\"using the ghidra debugger on linux 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>Using the Ghidra Debugger on Linux</h2>\n<p>We analyze an ELF binary compiled from the above source code with gcc and no extra options.</p>\n<p>The sample program is available for download at <a href=\"/file/task\">Sample Program</a>.</p>\n<p>Ghidra version 10.2.2 is used.</p>\n<h3 id=\"starting-the-debugger\" style=\"position:relative;\"><a href=\"#starting-the-debugger\" aria-label=\"starting the debugger 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>Starting the Debugger</h3>\n<p>After loading the binary, click the bug-like button in the middle of the <code class=\"language-text\">Tool Chest</code> to launch the debugger.</p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 453px; \"\n    >\n      <a\n    class=\"gatsby-resp-image-link\"\n    href=\"/static/b92a50fe0f5169bf503052a2517552e8/2108e/image-20221215215846618.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,iVBORw0KGgoAAAANSUhEUgAAABQAAAAPCAYAAADkmO9VAAAACXBIWXMAAAsTAAALEwEAmpwYAAABzUlEQVQ4y82QzU8aURTF359ikHajtQtXTQ2tsbFNF/2/uujKlS7qRwUFbWIryAjDOAM4gFAYPhxmYNCC2KYLtpbGgdP7Rhe2xGSqm97kl3Ny33sn9z72xjeH6clpjI0/wviDKXgfTjl65R+PqMc7iTHPBJ48fYFns68w45vH7Nxr+J6/hJfusKWl9wgGP2Ltwwb8gS2srPqx7g8isLmN5ZV1hLZ3sLoWoLOQcycSjSOyF4cQkxATZeyTxkm536MzFhESKJQqyOVLyH8pQ80WyGso10wUyzqaJ10YzTZMq+No6+s3B+v0fATeZ592BchKBqKUgiSnUdSOoVXq0KqGQ61uoaZfQ7563ERVvx0WjiawnxQRjgoQ4gpyWh2FMoXVGjRlg0JNR93CRDEJf+YdFhbeYnE5hN20CenIQKPVveYMunnqGhamD5YPM5BTOSiEmi0ipeZxkOS9LNJqgVZt0TqWK9jOZwFiIgmZAsSDNCRFJQ4Rox7/Vx7M1y5VDFewhJzDj+86OidHqBsWDNNEu32GwWAI2x7g8tLGz36f+OUKxqew6XH/4gLn3Q56vR7uU4yvyae4WcPh8M5cBdr2H0F/+3+f8Ebgfev/D/wNnLMcDowDcgEAAAAASUVORK5CYII='); background-size: cover; display: block;\"\n  ></span>\n  <picture>\n          <source\n              srcset=\"/static/b92a50fe0f5169bf503052a2517552e8/8ac56/image-20221215215846618.webp 240w,\n/static/b92a50fe0f5169bf503052a2517552e8/2430e/image-20221215215846618.webp 453w\"\n              sizes=\"(max-width: 453px) 100vw, 453px\"\n              type=\"image/webp\"\n            />\n          <source\n            srcset=\"/static/b92a50fe0f5169bf503052a2517552e8/8ff5a/image-20221215215846618.png 240w,\n/static/b92a50fe0f5169bf503052a2517552e8/2108e/image-20221215215846618.png 453w\"\n            sizes=\"(max-width: 453px) 100vw, 453px\"\n            type=\"image/png\"\n          />\n          <img\n            class=\"gatsby-resp-image-image\"\n            src=\"/static/b92a50fe0f5169bf503052a2517552e8/2108e/image-20221215215846618.png\"\n            alt=\"image-20221215215846618\"\n            title=\"image-20221215215846618\"\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, load the analysis target file via [File] > [Open] in the debugger window.</p>\n<p>Once loading completes, the disassembly result is shown in the central Listing 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: 446px; \"\n    >\n      <a\n    class=\"gatsby-resp-image-link\"\n    href=\"/static/28e72c435a161c4ae9b02026b06493be/6244b/image-20221215215929166.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: 134.58333333333331%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAbCAYAAAB836/YAAAACXBIWXMAAAsTAAALEwEAmpwYAAAEcElEQVRIx61VW1NbVRQ+P8FCfbEdxxcfanVGS623jj7ZcRjHlz744LvO6JRKW2hxLNYpWmYcHrAtFSQlgQYCpLmUkytBoRSEQBJyP8lJQsotUArkAgok4XOdk8tDZ0DKuGe+WXuvs86319r7rO8wrxx7DyUvvowXSl7CoZIjOFR6JDcnW1J6NGcPHy2uC/PCWogVfKWHc8+Y5tZ2NLe0oU3aAamsE3fbOiDv6oWErORuO6TtnaJtk94TIfhl5Ou4p6C1HJ2dCrT8LhE5WlqlYGx2F+QKFS5cuYbKizU4X3kZVZdryV5BxbfVuPpDHWq+u4artXW4VPU9vjl3UYzLxVajovoGbrZ0gQuE4OPCYFiTDl99XYm33v8Ex984hddefxvHjpeRPYmTpz5C+adn8fGZz1BefhanPzyDN098kEPZaZSdeAevvvsFPv/yR1itExgds4Pp7GnC9Z/qYbYMQme0kB0Cq++Hts+IR39NYsLuwfikC1abW5zbprw5OLywT/ngmHKjVSIjsgnyucEk4kno9CaMjjvIacPwqBVjVgc4PopgaIbwuGgDBfCPwYdn4PSFoftzHCp1H7a2tpBOZ4gwkYDeYKKdPHB5OLgJHm8AfIgI+eldITz3ByKw2r3QaFlksxkIQyRk9RZYBlmMT/wB8/Ak2IFHZK3wTS/AFxEwn7d5kN9LPi4agzc8ByVlmMmkc4SpVAq9ahbnf+1Fk9KChq5+1LbpUXlbhUt3NHui6jctzjUq0SzrJqosdnaIMB5PwGS2YPOfTRx0sDojtre3cxmKhKZ+JFProiOb3aGd9gmKT2cy6GMNSD9LmFrfEB37JhPqo5HJExYzXIvHYXyGcD9jV8IkXYqZzjC1vn5gQlZHJafztyx86V0KJTY2/s6d4XOULCCbzaJHqUY4EsXs3AIYo+UhqYSsmPJBhtApC4tLWFmNgzFrNbh1qwnLT1fFm15ZXXsOxJGgO5DLu+Gw2eF2OsHUXm9AxYUamAceYmxiCnPzMSw9Wcbi0jKW9gLFxGKLGHZE8HOjBPUtCjRI1WAau4yo+6UJTuphoeljSytEtkIlLP8HnmI+9gS+0ALqb8tQK3mAG3IzmMzWJsz9FoyQlk06PKLq2EiW3L7QnnARPP4wXN4gWFZfPE9mbS0uts7QI6tY8ghJmKB3vsA0qQkhuDsEiROIVRoWW3SpGbrxvHyZ4abdHC4OA4Mj+Qx5UftC07PgIzOE2fy8sJ5BeHpOJFaTfBXVpkAokAj6xgk7B3Na56VNvFyEXoqK1uMX/hu5tVCB4JtyB6DWsOIHXuxlo8kiPnT4oxhxBDFkdWPMHYGPF9Q6CofTR9lGKcM5igvB7vTS2QXEbDmK0fYZkCl0SjKZgsHYj/saPdp7dbjTrsJNCf0a5VooNQbcJ61U9KihfmCgF03FdbdSCy1rgkproE7RFDuHSk5CKNvn94MPBhHieYRDIXEeCOQQ5EOi5bgAAuTnaR0M8qLP7+ewSF1S6G9SmwT+j1EQi38BF10lpzl+DbIAAAAASUVORK5CYII='); background-size: cover; display: block;\"\n  ></span>\n  <picture>\n          <source\n              srcset=\"/static/28e72c435a161c4ae9b02026b06493be/8ac56/image-20221215215929166.webp 240w,\n/static/28e72c435a161c4ae9b02026b06493be/5021b/image-20221215215929166.webp 446w\"\n              sizes=\"(max-width: 446px) 100vw, 446px\"\n              type=\"image/webp\"\n            />\n          <source\n            srcset=\"/static/28e72c435a161c4ae9b02026b06493be/8ff5a/image-20221215215929166.png 240w,\n/static/28e72c435a161c4ae9b02026b06493be/6244b/image-20221215215929166.png 446w\"\n            sizes=\"(max-width: 446px) 100vw, 446px\"\n            type=\"image/png\"\n          />\n          <img\n            class=\"gatsby-resp-image-image\"\n            src=\"/static/28e72c435a161c4ae9b02026b06493be/6244b/image-20221215215929166.png\"\n            alt=\"image-20221215215929166\"\n            title=\"image-20221215215929166\"\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>Then, select [in GDB locally IN-VM] from the [Debugger] toolbar.</p>\n<p>For <code class=\"language-text\">GDB launch command</code>, leave it at the default <code class=\"language-text\">/usr/bin/gdb</code> unless there is a specific reason to change 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: 565px; \"\n    >\n      <a\n    class=\"gatsby-resp-image-link\"\n    href=\"/static/aeb5e74674f827a6be4e3ef49fc4be66/07eba/image-20221215223714073.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: 40%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAICAYAAAD5nd/tAAAACXBIWXMAAAsTAAALEwEAmpwYAAAB0ElEQVQoz1VQy27TQBT1H/IHgFijLlghEAuoGuLWJm6RGgE7RBESC+gCiQpBiioUStrE8SOJE8dx/IjfD7opqxzujAqCkY7OndGdc8+5ws2N+7h26w6u376HRmMbsqSgsSVC2mlxyLICUZQ4y1ILYlPCo80mHhKkJ0+h7LWh7LbR2t1HS9mH8ODFIW40X+Hus/dov+tg7+1nPH75ATuvj7B98BHym0+8ZiweHOH54VcYUxf2wocXRPDDGEt/hTBKkWQlhC/fejj+PkB3MMLJmYHOqYbODx3HPeMvTo05R1e3oVouuqoN03Kg6Sb6qgZVMzC2ZoQFhDCMEAQ0gTiKkivEnOM4QVnWqOsL5HmJNCtQVzW6QxI2LKhDnYsNiJngYhlCYE0zx6UHG7O5y+1nRY04LZASF9UF0rzi9ygpkBcVeoYDczKHYY5hjiw4rscjR3EKYUVONN3A1F7wfaziDDHtggmwJnZnA/6grH7ipD+FNrJx3le5O8OcwCZTHiUVXC/AYOJhqI+h00S2E9Z0dq7CmjkUI/hPMCO3fphQXSFJaVhOCW2H9+ZUC1GSwXJ8OPSRuUmu3DGwuDzyP4Ip7fLX5SXYWa/XnJdkynEDXv8GvUom0RvHVlYAAAAASUVORK5CYII='); background-size: cover; display: block;\"\n  ></span>\n  <picture>\n          <source\n              srcset=\"/static/aeb5e74674f827a6be4e3ef49fc4be66/8ac56/image-20221215223714073.webp 240w,\n/static/aeb5e74674f827a6be4e3ef49fc4be66/d3be9/image-20221215223714073.webp 480w,\n/static/aeb5e74674f827a6be4e3ef49fc4be66/acb73/image-20221215223714073.webp 565w\"\n              sizes=\"(max-width: 565px) 100vw, 565px\"\n              type=\"image/webp\"\n            />\n          <source\n            srcset=\"/static/aeb5e74674f827a6be4e3ef49fc4be66/8ff5a/image-20221215223714073.png 240w,\n/static/aeb5e74674f827a6be4e3ef49fc4be66/e85cb/image-20221215223714073.png 480w,\n/static/aeb5e74674f827a6be4e3ef49fc4be66/07eba/image-20221215223714073.png 565w\"\n            sizes=\"(max-width: 565px) 100vw, 565px\"\n            type=\"image/png\"\n          />\n          <img\n            class=\"gatsby-resp-image-image\"\n            src=\"/static/aeb5e74674f827a6be4e3ef49fc4be66/07eba/image-20221215223714073.png\"\n            alt=\"image-20221215223714073\"\n            title=\"image-20221215223714073\"\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 clicking [Connect], review the <code class=\"language-text\">CommandLine</code> settings.</p>\n<p>If the target binary requires command-line arguments, configure them here.</p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 739px; \"\n    >\n      <a\n    class=\"gatsby-resp-image-link\"\n    href=\"/static/74dcaa5eaa9bf4ce6fe3ca9ef2be08b2/f1d1f/image-20221215224407819.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: 23.75%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAFCAYAAABFA8wzAAAACXBIWXMAAAsTAAALEwEAmpwYAAABCUlEQVQY002P2U7CQBSG+1Zd0BBRTErjjcsL+Hp6azRl6UaFwVq6lwIFo8aYmPgKv3Om1Xjx5Zvl/OfMSOpBH2rnBErnGIrWIGs9aId96MYl9ME5BmTjAsbZFbpHuqihjNpmZLUHWelCOb2GNLJ8PAwdjO1H2B6D5TLhkT2D4y/gTBew+N7mJqjOnExBuSFn4s7hs6XgzvQgBWEK9hRjmayQFlsk+QZRWiEpa+TVjrMXLtYvf27YC1f1G94/v/H68YUZCyFRgzAuOQWeo1wQhJkYEGUbxNlaDMrKbeu6cQutqYb6sCCBlK924kV0+AtdBvEKt+YcN/ceXBbzX0SCiAYllcj8h3LU8AdxdjXvrZI6mQAAAABJRU5ErkJggg=='); background-size: cover; display: block;\"\n  ></span>\n  <picture>\n          <source\n              srcset=\"/static/74dcaa5eaa9bf4ce6fe3ca9ef2be08b2/8ac56/image-20221215224407819.webp 240w,\n/static/74dcaa5eaa9bf4ce6fe3ca9ef2be08b2/d3be9/image-20221215224407819.webp 480w,\n/static/74dcaa5eaa9bf4ce6fe3ca9ef2be08b2/26073/image-20221215224407819.webp 739w\"\n              sizes=\"(max-width: 739px) 100vw, 739px\"\n              type=\"image/webp\"\n            />\n          <source\n            srcset=\"/static/74dcaa5eaa9bf4ce6fe3ca9ef2be08b2/8ff5a/image-20221215224407819.png 240w,\n/static/74dcaa5eaa9bf4ce6fe3ca9ef2be08b2/e85cb/image-20221215224407819.png 480w,\n/static/74dcaa5eaa9bf4ce6fe3ca9ef2be08b2/f1d1f/image-20221215224407819.png 739w\"\n            sizes=\"(max-width: 739px) 100vw, 739px\"\n            type=\"image/png\"\n          />\n          <img\n            class=\"gatsby-resp-image-image\"\n            src=\"/static/74dcaa5eaa9bf4ce6fe3ca9ef2be08b2/f1d1f/image-20221215224407819.png\"\n            alt=\"image-20221215224407819\"\n            title=\"image-20221215224407819\"\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>Clicking [Launch] starts the debugger and outputs various information.</p>\n<p>By default, the familiar Listing window is displayed in the center, with the Interpreter shown on the right.</p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 960px; \"\n    >\n      <a\n    class=\"gatsby-resp-image-link\"\n    href=\"/static/2f62b75f4cb39970779b2b081efef7e2/c1f3c/image-20221215224447357.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,iVBORw0KGgoAAAANSUhEUgAAABQAAAAMCAYAAABiDJ37AAAACXBIWXMAAAsTAAALEwEAmpwYAAACkUlEQVQoz22Ta2/aSBSG/f9/wEq7n6r92nar7bZSm/QSkWwSoCHcA7bxBV8wGIMB34iBpydWL7tSLb06M/YZz5nnnaOcXd7w8abFp9s2F80el60hF7cd/nlTp3U/QZ2YaKaF7cxodwbU63W6vS6arqOKDNPEcT0W4ZIwjFD45XNE03Qei5LTf966nsc8mBOFMWEUEScxeZFTluWPHEVVdaaOi+cHohmOF2DYLs37ARMrIojWuNGCMN6g2iZzf81ysRVFbDdb0jQjzTIOhwPH4xFlalmsVit2ux3b7ZYkSYklceoGzBclWbEnyRPKwxHDtQkXcxa+bLBcSt7PCvf7fRWVYBYQrdZk+0e2SUbxWLKU+U39Dm3iYHsz4edWnMbCbKyp1bGD0CdNNqR59j9Yytj0aPVG3A81+prFxFvwMJmyjFayICPZJOzWUv1mJ1wNRkOLUPBEot0qJquOe+R0OlVSWq02o9GYh5EquxtYtoMqMc1yCjFlnx8rc8ryIC4/4DsFnrAN5ztBlRAL2+12VyGrjtwZqAzHBp6AtpcFThBjTGX3NGXqrfHnJzZpzmyZYE99YVUIt4NUdfrl/VDanS63jTam7bOOM2w3RDddcW/HYr6RK1JQpFLJMuaJ974oeJSfFnn+zeGcLC8qUwoxUHn59pzX5zVen9V48/GKtxd13l9+4fp+yIfrNr8//8Bvz9/zx4sznv31jj9fSXz5jr8l/9NVg7NanfPLJleNDretPspgbGI6cwzRxA6qsW7N0CxfOsTj36fOaQ753OhLN3X5XO9Vsdbsc3035OrLoFJNvtfbI5S79oB2X6XbH9MTng/C80kjzaQ31GlIpSPVQJ/Y6Mb0hzS5CapuS7Sr8ff5VwGWb5t91pc/AAAAAElFTkSuQmCC'); background-size: cover; display: block;\"\n  ></span>\n  <picture>\n          <source\n              srcset=\"/static/2f62b75f4cb39970779b2b081efef7e2/8ac56/image-20221215224447357.webp 240w,\n/static/2f62b75f4cb39970779b2b081efef7e2/d3be9/image-20221215224447357.webp 480w,\n/static/2f62b75f4cb39970779b2b081efef7e2/e46b2/image-20221215224447357.webp 960w,\n/static/2f62b75f4cb39970779b2b081efef7e2/f992d/image-20221215224447357.webp 1440w,\n/static/2f62b75f4cb39970779b2b081efef7e2/882b9/image-20221215224447357.webp 1920w,\n/static/2f62b75f4cb39970779b2b081efef7e2/d9f7e/image-20221215224447357.webp 2123w\"\n              sizes=\"(max-width: 960px) 100vw, 960px\"\n              type=\"image/webp\"\n            />\n          <source\n            srcset=\"/static/2f62b75f4cb39970779b2b081efef7e2/8ff5a/image-20221215224447357.png 240w,\n/static/2f62b75f4cb39970779b2b081efef7e2/e85cb/image-20221215224447357.png 480w,\n/static/2f62b75f4cb39970779b2b081efef7e2/d9199/image-20221215224447357.png 960w,\n/static/2f62b75f4cb39970779b2b081efef7e2/07a9c/image-20221215224447357.png 1440w,\n/static/2f62b75f4cb39970779b2b081efef7e2/29114/image-20221215224447357.png 1920w,\n/static/2f62b75f4cb39970779b2b081efef7e2/c1f3c/image-20221215224447357.png 2123w\"\n            sizes=\"(max-width: 960px) 100vw, 960px\"\n            type=\"image/png\"\n          />\n          <img\n            class=\"gatsby-resp-image-image\"\n            src=\"/static/2f62b75f4cb39970779b2b081efef7e2/d9199/image-20221215224447357.png\"\n            alt=\"image-20221215224447357\"\n            title=\"image-20221215224447357\"\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>The Interpreter shows the same output as when GDB is launched from the command line, and GDB commands can be entered directly. (In this environment, gdb-peda is set up, so peda’s output is displayed.)</p>\n<p>The left pane shows information about the process being debugged by GDB.</p>\n<p>From here you can also view configured breakpoints and loaded modules.</p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 545px; \"\n    >\n      <a\n    class=\"gatsby-resp-image-link\"\n    href=\"/static/8fc03d4b599231735c10d093ee9468e5/3ddad/image-20221215224911198.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: 64.16666666666666%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAANCAYAAACpUE5eAAAACXBIWXMAAAsTAAALEwEAmpwYAAACKElEQVQ4y6VSa08TQRTdf+0XxU8kjZrgoxEKJlgCJvKhaEuKFqmUvjAtbLH0sdSWfe922+6226eV9jgzBQJETdSbnNyZe++cOXPvcPfvrWHuYRgP5kKYnw/j8ZMPWHgawbPnu3jh3cWibw++lSiWV/aw6v+M9TcxvN2MI7CVRHA7jZ2PX/ApmkEsfoTUIQ9udSmCzY0sXvvTCIcF7O+LiEarxNdwED9HKiUifThDJivjmFfwNa+iUNQhnBn4VjUhShYUtQHDbIKzHQsYOrAsBbouArjA/xgnKxr6hglJklGt1tDpuCwxnf4ZvyX0+LexsBbGo1cBeNZ3sBRMYvF9At6tA+LjePluBhrzBQlCSVKTYFgOzWppnTcQg2cjAq54dg7LHUCqiMjxeSQyPDInBRitDupOF3XbnYGu2f4Gbu1dmARcw2owqd8dG6YoQpYl9Lruv/fQIP2jLXE1DVK5jEqt9tckU9LUKzBCaoNOBypRqKgqmbgF27bRbreZ75Ac9Y1Gg6HVarGc4zgYjUa3SDn9kvCCbGzThClJjLTf66Hb7cJ13WtP0SPxfr+PwWDA1uPx+A6hblwHfpAkfbpMvlClUoEgCBCJaqpKJZdQlcPhkBFeKaM2ufnk+uVQWGIywZAcNgyd/MkqAyWkT6QxOjBFUQhkNJvNXw+lUCyjZTugxBpRK5bKyOdPwedOkD06Bs/nUCoLyJ8WUCiUoGo6UauxWoucqd/BTzHYuhJcnk0VAAAAAElFTkSuQmCC'); background-size: cover; display: block;\"\n  ></span>\n  <picture>\n          <source\n              srcset=\"/static/8fc03d4b599231735c10d093ee9468e5/8ac56/image-20221215224911198.webp 240w,\n/static/8fc03d4b599231735c10d093ee9468e5/d3be9/image-20221215224911198.webp 480w,\n/static/8fc03d4b599231735c10d093ee9468e5/6305f/image-20221215224911198.webp 545w\"\n              sizes=\"(max-width: 545px) 100vw, 545px\"\n              type=\"image/webp\"\n            />\n          <source\n            srcset=\"/static/8fc03d4b599231735c10d093ee9468e5/8ff5a/image-20221215224911198.png 240w,\n/static/8fc03d4b599231735c10d093ee9468e5/e85cb/image-20221215224911198.png 480w,\n/static/8fc03d4b599231735c10d093ee9468e5/3ddad/image-20221215224911198.png 545w\"\n            sizes=\"(max-width: 545px) 100vw, 545px\"\n            type=\"image/png\"\n          />\n          <img\n            class=\"gatsby-resp-image-image\"\n            src=\"/static/8fc03d4b599231735c10d093ee9468e5/3ddad/image-20221215224911198.png\"\n            alt=\"image-20221215224911198\"\n            title=\"image-20221215224911198\"\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<h3 id=\"setting-breakpoints-and-running-the-program\" style=\"position:relative;\"><a href=\"#setting-breakpoints-and-running-the-program\" aria-label=\"setting breakpoints and running the program 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>Setting Breakpoints and Running the Program</h3>\n<p>Now that the debugger is up, let’s right-click the line immediately after the <code class=\"language-text\">super_secure_checker</code> function call in the Decompiler window and set a breakpoint via [Toggle Breakpoint].</p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 669px; \"\n    >\n      <a\n    class=\"gatsby-resp-image-link\"\n    href=\"/static/e07e9af9c49d07ac3e886d0b0fa07745/99272/image-20221215225117807.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: 107.5%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAWCAYAAADAQbwGAAAACXBIWXMAAAsTAAALEwEAmpwYAAACqklEQVQ4y62Ua1PaQBSG+f9/pe30Q+vUVkWlaKv1BogoBBKSkPsmQEgIQXh7zkYRO+h0HHfmnbPJzj579ly2JMQEAytAIAyEoQ8z1DEcBUimGeIswWw2Rp6nZGPM5wnSaYL5fQ4ey+VypcdRStMZRqMxAq8GcxBB7YfQdQFVi6BoFlzPRjQ0EQR8IFlhI4xsZNn0GXQFzGZTTOIlVNVG3zBw2+6irai463Sh6Sa8YCgVhHRoNIYguX6IJEk3A3khTXPaEEPp9VGrN1FrNNFs3cF2AwnwxZAOUtDpqlC6mrRp+uTh+ij5fkwxu4dP8etppgQ1rlto3XbIY0vC2COlp8FyfDlnm6TpZqDjJhSfHE7gSuDFVZ2u3MNNq03xpJiFI7pyJK1PYsueTybJZqDrxnStOTwRUCJMXNau5dX5WrxRgsRwZTkEumljHMebgXGcYkH/ouGIkjCQML4Sq/BsLG1X1eU/Bg9s72UP8/lcTtib23aPYtiWm03LhTFwZBx5jWPH4ozzWvwiMC+AlitQv+mgThm+rDVwR+WzDmQvvYerF8DJZuDsAahZHi6aCq6bLarBHiXIkJs5ZgxzPCFjyOID1utwo4d+ICgRmvQoHMarzSwG8n+G8iFsXwY+xDCi9uMOOTu/konxRVEuj+KEOBRDLh0ORRxPXgdyTAIRwnZcshH1Nxf8eKXRmL8LcUVk2ex14FvGv7BnwPWn6H/1qoebTnvLWGX53YBchwxbLBbUgstCi7eJOSXyDe85Sj3Dh2776FtkHQGdOoaLuE8vijFw6WXh9ivmmkkyinbk777Jelq3qINKH7eO8eHrHj59O8Dn7z/xZaeCH7v72C1XUKmeYP/wCDs0rx6dYPvwFNvlY+zsHaJ6fIpy5Q92D36jfFDF0a8znJ438BcILZDLQs41GwAAAABJRU5ErkJggg=='); background-size: cover; display: block;\"\n  ></span>\n  <picture>\n          <source\n              srcset=\"/static/e07e9af9c49d07ac3e886d0b0fa07745/8ac56/image-20221215225117807.webp 240w,\n/static/e07e9af9c49d07ac3e886d0b0fa07745/d3be9/image-20221215225117807.webp 480w,\n/static/e07e9af9c49d07ac3e886d0b0fa07745/a6306/image-20221215225117807.webp 669w\"\n              sizes=\"(max-width: 669px) 100vw, 669px\"\n              type=\"image/webp\"\n            />\n          <source\n            srcset=\"/static/e07e9af9c49d07ac3e886d0b0fa07745/8ff5a/image-20221215225117807.png 240w,\n/static/e07e9af9c49d07ac3e886d0b0fa07745/e85cb/image-20221215225117807.png 480w,\n/static/e07e9af9c49d07ac3e886d0b0fa07745/99272/image-20221215225117807.png 669w\"\n            sizes=\"(max-width: 669px) 100vw, 669px\"\n            type=\"image/png\"\n          />\n          <img\n            class=\"gatsby-resp-image-image\"\n            src=\"/static/e07e9af9c49d07ac3e886d0b0fa07745/99272/image-20221215225117807.png\"\n            alt=\"image-20221215225117807\"\n            title=\"image-20221215225117807\"\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>Setting the breakpoint with <code class=\"language-text\">SW_EXECUTE</code> causes the color of the breakpointed line to change in the Listing window as well.</p>\n<p>The breakpoint can also be confirmed in the Interpreter via GDB.</p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 670px; \"\n    >\n      <a\n    class=\"gatsby-resp-image-link\"\n    href=\"/static/e77bf9a2a2c335a4fee30936556dde6a/d67fd/image-20221215225518574.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: 23.333333333333332%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAFCAYAAABFA8wzAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAz0lEQVQY061NTa+CMBDs//8xJt6MT6mCgBq1vRNejAmCoXRFCRcI89oazItnJ5md/ZjdZWmaQggBKSWSJIFSCqosnebXK9q2Rdd1aJoGVVWh73sMwwCLUf+D2aC1dgesoa5r5HkOIoJ9lmUZiqIwvLl+aXz2gb1l/Z9k+DLY7/kCTbUj3R9OK03v3pjTfaxfOY1zekLRw6ih2WecH8H9GOvNHtFOIIgOmC99eOvY1dzfYrEKEcZH+FuJqbfHwgvcThCfMOUCk3mIyU+E2UbiD5sNdi2kmzdDAAAAAElFTkSuQmCC'); background-size: cover; display: block;\"\n  ></span>\n  <picture>\n          <source\n              srcset=\"/static/e77bf9a2a2c335a4fee30936556dde6a/8ac56/image-20221215225518574.webp 240w,\n/static/e77bf9a2a2c335a4fee30936556dde6a/d3be9/image-20221215225518574.webp 480w,\n/static/e77bf9a2a2c335a4fee30936556dde6a/6cceb/image-20221215225518574.webp 670w\"\n              sizes=\"(max-width: 670px) 100vw, 670px\"\n              type=\"image/webp\"\n            />\n          <source\n            srcset=\"/static/e77bf9a2a2c335a4fee30936556dde6a/8ff5a/image-20221215225518574.png 240w,\n/static/e77bf9a2a2c335a4fee30936556dde6a/e85cb/image-20221215225518574.png 480w,\n/static/e77bf9a2a2c335a4fee30936556dde6a/d67fd/image-20221215225518574.png 670w\"\n            sizes=\"(max-width: 670px) 100vw, 670px\"\n            type=\"image/png\"\n          />\n          <img\n            class=\"gatsby-resp-image-image\"\n            src=\"/static/e77bf9a2a2c335a4fee30936556dde6a/d67fd/image-20221215225518574.png\"\n            alt=\"image-20221215225518574\"\n            title=\"image-20221215225518574\"\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>The program can be restarted from the [Quick Launch] button at the top of the Objects window.</p>\n<p>The buttons there also allow operations such as [Step Into].</p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 692px; \"\n    >\n      <a\n    class=\"gatsby-resp-image-link\"\n    href=\"/static/46999ecf3220dad79948460785ea5a51/91e7e/image-20221215230937757.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: 24.583333333333336%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAFCAYAAABFA8wzAAAACXBIWXMAAAsTAAALEwEAmpwYAAABAklEQVQY06WOS0vDUBCF8+sVxL3udKMrXYkuRIQ0MSZNK0oVpVRtS6W1MfeRW036SD7bC/EPOPBxhjPDmXG2ty7Y2b1mb9/l4NDn6Djg5DTk7Dzm8uoO17snjDvctjr4cUQYRUShh+s3OG+0cYM2XtDEjx4IwhZOfPOC5z4SNbu89wXDoWD0IZlMNEmSIYRB6ZlFZ+YPqRRCb2ZrlMbMfhiMxjiF+iId9em9dVkuC/5TiTI432ZGNk1IhURLjZIKrTefyfVlhZSSNE2tCiGsbnxjDFVVWcqytIGfIsNZlRX5emH82uNp8MxUTFktV+R5TlEUzOdzq3Vf+4vFwobUoXXgLwVmc5EZgHVrAAAAAElFTkSuQmCC'); background-size: cover; display: block;\"\n  ></span>\n  <picture>\n          <source\n              srcset=\"/static/46999ecf3220dad79948460785ea5a51/8ac56/image-20221215230937757.webp 240w,\n/static/46999ecf3220dad79948460785ea5a51/d3be9/image-20221215230937757.webp 480w,\n/static/46999ecf3220dad79948460785ea5a51/f686e/image-20221215230937757.webp 692w\"\n              sizes=\"(max-width: 692px) 100vw, 692px\"\n              type=\"image/webp\"\n            />\n          <source\n            srcset=\"/static/46999ecf3220dad79948460785ea5a51/8ff5a/image-20221215230937757.png 240w,\n/static/46999ecf3220dad79948460785ea5a51/e85cb/image-20221215230937757.png 480w,\n/static/46999ecf3220dad79948460785ea5a51/91e7e/image-20221215230937757.png 692w\"\n            sizes=\"(max-width: 692px) 100vw, 692px\"\n            type=\"image/png\"\n          />\n          <img\n            class=\"gatsby-resp-image-image\"\n            src=\"/static/46999ecf3220dad79948460785ea5a51/91e7e/image-20221215230937757.png\"\n            alt=\"image-20221215230937757\"\n            title=\"image-20221215230937757\"\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<h3 id=\"enabling-standard-input-in-the-ghidra-debugger\" style=\"position:relative;\"><a href=\"#enabling-standard-input-in-the-ghidra-debugger\" aria-label=\"enabling standard input in the ghidra debugger 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>Enabling Standard Input in the Ghidra Debugger</h3>\n<p>With the breakpoint set, let’s run the program.</p>\n<p>When running the program normally, execution pauses waiting for standard input at the <code class=\"language-text\">scanf(\"%s\", password);</code> line.</p>\n<p>However, due to an unresolved limitation in the Ghidra debugger, it is not possible to feed standard input to the program from the Interpreter.</p>\n<p>Reference: <a href=\"https://github.com/NationalSecurityAgency/ghidra/issues/3174\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">Unable to put input value into interpreter. · Issue #3174 · NationalSecurityAgency/ghidra</a></p>\n<p>To work around this, we check the tty of the running terminal and connect to it from the Ghidra debugger’s Interpreter.</p>\n<p>First, run the <code class=\"language-text\">tty</code> command in your terminal to identify the device’s pts.</p>\n<p>Next, run <code class=\"language-text\">sleep 10000000</code> in the terminal as a placeholder, then enter <code class=\"language-text\">set inferior-tty [TTY]</code> in the Ghidra debugger’s Interpreter, and restart 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: 960px; \"\n    >\n      <a\n    class=\"gatsby-resp-image-link\"\n    href=\"/static/bf20302fa98d7b4c85a6d238d51dbf00/aa61c/image-20221215234644878.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: 43.75%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAJCAYAAAAywQxIAAAACXBIWXMAAAsTAAALEwEAmpwYAAABh0lEQVQoz5WQbWvaUBSA83M0ii9J1GvCNuh+dWEU9mW0vnSbIGZs+BJNTGYSrbWtNbHPbuI2BvuweeHhHA73Pveco5hvLtCbFlrTpKbpCNHCskzabZEjhMA023lumRYfBje44RrHD4hcH9/x8WYes3CGM7VRXl+8RZivaAiLqqbRbDYQrSatPxBCRlm3LIter89wOMS2bdz5nCAKcFyHh/0j6dMRRTfkg7aJKS9XKhVqtRqaVs/jL+r1OtVqJe+22+3Sv+3x8dMto9GIaL1iPP+K601JD3sUVS1SLJ4olUqoaob6M57I6oVCAcMw6HT6LN0NCycmWK54Wt9x567YeT6PYYxSLpf5H7JPjEaDy8t3zCcvjL8krNyIxXBC6IYsgy2zaXQSZh38UygnyIRXV+8J3KOUJvj+mm+2h7eI2MQHwiA5QyhXYxgNrq87bOWYQSBHjmO+y87utween/ekaXqOUM13+HkwYPewI4pC1tGG3b0UJUhZwvF4PE+o6zrj8YS/z8vv7Aep5bNv2c0nBwAAAABJRU5ErkJggg=='); background-size: cover; display: block;\"\n  ></span>\n  <picture>\n          <source\n              srcset=\"/static/bf20302fa98d7b4c85a6d238d51dbf00/8ac56/image-20221215234644878.webp 240w,\n/static/bf20302fa98d7b4c85a6d238d51dbf00/d3be9/image-20221215234644878.webp 480w,\n/static/bf20302fa98d7b4c85a6d238d51dbf00/e46b2/image-20221215234644878.webp 960w,\n/static/bf20302fa98d7b4c85a6d238d51dbf00/fa9eb/image-20221215234644878.webp 1065w\"\n              sizes=\"(max-width: 960px) 100vw, 960px\"\n              type=\"image/webp\"\n            />\n          <source\n            srcset=\"/static/bf20302fa98d7b4c85a6d238d51dbf00/8ff5a/image-20221215234644878.png 240w,\n/static/bf20302fa98d7b4c85a6d238d51dbf00/e85cb/image-20221215234644878.png 480w,\n/static/bf20302fa98d7b4c85a6d238d51dbf00/d9199/image-20221215234644878.png 960w,\n/static/bf20302fa98d7b4c85a6d238d51dbf00/aa61c/image-20221215234644878.png 1065w\"\n            sizes=\"(max-width: 960px) 100vw, 960px\"\n            type=\"image/png\"\n          />\n          <img\n            class=\"gatsby-resp-image-image\"\n            src=\"/static/bf20302fa98d7b4c85a6d238d51dbf00/d9199/image-20221215234644878.png\"\n            alt=\"image-20221215234644878\"\n            title=\"image-20221215234644878\"\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 execution reaches the <code class=\"language-text\">scanf(\"%s\", password);</code> line, the input prompt will appear in the terminal, allowing you to provide standard input and continue the debugger session.</p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 960px; \"\n    >\n      <a\n    class=\"gatsby-resp-image-link\"\n    href=\"/static/9c0cdef24dd126bb30764bfbcd695e2f/7e881/image-20221215234728864.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: 35.416666666666664%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAHCAYAAAAIy204AAAACXBIWXMAAAsTAAALEwEAmpwYAAABQUlEQVQoz4WR7UvCUByF988Y4guRm3dOF0V9SUJFKPL/NkZKZbm53bW39qLbnHm6LhwZVAcezreH87uXO7u4hNCScdwgEJpNSFILYkvMm+cbuL27wZOxALXeYasWDM2Eqr/Atkw4voskTbHLdrvN4c6ZcEdbPmUiAlluo9Nps+4w4QlGoxEURcH9eAydGlBNDcEqRJZlCKKwEBXCbvcKhAj5Gp7nIQh7BJRKJQyHQ0ynz5hMZrDNN3jUhM86DQKk6ZpJcBBOkiSUy2VUq1VUKpWCWq3GhEfo9a7xoBhYvAL6Izt9RmHqAXSVwnFs+L6PKIpyUnY+RwgpBN+p1+v5wn6/D21uwXMyUOrCsUPE8QdjjeVyxVgyDoTi38LBAJo6Z0s8eF6EMIix2azxW/4VDpjQdS0kydeSJInzd/v5GXs+AWfejUoii/N7AAAAAElFTkSuQmCC'); background-size: cover; display: block;\"\n  ></span>\n  <picture>\n          <source\n              srcset=\"/static/9c0cdef24dd126bb30764bfbcd695e2f/8ac56/image-20221215234728864.webp 240w,\n/static/9c0cdef24dd126bb30764bfbcd695e2f/d3be9/image-20221215234728864.webp 480w,\n/static/9c0cdef24dd126bb30764bfbcd695e2f/e46b2/image-20221215234728864.webp 960w,\n/static/9c0cdef24dd126bb30764bfbcd695e2f/f992d/image-20221215234728864.webp 1440w,\n/static/9c0cdef24dd126bb30764bfbcd695e2f/74c35/image-20221215234728864.webp 1521w\"\n              sizes=\"(max-width: 960px) 100vw, 960px\"\n              type=\"image/webp\"\n            />\n          <source\n            srcset=\"/static/9c0cdef24dd126bb30764bfbcd695e2f/8ff5a/image-20221215234728864.png 240w,\n/static/9c0cdef24dd126bb30764bfbcd695e2f/e85cb/image-20221215234728864.png 480w,\n/static/9c0cdef24dd126bb30764bfbcd695e2f/d9199/image-20221215234728864.png 960w,\n/static/9c0cdef24dd126bb30764bfbcd695e2f/07a9c/image-20221215234728864.png 1440w,\n/static/9c0cdef24dd126bb30764bfbcd695e2f/7e881/image-20221215234728864.png 1521w\"\n            sizes=\"(max-width: 960px) 100vw, 960px\"\n            type=\"image/png\"\n          />\n          <img\n            class=\"gatsby-resp-image-image\"\n            src=\"/static/9c0cdef24dd126bb30764bfbcd695e2f/d9199/image-20221215234728864.png\"\n            alt=\"image-20221215234728864\"\n            title=\"image-20221215234728864\"\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>It is a somewhat cumbersome procedure, but other ways to provide standard input to the Ghidra debugger include using GDB scripts or Python.</p>\n<p>Additionally, you can provide standard input from the Ghidra Interpreter window by running a GDB command such as <code class=\"language-text\">run &lt; input.txt</code>.</p>\n<h3 id=\"inspecting-register-and-memory-information\" style=\"position:relative;\"><a href=\"#inspecting-register-and-memory-information\" aria-label=\"inspecting register and memory information 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>Inspecting Register and Memory Information</h3>\n<p>Having successfully provided standard input to the program, execution stopped at the breakpoint we set earlier.</p>\n<div class=\"gatsby-highlight\" data-language=\"c\"><pre class=\"language-c\"><code class=\"language-c\"><span class=\"token function\">printf</span><span class=\"token punctuation\">(</span><span class=\"token string\">\"Input yout password: \"</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n<span class=\"token function\">scanf</span><span class=\"token punctuation\">(</span><span class=\"token string\">\"%s\"</span><span class=\"token punctuation\">,</span> password<span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n \n<span class=\"token keyword\">int</span> len <span class=\"token operator\">=</span> <span class=\"token function\">strlen</span><span class=\"token punctuation\">(</span>password<span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n<span class=\"token keyword\">if</span> <span class=\"token punctuation\">(</span>len <span class=\"token operator\">!=</span> <span class=\"token number\">30</span><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\">\"Wrong!!\\n\"</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n    <span class=\"token keyword\">return</span> <span class=\"token number\">0</span><span class=\"token punctuation\">;</span>\n<span class=\"token punctuation\">}</span></code></pre></div>\n<p>Now let’s check the register values in the Register window, which appears in the right pane by default.</p>\n<p>Being able to reorder each register freely is quite convenient.</p>\n<p>Using the Ghidra debugger, you can view, search, and modify register values.</p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 960px; \"\n    >\n      <a\n    class=\"gatsby-resp-image-link\"\n    href=\"/static/3529692da5cf1afce23446f7450949f7/4cdc7/image-20221216000323779.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,iVBORw0KGgoAAAANSUhEUgAAABQAAAAPCAYAAADkmO9VAAAACXBIWXMAAAsTAAALEwEAmpwYAAADB0lEQVQ4y01UW2/bNhj1/wf2th/QdSjQPqzBurZpN6AXdEjXJHZjx3F8d2xZkm1dKVJ3yWeHTJONAEGKgs53Lh/Vef32HV69PsWnz2f4++wc/5z30BsMcXM7RX84Rv96jNF4jqe/neKnJyf4+dcT/PLiBE+e389nL9/gxav3eHn6Ab//+Rkd27bQ7w8gVYmmaRBLiVBFqOvaTOCIMBK4GC7wbWxjvA0x2RzQHS2xcGOMJmuMbleY2SFmWx+d9391cfLHOb58neHyaoHuYIHryRKz+QqT6Rzj6QL9wTU2lgs/VKhbIM1q2K6H5sh9kiONFCqeV6zfuewucX3j4rI7x2DoEGRHMBfuboft1oLr6ucl5isboSgg8xZCVdi6ART3/naPyBNQBSCzFh2lJPRIkpAftyj4IssqViuQ5SkV12QWYXHn0A6elUckaQXLPnAPBFyFF4OfIC2O6ASB9quBZW1wd5chTRukLJepAEVKwJYehjGWa5vMCuT8UBLw4McoKFHPnP7n1RE5i3X8IERJY+42WywJmCgtqUTsSySeDgrwQkGGtmGoAfXq7FmQ72SSITpE5lyzJ8OQDFvDcDLNyKZFXpTYewlWa4k4zhFEMWYrB1FSUBbMuvOFkax9VHxWlKuKH4AV44miEI5T0cMWZVlBsLKk+XpEbBsdigEs7wGdffQIqJPWYI8easA4jqFUzXAqAmQ8YzBlodsQAUNZMpQHD/VqJNf3MhORGf+M5DgWJhTPO3DSu7iGlDnXBIKzqRoGEDAUAsr/AN0HQFJWIjXnJpREKrRM0rLWmExocNQadvtDwjNl2Hq+b9pGS82M5ByW45l9Pl0iY5Onpm3YhyKRhqHklfO8moE0yPMSBX0syU6PkKE8AD6EogF1M6/JfM+UU+PnD4b6DicJpROgLDR4if8PISQm8zXbJX9sG30VS163YMP+dPbItXzNMM3oV6KwCwT8WNFswaoH2FtO6wDfj2A7O3z8coHL3pDXc4zv/Rv0+iOc9W5wcTXGYDDCd/6Vrga3+BeKL2XpajlPrAAAAABJRU5ErkJggg=='); background-size: cover; display: block;\"\n  ></span>\n  <picture>\n          <source\n              srcset=\"/static/3529692da5cf1afce23446f7450949f7/8ac56/image-20221216000323779.webp 240w,\n/static/3529692da5cf1afce23446f7450949f7/d3be9/image-20221216000323779.webp 480w,\n/static/3529692da5cf1afce23446f7450949f7/e46b2/image-20221216000323779.webp 960w,\n/static/3529692da5cf1afce23446f7450949f7/518ae/image-20221216000323779.webp 1327w\"\n              sizes=\"(max-width: 960px) 100vw, 960px\"\n              type=\"image/webp\"\n            />\n          <source\n            srcset=\"/static/3529692da5cf1afce23446f7450949f7/8ff5a/image-20221216000323779.png 240w,\n/static/3529692da5cf1afce23446f7450949f7/e85cb/image-20221216000323779.png 480w,\n/static/3529692da5cf1afce23446f7450949f7/d9199/image-20221216000323779.png 960w,\n/static/3529692da5cf1afce23446f7450949f7/4cdc7/image-20221216000323779.png 1327w\"\n            sizes=\"(max-width: 960px) 100vw, 960px\"\n            type=\"image/png\"\n          />\n          <img\n            class=\"gatsby-resp-image-image\"\n            src=\"/static/3529692da5cf1afce23446f7450949f7/d9199/image-20221216000323779.png\"\n            alt=\"image-20221216000323779\"\n            title=\"image-20221216000323779\"\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>At this point, because the first character of the password was wrong, the value of EAX — which holds the return value of <code class=\"language-text\">super_secure_checker</code> — is 0.</p>\n<p>Let’s change this value to 1.</p>\n<p>The Register window is in Read Only mode by default.</p>\n<p>To switch to Edit mode, click the pen-like button in the upper right.</p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 708px; \"\n    >\n      <a\n    class=\"gatsby-resp-image-link\"\n    href=\"/static/092a294d440c80233ecb93db5b245475/3cb0f/image-20221216001217355.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: 27.916666666666668%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAGCAYAAADDl76dAAAACXBIWXMAAAsTAAALEwEAmpwYAAABPUlEQVQY04WK2S8DcRRG5/9/8UgiggoRre7baElJqS6qy0w7Na0x3emuVVLq+LXBgxA3Obn3O/eTdnb3ObDaOXS4sdld2J0eHC4fTrcfj0/G7Q3i9R8RkI+RQxFOTs+JXiRJXOVIXSukskViyRynZ+f4RUeyBBOEoymUvEI+r6IoBdQFapFCQVuyuGOxONlsnnLZoFIxMM06BeG1nIJWvCGdzoi/ghRJ65TqffRGn3JjIPYXwglfaQ3JlEyiVypatbN0pVpX0KNotNFzN+hqBU1k5baFtGYLYQlesv0rMSxynHVXhFWrzFbg4ru78Ju+KCvbLjYOw8u8F0og3dU7/DeTyQu1WpP5+4/HK8yqDebD8TKORk9IunnP4/TtT8bP77QehpTKJt3BVOT5p58znMww6m0arR7TGTTvB3wAtnimOW+KbDYAAAAASUVORK5CYII='); background-size: cover; display: block;\"\n  ></span>\n  <picture>\n          <source\n              srcset=\"/static/092a294d440c80233ecb93db5b245475/8ac56/image-20221216001217355.webp 240w,\n/static/092a294d440c80233ecb93db5b245475/d3be9/image-20221216001217355.webp 480w,\n/static/092a294d440c80233ecb93db5b245475/3f436/image-20221216001217355.webp 708w\"\n              sizes=\"(max-width: 708px) 100vw, 708px\"\n              type=\"image/webp\"\n            />\n          <source\n            srcset=\"/static/092a294d440c80233ecb93db5b245475/8ff5a/image-20221216001217355.png 240w,\n/static/092a294d440c80233ecb93db5b245475/e85cb/image-20221216001217355.png 480w,\n/static/092a294d440c80233ecb93db5b245475/3cb0f/image-20221216001217355.png 708w\"\n            sizes=\"(max-width: 708px) 100vw, 708px\"\n            type=\"image/png\"\n          />\n          <img\n            class=\"gatsby-resp-image-image\"\n            src=\"/static/092a294d440c80233ecb93db5b245475/3cb0f/image-20221216001217355.png\"\n            alt=\"image-20221216001217355\"\n            title=\"image-20221216001217355\"\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 allows you to double-click any register value and write an arbitrary value to 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: 434px; \"\n    >\n      <a\n    class=\"gatsby-resp-image-link\"\n    href=\"/static/8e9ae5e4f46f2cf408192eb896eee91e/ade6e/image-20221216001312549.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: 53.333333333333336%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAALCAYAAAB/Ca1DAAAACXBIWXMAAAsTAAALEwEAmpwYAAACQ0lEQVQoz02Sa08aQRSG9wc3TbVp+qX9C72pqTFNm5gmRo22xqqJqQVBLSK6sLDLXcpFRAiwXJbl6tOzS9F+eDIz533nzMyZo6haClVLE46micQex//R9IxL1Jgym0f0rMwdTwo9cU0snkV5887D0kcfyyt+Pn0+YfVrgPXNCza3gsI533dD7O6F+HEQ4vBI5divEbgwOA/F+HWisn9wiNd7zJfVNb7t7KOcnkY4+625BIM6P4/O2Nv3yPqKyyudK0FVhbBORIsTOL/kyOtDjeoYyRQejxefzy+coEUNlK49wqU3pFY3yeYK6PE0bWtIpzdyxxkda0St0SUfjlFTozTTf6hUW9xWTczOgHyxglKQwAzVyBKMJNzxttGjcNeiWJ3RdtfN7pDxYMKwY2Pf3FEWrVTvUhYi6RLK3MIG84sbPPuwzoulTV6tbPNamFtYZ160uX88F8+Tt2vs+FW6gyHmYET+rs7L5W1379P3ayxueVEanT4O9bZNNl9GM9JSnwQteW69PdUePX3avTG5WBI9ECIjXleTuCklicpPK70BONhDpBZNMtdFqWPJXc+0B49gCaNKnYkcPhJfr3/vaoMxpDJ5FEsCVn/iBhumJcmKZIQRTpKpNvXMfPfcVOtkS7cUxGfJjR3NuUAyLQltMfRld6vbd5M5qBHd/TFTCu+c7Hjs4SMNs0O11iBXKEuHjN3Yww1b1gTZR1V+1en6uJxyGpAeDBvoyRxSIhxPq3f/gOOXTqNUaUpdpaWcmPjiqTx/AajHE/84hS77AAAAAElFTkSuQmCC'); background-size: cover; display: block;\"\n  ></span>\n  <picture>\n          <source\n              srcset=\"/static/8e9ae5e4f46f2cf408192eb896eee91e/8ac56/image-20221216001312549.webp 240w,\n/static/8e9ae5e4f46f2cf408192eb896eee91e/e6590/image-20221216001312549.webp 434w\"\n              sizes=\"(max-width: 434px) 100vw, 434px\"\n              type=\"image/webp\"\n            />\n          <source\n            srcset=\"/static/8e9ae5e4f46f2cf408192eb896eee91e/8ff5a/image-20221216001312549.png 240w,\n/static/8e9ae5e4f46f2cf408192eb896eee91e/ade6e/image-20221216001312549.png 434w\"\n            sizes=\"(max-width: 434px) 100vw, 434px\"\n            type=\"image/png\"\n          />\n          <img\n            class=\"gatsby-resp-image-image\"\n            src=\"/static/8e9ae5e4f46f2cf408192eb896eee91e/ade6e/image-20221216001312549.png\"\n            alt=\"image-20221216001312549\"\n            title=\"image-20221216001312549\"\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>Let’s also look at memory information.</p>\n<p>To open the Memory window, go to [Windows] > [Debugger] > [New Memory View] in the toolbar.</p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 642px; \"\n    >\n      <a\n    class=\"gatsby-resp-image-link\"\n    href=\"/static/8e58cf5232b45d70de5c5c7baff3c8f2/1bba8/image-20221216001606201.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: 57.08333333333333%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAALCAYAAAB/Ca1DAAAACXBIWXMAAAsTAAALEwEAmpwYAAACDElEQVQoz3VSy27TUBD1Z/IjbPgGFqy6A6WoGyRaQAi1lSpWIU1rO3H8fsePOPHbSShleZi5bSokyuLoeuaOz8w5c6WXr9/ixas3OHr/ESefLjE6vcAx4+wSH75eYTyRcX2j4nqqinMyVR7iZzChGunLlYJ3nyc4uRhj9O0HRudTHBOOTr/j5HwM3bRh2i5cL4QXRIiWKfrtz3+w3f9CtiohTVUPeZxDUVW4jouu7XF//xtDP6AoNhjPA9wqGrSFiSBKUNYd6nZLGJ5QEdp+hzjJIWWbmj4yaLoFm6bwwyVW6wr97g4F3VlRDMP24PohHLrfVC26YS8I/gbnqqaDVFHHgCb0/EgU8/hNt30s6JFkMaY3tzAtVzTaVM1/Ccu6pQmzCLO5jPnCEj/phi2ImJjlWYYFWZkJ78I4QRSnSPO1AEtkyVw7kKJ13UBalQNMMyTJJpEaCEgyd0uyAss0h2xomOuGIOAGaV4gL0pxn6QrOle0jI3ILTPyMEkzGKYjvGOPeDomPHjihyFkdU6b9kRDy/HEpJbjw6Icx7x94bEbQmLdHCgzjaTr4vvgYU3kTphC1QwijsWUnH/u2Qz7O/J3gFSTjJCew0zTsaBNc1cm5CJeUhAtYbs+1mXztLADDgt5iHeiXpKJIM5T4R2DCVnqgZCfDhPy02r7RyImoGWsy06gbgaafEe1Df4AbaEXIkgyk/QAAAAASUVORK5CYII='); background-size: cover; display: block;\"\n  ></span>\n  <picture>\n          <source\n              srcset=\"/static/8e58cf5232b45d70de5c5c7baff3c8f2/8ac56/image-20221216001606201.webp 240w,\n/static/8e58cf5232b45d70de5c5c7baff3c8f2/d3be9/image-20221216001606201.webp 480w,\n/static/8e58cf5232b45d70de5c5c7baff3c8f2/7eb86/image-20221216001606201.webp 642w\"\n              sizes=\"(max-width: 642px) 100vw, 642px\"\n              type=\"image/webp\"\n            />\n          <source\n            srcset=\"/static/8e58cf5232b45d70de5c5c7baff3c8f2/8ff5a/image-20221216001606201.png 240w,\n/static/8e58cf5232b45d70de5c5c7baff3c8f2/e85cb/image-20221216001606201.png 480w,\n/static/8e58cf5232b45d70de5c5c7baff3c8f2/1bba8/image-20221216001606201.png 642w\"\n            sizes=\"(max-width: 642px) 100vw, 642px\"\n            type=\"image/png\"\n          />\n          <img\n            class=\"gatsby-resp-image-image\"\n            src=\"/static/8e58cf5232b45d70de5c5c7baff3c8f2/1bba8/image-20221216001606201.png\"\n            alt=\"image-20221216001606201\"\n            title=\"image-20221216001606201\"\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>From here you can view and edit memory contents.</p>\n<p>We won’t be using this in detail today, but memory search is also available here.</p>\n<p>Additionally, a camera-like button in the upper right appears to allow capturing a snapshot of memory at a given point during debugging.</p>\n<p>This seems like a quite useful feature.</p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 960px; \"\n    >\n      <a\n    class=\"gatsby-resp-image-link\"\n    href=\"/static/ce3724d57ef692c723970c4ca23d360f/fd84e/image-20221216003052034.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: 55.41666666666667%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAALCAYAAAB/Ca1DAAAACXBIWXMAAAsTAAALEwEAmpwYAAACXUlEQVQoz12SW08TURSF+281vigaDQZKFUi1cguRP2GiLxqkF0qpbedeZtphrr1MK4GXFpzahAIFlmtGI2iTnX3mtP3Ot/acxOzcIhZepZFcWMZc8jXmU8tYXF7BUnoN6cwG1ta3sLaxhdX193i3uok3mXXWxl29/f2cWdnEfHIJiQ8fPyFfLCNb2MN2No9scR/5vSpypQp2KyLKNQWyasBoOjDtFiy3A8cP4nLbfbSCY5iWD79zhGKphsT21xwkRYPTtOAbJkxNh6M3YbP77FGlFjN48GgGj2dm8WI2hWQqjafP5zHz7CUePlnAl2wZw9MQ2XwJCUVV0e52gTAEggDjVgvo9XDBPu33ccXvdnYK+LxdQKkiQ9IaqMk6KoIGieaFfQl6w0T0ESUVCUEQYTkOrgcD3BLyk+tJu41zy8IPwr6zVxlbIMRt9Vh9GKbLVDoOGjZ004Pr+XdAWVbgE3B9dhabTbkedTqYeB5wdISR7/OHdeyVRQKiObYJ9FAT66hxX9JMOK73r6Hturg5PcM1DYc0igwvbBsTgkM+i6KKqqjFFVlFYEE+gFI347Xj3AMqfwxBwyvO8IRwEHTDfsLIA9eByMi7+wLnpqJ56Meg0jcaG4zc9GA7/xk6/PPlcIhLxjvnDKeMe0vDCwJP2TW+iIbVYpIubC/g1enGFdlqugXXvTdDRVFjwykNQ/YwgnGWYx4SEjhiZK3Oa8SX0TgMaNQnKKoe4T00o4PuG1YqVTRME7c05FE4NgyMaQrujQgf0FCW68iVFV4Xzk0z4oselcT9qqCgG/T+An8BNZzpa9/rV0YAAAAASUVORK5CYII='); background-size: cover; display: block;\"\n  ></span>\n  <picture>\n          <source\n              srcset=\"/static/ce3724d57ef692c723970c4ca23d360f/8ac56/image-20221216003052034.webp 240w,\n/static/ce3724d57ef692c723970c4ca23d360f/d3be9/image-20221216003052034.webp 480w,\n/static/ce3724d57ef692c723970c4ca23d360f/e46b2/image-20221216003052034.webp 960w,\n/static/ce3724d57ef692c723970c4ca23d360f/663aa/image-20221216003052034.webp 1056w\"\n              sizes=\"(max-width: 960px) 100vw, 960px\"\n              type=\"image/webp\"\n            />\n          <source\n            srcset=\"/static/ce3724d57ef692c723970c4ca23d360f/8ff5a/image-20221216003052034.png 240w,\n/static/ce3724d57ef692c723970c4ca23d360f/e85cb/image-20221216003052034.png 480w,\n/static/ce3724d57ef692c723970c4ca23d360f/d9199/image-20221216003052034.png 960w,\n/static/ce3724d57ef692c723970c4ca23d360f/fd84e/image-20221216003052034.png 1056w\"\n            sizes=\"(max-width: 960px) 100vw, 960px\"\n            type=\"image/png\"\n          />\n          <img\n            class=\"gatsby-resp-image-image\"\n            src=\"/static/ce3724d57ef692c723970c4ca23d360f/d9199/image-20221216003052034.png\"\n            alt=\"image-20221216003052034\"\n            title=\"image-20221216003052034\"\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<h3 id=\"obtaining-the-flag\" style=\"position:relative;\"><a href=\"#obtaining-the-flag\" aria-label=\"obtaining the flag 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>Obtaining the Flag</h3>\n<p>Now, let’s actually retrieve the flag.</p>\n<p>My original plan was to use GhidraScript or a Python interpreter launched via Ghidrathon to brute-force the flag, but unfortunately I abandoned that approach.</p>\n<p>The API for controlling the Ghidra debugger from Python does exist as <code class=\"language-text\">FlatDebuggerAPI</code>, importable with <code class=\"language-text\">from ghidra.debug.flatapi import FlatDebuggerAPI</code>, but unfortunately <code class=\"language-text\">FlatDebuggerAPI</code> is not yet documented on <a href=\"https://ghidra.re/ghidra_docs/api/index.html\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">ghidra_docs</a>, and there are no issues or sample code to reference, making it difficult to implement.</p>\n<p>Methods named things like <code class=\"language-text\">writeMemory</code> and <code class=\"language-text\">breakpointSetSoftwareExecute</code> do appear to be implemented, so it might be usable by reading the source code directly — but searching GitHub for code using <code class=\"language-text\">ghidra.debug.flatapi</code> returned almost nothing, suggesting it isn’t being used much yet.</p>\n<p>I was able to use <a href=\"https://github.com/NationalSecurityAgency/ghidra/blob/6a1a64921350bb4d9bbd2db6bb6f827afe4346c8/Ghidra/Debug/Debugger/ghidra_scripts/DemoDebuggerScript.java\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">the only available sample code</a> to restart the program and read memory and register values, so with effort it should be implementable.</p>\n<p>So instead, we’ll retrieve the flag by combining Ghidra debugger GUI operations.</p>\n<p>First, delete the earlier breakpoint we set to capture the return value of <code class=\"language-text\">super_secure_checker</code>, and set a new breakpoint at the address inside <code class=\"language-text\">super_secure_checker</code> where the decrypted flag character is loaded into a register and compared against the input.</p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 960px; \"\n    >\n      <a\n    class=\"gatsby-resp-image-link\"\n    href=\"/static/d5dc91933069d29b0b3c26dd9bffd806/f680b/image-20221217210054982.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: 71.25%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAOCAYAAAAvxDzwAAAACXBIWXMAAAsTAAALEwEAmpwYAAACT0lEQVQ4y4WTW2/TQBSE8///Ag8ggfqGeCqqoEKoBdTUSdNm08ROk/SStrn4nvV11/YwNrQQFYWVjrJWdj/NzDnbOvh0iP2PB/jy9TtOjR6M7gW65wLnYghzPGXNYF7N0L+0MJ7coN3p4+i4C8MQPC/Q6fDsmYDoj2CNrtBaLNYYDi8xHj+iXnlWIMlTBMkG/1piOMFyeQfoCloDKgMqVT3/3xLWHO0TA92za8RJBdfL4AQxHlwPMtKI4oKlIVlJVqE/GMN1bV4tURQFyrrKEmVVoqoqtGY3c1yIPkbjOZVp+IR5UmIZeASliKIYUsbYyAhxnEDQehhGjZoa8LTqfQN8t3eMV69/4M3bE+y9N/Bhv4f9zz0cHgl8OzWZ2QC98z7OLgZoGx2ctDsEyi3IUzWWHxc20lQhyxR8WyJgSSrwFiHcVQzXiZlV0djjLQzNKwTB5oXC5wxtx/2TgS4ZDYtBFz4Bstw6rCsFMTK3FL4Arm2HjIo5SVgcE8cBc1P8zvlrs1EhCipUuWoujKzpboVr262dYLMJIYSJ+bze51SRIQwcLBf3iIMQsV+romVrthu4Wv9SGMURbm/vcX0N+D7HJMqQpcyTIKW5z5gD525oTXYD7x5WKAi0vRDdrsCUQNvL4fgZ7lcrTO8eITcJQo6OoutLk5bDHUDX9ZHndZdTvgAHgc+eZBziRDHDlGrTv47XXZ78B+gFjR2lFQc3ZTPQNCQM08aqLovfl/nMyrrL1u4u10DFR5mmtUK7sRUxP9eNma3eGlpN4IDAYAfwJxErKu8+WqE6AAAAAElFTkSuQmCC'); background-size: cover; display: block;\"\n  ></span>\n  <picture>\n          <source\n              srcset=\"/static/d5dc91933069d29b0b3c26dd9bffd806/8ac56/image-20221217210054982.webp 240w,\n/static/d5dc91933069d29b0b3c26dd9bffd806/d3be9/image-20221217210054982.webp 480w,\n/static/d5dc91933069d29b0b3c26dd9bffd806/e46b2/image-20221217210054982.webp 960w,\n/static/d5dc91933069d29b0b3c26dd9bffd806/17ad2/image-20221217210054982.webp 1108w\"\n              sizes=\"(max-width: 960px) 100vw, 960px\"\n              type=\"image/webp\"\n            />\n          <source\n            srcset=\"/static/d5dc91933069d29b0b3c26dd9bffd806/8ff5a/image-20221217210054982.png 240w,\n/static/d5dc91933069d29b0b3c26dd9bffd806/e85cb/image-20221217210054982.png 480w,\n/static/d5dc91933069d29b0b3c26dd9bffd806/d9199/image-20221217210054982.png 960w,\n/static/d5dc91933069d29b0b3c26dd9bffd806/f680b/image-20221217210054982.png 1108w\"\n            sizes=\"(max-width: 960px) 100vw, 960px\"\n            type=\"image/png\"\n          />\n          <img\n            class=\"gatsby-resp-image-image\"\n            src=\"/static/d5dc91933069d29b0b3c26dd9bffd806/d9199/image-20221217210054982.png\"\n            alt=\"image-20221217210054982\"\n            title=\"image-20221217210054982\"\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>Running the program, we can see that the character ‘A’ (which we provided as arbitrary input) is stored in the DIL register, and is being compared against ‘H’, the first character of the decrypted flag.</p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 634px; \"\n    >\n      <a\n    class=\"gatsby-resp-image-link\"\n    href=\"/static/26dc471a395933675925351b06c00ec0/374ac/image-20221217212333909.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: 17.916666666666668%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAECAYAAACOXx+WAAAACXBIWXMAAAsTAAALEwEAmpwYAAABBUlEQVQY03XKW0vCcACG8X3lDIoONx2IogKjjIhCkbAuSopZmpptM09Z0YFmEGhYQZHmadOca0//uqirLn7wwPtKrn6ZoeEIfS6ZgcF9RkbDjI1HmZiMMTUdZ2Y2wdz8Me4FhSVPkkWPyvKK9mN1Lcm6N4XPn8a/kSGwlUVyezU2A3Hk0BmH0Svhku0djdDBKapyQzCoEI7kicbO2d3TUNRrjhIXnKRvSQnpjE4mq5PN6eTyBaRC6ZFqvcEn0HPAEmF+9OjYDr16k9fyE4ZlU2+a3Bcf6Iq93bURF8Gh8836I5WfK+h3RUrlF2otC6OD4GB0ofZuUqkamKIbhs1brf27t/7xBXriFDA5E9PkAAAAAElFTkSuQmCC'); background-size: cover; display: block;\"\n  ></span>\n  <picture>\n          <source\n              srcset=\"/static/26dc471a395933675925351b06c00ec0/8ac56/image-20221217212333909.webp 240w,\n/static/26dc471a395933675925351b06c00ec0/d3be9/image-20221217212333909.webp 480w,\n/static/26dc471a395933675925351b06c00ec0/14369/image-20221217212333909.webp 634w\"\n              sizes=\"(max-width: 634px) 100vw, 634px\"\n              type=\"image/webp\"\n            />\n          <source\n            srcset=\"/static/26dc471a395933675925351b06c00ec0/8ff5a/image-20221217212333909.png 240w,\n/static/26dc471a395933675925351b06c00ec0/e85cb/image-20221217212333909.png 480w,\n/static/26dc471a395933675925351b06c00ec0/374ac/image-20221217212333909.png 634w\"\n            sizes=\"(max-width: 634px) 100vw, 634px\"\n            type=\"image/png\"\n          />\n          <img\n            class=\"gatsby-resp-image-image\"\n            src=\"/static/26dc471a395933675925351b06c00ec0/374ac/image-20221217212333909.png\"\n            alt=\"image-20221217212333909\"\n            title=\"image-20221217212333909\"\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 in the Ghidra debugger’s Register window, the Type column can be set to any data type, and when a Value matches the specified type, the Repr column displays the type’s representation.</p>\n<p>To let execution continue, we use the Register window’s edit mode to overwrite the AL register value with 0x41.</p>\n<p>This allows the password verification to pass, so continuing execution reveals the second flag character.</p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 406px; \"\n    >\n      <a\n    class=\"gatsby-resp-image-link\"\n    href=\"/static/f508f429e7ae78467e2a519c34af7451/e33ef/image-20221217213550602.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: 26.25%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAFCAYAAABFA8wzAAAACXBIWXMAAAsTAAALEwEAmpwYAAABUklEQVQY00WNy0sCcRhF53+sNklBYZtqUYuCalPRYx3tjBZKi4lwfCRqWO4UrKg0xMrHlIaa+RidyczJTr+xRYsD9ztc7iftbB1jG5eZmFQYt7kZGZUZHZOZmlawz3iw273MzQeYnfOzsBgYsrQcZmU1zOpamPWNc9Y3LSJs70aR9o5ibOxHOTiM4HCEkOUYbncCRUng8SRwuc5xOiP4vAmC4VtOlDgu5xmngUuCwWvRj+LzxwmFrvD7Y0gXN1miqQLppyyFlxea7Q6abtASNDs6pUoVtVjiva3TrtUp5/Jk8gVqjRYN4W6SKbLqM3XN6r4h3d0/kH58plgsY3S/MQfQ6//TF7flzB/Qak0qagnN6GF+w5cJmccc5Wp92OkLJyXTWZ7UihhVST/kxbdX3hoG+ie0PwZ/dAdixCSVyZEv1WiJbPlO94dq3eBd6w2z5X4BfxNR/M9mjb0AAAAASUVORK5CYII='); background-size: cover; display: block;\"\n  ></span>\n  <picture>\n          <source\n              srcset=\"/static/f508f429e7ae78467e2a519c34af7451/8ac56/image-20221217213550602.webp 240w,\n/static/f508f429e7ae78467e2a519c34af7451/09a6f/image-20221217213550602.webp 406w\"\n              sizes=\"(max-width: 406px) 100vw, 406px\"\n              type=\"image/webp\"\n            />\n          <source\n            srcset=\"/static/f508f429e7ae78467e2a519c34af7451/8ff5a/image-20221217213550602.png 240w,\n/static/f508f429e7ae78467e2a519c34af7451/e33ef/image-20221217213550602.png 406w\"\n            sizes=\"(max-width: 406px) 100vw, 406px\"\n            type=\"image/png\"\n          />\n          <img\n            class=\"gatsby-resp-image-image\"\n            src=\"/static/f508f429e7ae78467e2a519c34af7451/e33ef/image-20221217213550602.png\"\n            alt=\"image-20221217213550602\"\n            title=\"image-20221217213550602\"\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>Repeating this operation 30 times yielded the flag <code class=\"language-text\">HimitsukichiCTF{you_w0n_dra!!}</code>.</p>\n<h2 id=\"using-the-ghidra-debugger-on-windows\" style=\"position:relative;\"><a href=\"#using-the-ghidra-debugger-on-windows\" aria-label=\"using the ghidra debugger on 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>Using the Ghidra Debugger on Windows</h2>\n<p>Having come this far, let’s also try the Ghidra debugger on Windows.</p>\n<p>The file used is a PE file built with Visual Studio 2022 from the same <code class=\"language-text\">task.c</code> as before.</p>\n<p>The sample program is available for download at <a href=\"/file/task.exe\">Sample Program</a>.</p>\n<h3 id=\"starting-the-debugger-1\" style=\"position:relative;\"><a href=\"#starting-the-debugger-1\" aria-label=\"starting the debugger 1 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>Starting the Debugger</h3>\n<p>The basic operation is the same as on Linux, but on Windows the debugger depends on WinDbg rather than GDB, so if WinDbg is not set up in your environment, you will need to install it beforehand.</p>\n<p>Also, as with WinDbg, High Integrity is required for memory access even when analyzing user-mode programs.</p>\n<p>Therefore, launch Ghidra with administrator privileges.</p>\n<p>Once Ghidra is open, select [in dbgeng locally IN-VM] from the [Debugger] toolbar to start the debugger.</p>\n<p>dbgeng is the interface used by Windows debuggers such as WinDbg.</p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 670px; \"\n    >\n      <a\n    class=\"gatsby-resp-image-link\"\n    href=\"/static/a63190e7bd42b876fb867cfafbebe16a/d67fd/image-20221217221018539.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.91666666666667%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAJCAYAAAAywQxIAAAACXBIWXMAAAsTAAALEwEAmpwYAAABzUlEQVQoz0VSaWsUQRCd/+1H/4Ug+E0IEsXgEoQgIRE0imFzGNy5tq/pue/J7mZn51ndm9VhHtV0V71+r6qdPMuQJikinWApY+gkw24zABjpXwPT0x67De1t7XoatxjHEdM04fAd1k6WJoiVgK9yvP6q8eaC4f0Vw8m1xsk8xel9idltjk83GU5/V5hRnC8EpJSIIo08zy2GYUDXdXDevvuAo+OPmJ1d4Jtf4vxe4exG4PwhwaVb4tKrcMUH/CB8Zz1+igF3YQIpJMIgQBiG8DwPRVnC9304L4/neHH0C68+30KLEHWRospiizrfY93V2AwNocX2sYXPIoRLDnexgJIKGbWtbVsIIeAcevC03aEoCmtDx9RLHVNfNe2VaNoO+fOZsRfwGIxLq8go5Fygqipr+5lwwmq1glCKbJgEbgvNBSVZMTAFBm3bwGOaCIW1zBiD67qISUTf9/8VPq7WcHliyYTgNkolbbQXELmx1RGhzzWWxvKfhVVoYOzaoRwI22GNLw+ZPTAEjBExqYhUZBMNWdM06LsWLvVwyehl0DCMo4CsM6ox5/8IB1J4HWTgRKiUtImaemaS6rreR4KxHJBCZgl9BGbSBDtpcvEX2jWZ91dLT7sAAAAASUVORK5CYII='); background-size: cover; display: block;\"\n  ></span>\n  <picture>\n          <source\n              srcset=\"/static/a63190e7bd42b876fb867cfafbebe16a/8ac56/image-20221217221018539.webp 240w,\n/static/a63190e7bd42b876fb867cfafbebe16a/d3be9/image-20221217221018539.webp 480w,\n/static/a63190e7bd42b876fb867cfafbebe16a/6cceb/image-20221217221018539.webp 670w\"\n              sizes=\"(max-width: 670px) 100vw, 670px\"\n              type=\"image/webp\"\n            />\n          <source\n            srcset=\"/static/a63190e7bd42b876fb867cfafbebe16a/8ff5a/image-20221217221018539.png 240w,\n/static/a63190e7bd42b876fb867cfafbebe16a/e85cb/image-20221217221018539.png 480w,\n/static/a63190e7bd42b876fb867cfafbebe16a/d67fd/image-20221217221018539.png 670w\"\n            sizes=\"(max-width: 670px) 100vw, 670px\"\n            type=\"image/png\"\n          />\n          <img\n            class=\"gatsby-resp-image-image\"\n            src=\"/static/a63190e7bd42b876fb867cfafbebe16a/d67fd/image-20221217221018539.png\"\n            alt=\"image-20221217221018539\"\n            title=\"image-20221217221018539\"\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>Since we are doing local debugging this time, proceed with the default [Connect] 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: 347px; \"\n    >\n      <a\n    class=\"gatsby-resp-image-link\"\n    href=\"/static/dd40bcc7e8e8a79e9d8c5ca03dfef1f8/39e45/image-20221217221345171.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: 87.5%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAASCAYAAABb0P4QAAAACXBIWXMAAAsTAAALEwEAmpwYAAACR0lEQVQ4y6VU2a7aQAzN//9KX1q1j5UAAUK9atkhZF+AQIAkhPXx1McQilqhqreRjmbiGR8vY9tYJinsMMYmTZEkCTabDfI8R5Zluv4N1b3tdqv6RrTcYRKkyHc7JMsEp9MR7/mu1ytSccpYr1co8gzr9VoFr0DPX51Rl54ul0sYcRzj29sbWq0W2u02ms0m6vW67inrdDpoNBqo1WrodrsYDAZ/YDgcot/vw/M8IYwimFMTpmliNBrB9304jgPLsnQ/Ho91TxlBGRV934Nt2wiCQHUZqXoYhoEqEOPxBGEUw5KLrusiCEOxPIB9J5tMJip3BCS1rNu9kRhNVissFkJIVtf1MJvN7p7ZSmTfSeN4LnsHocgOxyP2+z3K8qDKJC6KPS7yIJSFEq2xWCyUjOHSSxJ5nvswwBC5Z2gsDT4OQUM8L8sS5/MFx+MJUUU4nU41uczF9J5PXqacBnhGYzTa6/UUnudrBCS7XC5SbmchjGHM53MUEsbhUIr7hYZUgdZ/XytUd6hDZFLcYRjdCLMsfxz8KyriPC9+EbJ1nq29h/RByOTSw/8nzLUS9FHS+8ul2l4vsHkhe2B7e2XWIa3sZDiwH/fS16XUVlnkD1BGD569ep42qrcvwPQZK6lwFqceCoIkgxlHsOYrOPONwktuw4PjiRER1KOsImbY2no80DKgl5LYjrPD5+9f8KkzwIevP/CxNUbLEUOBr/XJwcFBwbpkziqPyXHv5VALlL1JmLYrvSytaHN/+yeq4VCBBc+VOpU+15+RQC05grA2MAAAAABJRU5ErkJggg=='); background-size: cover; display: block;\"\n  ></span>\n  <picture>\n          <source\n              srcset=\"/static/dd40bcc7e8e8a79e9d8c5ca03dfef1f8/8ac56/image-20221217221345171.webp 240w,\n/static/dd40bcc7e8e8a79e9d8c5ca03dfef1f8/2baae/image-20221217221345171.webp 347w\"\n              sizes=\"(max-width: 347px) 100vw, 347px\"\n              type=\"image/webp\"\n            />\n          <source\n            srcset=\"/static/dd40bcc7e8e8a79e9d8c5ca03dfef1f8/8ff5a/image-20221217221345171.png 240w,\n/static/dd40bcc7e8e8a79e9d8c5ca03dfef1f8/39e45/image-20221217221345171.png 347w\"\n            sizes=\"(max-width: 347px) 100vw, 347px\"\n            type=\"image/png\"\n          />\n          <img\n            class=\"gatsby-resp-image-image\"\n            src=\"/static/dd40bcc7e8e8a79e9d8c5ca03dfef1f8/39e45/image-20221217221345171.png\"\n            alt=\"image-20221217221345171\"\n            title=\"image-20221217221345171\"\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>Command-line arguments can be specified here if needed.</p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 478px; \"\n    >\n      <a\n    class=\"gatsby-resp-image-link\"\n    href=\"/static/29cb494942e9e0a149750fe37cdea72b/50978/image-20221217221439913.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: 29.583333333333332%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAGCAYAAADDl76dAAAACXBIWXMAAAsTAAALEwEAmpwYAAABFUlEQVQY012QS2+DMBCE+f+/qVIPVQ99RU2TigZibGMetgOCAGmU5jDddYjU9PBp2LV3xmxUWo9MF/DOwloL73dwzsHWNfU8alKmaRqM44hhGIL+h/s8H+WlRe1aOCrq2ZCNyqIM6qyjnseeBs7nM06nH+KE7+PxhiPBwZFSCsbkyKSEUhqS6jw3MEWBLJOQUgX4bLsVoWdMga7r/9Ch6/d0TyLSWoeBzSaBEAKKaq1zcJAmJBlxgCAzFb7zcM4ruLJjbduLIT/zcDhgmqZ5HwMG0oXwuFsIPL5/4S2tYGqPbZogjmNUVYW+728IO+RfNsbMqZf0K89rgfuXTzy8fuBpRUZJivVqheVyiSRJbu4y7MMv/AVTwLs/nfb8oAAAAABJRU5ErkJggg=='); background-size: cover; display: block;\"\n  ></span>\n  <picture>\n          <source\n              srcset=\"/static/29cb494942e9e0a149750fe37cdea72b/8ac56/image-20221217221439913.webp 240w,\n/static/29cb494942e9e0a149750fe37cdea72b/2b263/image-20221217221439913.webp 478w\"\n              sizes=\"(max-width: 478px) 100vw, 478px\"\n              type=\"image/webp\"\n            />\n          <source\n            srcset=\"/static/29cb494942e9e0a149750fe37cdea72b/8ff5a/image-20221217221439913.png 240w,\n/static/29cb494942e9e0a149750fe37cdea72b/50978/image-20221217221439913.png 478w\"\n            sizes=\"(max-width: 478px) 100vw, 478px\"\n            type=\"image/png\"\n          />\n          <img\n            class=\"gatsby-resp-image-image\"\n            src=\"/static/29cb494942e9e0a149750fe37cdea72b/50978/image-20221217221439913.png\"\n            alt=\"image-20221217221439913\"\n            title=\"image-20221217221439913\"\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 the debugger starts, a WinDbg-like console appears in the Interpreter window, just as with GDB.</p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 960px; \"\n    >\n      <a\n    class=\"gatsby-resp-image-link\"\n    href=\"/static/f942deac71569cd22a69162b3f34cf6f/9239a/image-20221217221508893.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: 64.16666666666666%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAANCAYAAACpUE5eAAAACXBIWXMAAAsTAAALEwEAmpwYAAAB70lEQVQ4y42T646jMAyFef+X2/7ptExbbgUawiWBhksS4IxD1e7MSrOqJSuCJJ/t+NgrygKXMEJ71+gn5xPk0EHP9uHWwCwz6rpGG8UYZYuxbbEohbXvAefzjBVk6wqPOWCS4MoGlEJB0MFSMlSt2LwdFAarwasSvOCQBJRth1FrTMZgonUm4INHQCEa3DIG0SyYxhlGz1BdDU2ZPk49FiEENF1+mrv83V9Ape5grMT9DlgKZO0K1VNZ0whj7AvQdd0ryBPw3Z7/vN1uh92fHT72Ps7nM8IwQBRH4LxASe7WgjHEUfjK8N/sfmR4Op2w90PsLxn8qIAfkF84okzgnFQIshqXtKLGxT+Av5m3lUOVFFRy2a/IhUXEJiTljLRetv+cGskqSU/wBtC9C5caYTHglE4ImMYh7hByg0zMuLUL8nZFVtSw7wAt6Uwog7TscQw63ARlI+i7GVGpBbWirOuR9qnL7wANaclaC0myyDMnDZB8SF8UaF6W7ZDbu3FOQPNrU57uuYd28pBSElDCKcMBlR5oSh6yaeoG7MZg3gE6lS/LuumMF8pND2jSsOBvWdM4oabpeAb4n3lNQ9FJZ2EQ4nA4k3/iePARhCGS6xVpmiIIAnwcffifFyQ0pnEc40p78TVFnKTI85wYfJv3L6x/62W5bBkbAAAAAElFTkSuQmCC'); background-size: cover; display: block;\"\n  ></span>\n  <picture>\n          <source\n              srcset=\"/static/f942deac71569cd22a69162b3f34cf6f/8ac56/image-20221217221508893.webp 240w,\n/static/f942deac71569cd22a69162b3f34cf6f/d3be9/image-20221217221508893.webp 480w,\n/static/f942deac71569cd22a69162b3f34cf6f/e46b2/image-20221217221508893.webp 960w,\n/static/f942deac71569cd22a69162b3f34cf6f/0d9bd/image-20221217221508893.webp 1246w\"\n              sizes=\"(max-width: 960px) 100vw, 960px\"\n              type=\"image/webp\"\n            />\n          <source\n            srcset=\"/static/f942deac71569cd22a69162b3f34cf6f/8ff5a/image-20221217221508893.png 240w,\n/static/f942deac71569cd22a69162b3f34cf6f/e85cb/image-20221217221508893.png 480w,\n/static/f942deac71569cd22a69162b3f34cf6f/d9199/image-20221217221508893.png 960w,\n/static/f942deac71569cd22a69162b3f34cf6f/9239a/image-20221217221508893.png 1246w\"\n            sizes=\"(max-width: 960px) 100vw, 960px\"\n            type=\"image/png\"\n          />\n          <img\n            class=\"gatsby-resp-image-image\"\n            src=\"/static/f942deac71569cd22a69162b3f34cf6f/d9199/image-20221217221508893.png\"\n            alt=\"image-20221217221508893\"\n            title=\"image-20221217221508893\"\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<h3 id=\"setting-breakpoints\" style=\"position:relative;\"><a href=\"#setting-breakpoints\" aria-label=\"setting breakpoints 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>Setting Breakpoints</h3>\n<p>With the debugger running, use the decompiler to locate the <code class=\"language-text\">main</code> function’s address and set a breakpoint.</p>\n<p>Static analysis of the PE file is out of scope today, but following the entry function should lead you to <code class=\"language-text\">main</code> quickly.</p>\n<p>Possibly due to compiler optimizations, the decompiled output showed the <code class=\"language-text\">super_secure_checker</code> function’s logic inlined into <code class=\"language-text\">main</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: 593px; \"\n    >\n      <a\n    class=\"gatsby-resp-image-link\"\n    href=\"/static/cdd28ef8f7fa714cd3508ae79d0fee26/0b5b1/image-20221217222119584.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: 64.99999999999999%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAANCAYAAACpUE5eAAAACXBIWXMAAAsTAAALEwEAmpwYAAABoklEQVQ4y5VT6Y6bMBjk/R9uK20SSH+0arUhCRsOH+DbTAfSrZq0226MPhmwPJ7jc1GWe4yjg3MTYvQsh5gS5jmz5l+1jLf5X6PYbkukZKDkVwJ3kPI7Jmtxv/cjYCtgVVWw1qPvRxgjME0NrBvJWMJ7Mg9+QcP6fITh8/OG7DwOtUA3nGHGV4hRoBVfYKYeIaYb6f8rMvxM3wysqWGcxWADpjRD+oSYMx4dxXazobwMIRbQgf4p6EW6lfy2kGaC8gHCeShLC6xACA6Wdmid6bmGUgpSKNo1XT1cnNF6hFYDQc5cWIA1EuX6GOGYuk/X98ROSCmuneD9zAok5NY5cr3Y7XaIQaFrOww8pdUHXMYLTrLhxvS45KraMd0BKf/stbtWebSKp6dPeHlpcDqecGlfMToNx+YOlPUHKN7m69F/ayNKLmmypWwCecsAFEww9Mvf8b2hjvdasijLHU41cDgAR1bfMpCxZjBn9F2H5tuE7igh6wZ66OB5+HLO71fyBnC/r9C2Gc058sZcU4vJImem6zPTzrw5S4LT+j+uzN+X/AOqDPdU4Lb7cgAAAABJRU5ErkJggg=='); background-size: cover; display: block;\"\n  ></span>\n  <picture>\n          <source\n              srcset=\"/static/cdd28ef8f7fa714cd3508ae79d0fee26/8ac56/image-20221217222119584.webp 240w,\n/static/cdd28ef8f7fa714cd3508ae79d0fee26/d3be9/image-20221217222119584.webp 480w,\n/static/cdd28ef8f7fa714cd3508ae79d0fee26/ee627/image-20221217222119584.webp 593w\"\n              sizes=\"(max-width: 593px) 100vw, 593px\"\n              type=\"image/webp\"\n            />\n          <source\n            srcset=\"/static/cdd28ef8f7fa714cd3508ae79d0fee26/8ff5a/image-20221217222119584.png 240w,\n/static/cdd28ef8f7fa714cd3508ae79d0fee26/e85cb/image-20221217222119584.png 480w,\n/static/cdd28ef8f7fa714cd3508ae79d0fee26/0b5b1/image-20221217222119584.png 593w\"\n            sizes=\"(max-width: 593px) 100vw, 593px\"\n            type=\"image/png\"\n          />\n          <img\n            class=\"gatsby-resp-image-image\"\n            src=\"/static/cdd28ef8f7fa714cd3508ae79d0fee26/0b5b1/image-20221217222119584.png\"\n            alt=\"image-20221217222119584\"\n            title=\"image-20221217222119584\"\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>So, as on Linux, we set an <code class=\"language-text\">SW_EXECUTE</code> breakpoint at the line that compares the input value against the decrypted password.</p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 895px; \"\n    >\n      <a\n    class=\"gatsby-resp-image-link\"\n    href=\"/static/16f45ef5adfe5976d1ade4bca107cec6/fcbaf/image-20221217222250084.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: 21.666666666666668%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAECAYAAACOXx+WAAAACXBIWXMAAAsTAAALEwEAmpwYAAAA9klEQVQY0x3Py07DMBSE4bz/2yCxR6gLFkhIBaTS0pK0OG3iXHyJEzu3/lhsj3RmvknGEPB+ZAwQ/IJSA6OfuY8LQ+8ZhoFlmhA3xfYo2KU3dlnB10WSScu5tLSqorPV/29SVoq8sFQtOH+n1oE+rNSlo2gs2nn6WPApHA9vgsfXlKe9YnPqeD5aXn4MHyfBNb9iu45E5AVpVlGUMbBfqeqoCiPXUtKagRB107pGheZyzmhkidUtzmq8szTxvtl+c9jvMNaSaKWoK0MMZ5nvceLEuqzotkMbzxinz/OKcz1CCNI0o24ajDFIKbnJmvfjbxTmEdTzBw4XLa1NKPDoAAAAAElFTkSuQmCC'); background-size: cover; display: block;\"\n  ></span>\n  <picture>\n          <source\n              srcset=\"/static/16f45ef5adfe5976d1ade4bca107cec6/8ac56/image-20221217222250084.webp 240w,\n/static/16f45ef5adfe5976d1ade4bca107cec6/d3be9/image-20221217222250084.webp 480w,\n/static/16f45ef5adfe5976d1ade4bca107cec6/dcb2d/image-20221217222250084.webp 895w\"\n              sizes=\"(max-width: 895px) 100vw, 895px\"\n              type=\"image/webp\"\n            />\n          <source\n            srcset=\"/static/16f45ef5adfe5976d1ade4bca107cec6/8ff5a/image-20221217222250084.png 240w,\n/static/16f45ef5adfe5976d1ade4bca107cec6/e85cb/image-20221217222250084.png 480w,\n/static/16f45ef5adfe5976d1ade4bca107cec6/fcbaf/image-20221217222250084.png 895w\"\n            sizes=\"(max-width: 895px) 100vw, 895px\"\n            type=\"image/png\"\n          />\n          <img\n            class=\"gatsby-resp-image-image\"\n            src=\"/static/16f45ef5adfe5976d1ade4bca107cec6/fcbaf/image-20221217222250084.png\"\n            alt=\"image-20221217222250084\"\n            title=\"image-20221217222250084\"\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>Starting the program with the breakpoint set launches a console application.</p>\n<p>Standard input can be provided directly here, so we didn’t run into the same issue as on Linux.</p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 960px; \"\n    >\n      <a\n    class=\"gatsby-resp-image-link\"\n    href=\"/static/b37474bf187f3c0428a158efaa4faef0/cc7de/image-20221217222748920.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: 45.833333333333336%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAJCAYAAAAywQxIAAAACXBIWXMAAAsTAAALEwEAmpwYAAAB0ElEQVQoz5WS22oaURSGxxOigo/QUS/jQ+mFqQR6oi0U+jqhBwliaQsWrEadUUfj2aitQlppsZhJPEZFIXzdY2igF4X04uffe7P4+dZaW4rH40SjMTKZLGouR7lSoV6vU6lW0YpFca5xUm3wKa2hnDRJZEuopSaFWpdkuYfa/Ear/4PW1+/k6z2kfD7P0VGMVCrN52SKbE5B0zQKhQJFEVgqavQHQ75MoTeHti50Ad0JtMS5OFiRP7si09U5bg2RFEUh8jZKJq3w/sNHwgcHhEIhwvfDBINBAoEA+/shnj5+yLMnf/RI3B/w8sVzfg7O2CwXXM0mLOdTpFxOFYTvBGGBw8PXSJL0X6pUayyXKy4ux4wnk5vASCRGImEEvsHhcOwKzWbzrSwWC1ar9S+ZTCbcbjeNRoP1es1EhE2nglBRlZsZJlUR+Aq73X5nOqfTSUUscTabMRqN0HUdqSqQy+Uyp6cdksnjW0KD4F8yqI0al8tFQStyrl8y/HW+c2kxX7DdbJjPN3Q6A2w2650JbTYbtVqN1cpoeSpanhmBc7bbLdfX0Bf/aW/Pj3xPxuPx4ZF9yLLhMl6vB5/PJ9y7c1m8+f1+2u22WMqS8Xi8m+Nv3qa30i5fye4AAAAASUVORK5CYII='); background-size: cover; display: block;\"\n  ></span>\n  <picture>\n          <source\n              srcset=\"/static/b37474bf187f3c0428a158efaa4faef0/8ac56/image-20221217222748920.webp 240w,\n/static/b37474bf187f3c0428a158efaa4faef0/d3be9/image-20221217222748920.webp 480w,\n/static/b37474bf187f3c0428a158efaa4faef0/e46b2/image-20221217222748920.webp 960w,\n/static/b37474bf187f3c0428a158efaa4faef0/f992d/image-20221217222748920.webp 1440w,\n/static/b37474bf187f3c0428a158efaa4faef0/a120e/image-20221217222748920.webp 1605w\"\n              sizes=\"(max-width: 960px) 100vw, 960px\"\n              type=\"image/webp\"\n            />\n          <source\n            srcset=\"/static/b37474bf187f3c0428a158efaa4faef0/8ff5a/image-20221217222748920.png 240w,\n/static/b37474bf187f3c0428a158efaa4faef0/e85cb/image-20221217222748920.png 480w,\n/static/b37474bf187f3c0428a158efaa4faef0/d9199/image-20221217222748920.png 960w,\n/static/b37474bf187f3c0428a158efaa4faef0/07a9c/image-20221217222748920.png 1440w,\n/static/b37474bf187f3c0428a158efaa4faef0/cc7de/image-20221217222748920.png 1605w\"\n            sizes=\"(max-width: 960px) 100vw, 960px\"\n            type=\"image/png\"\n          />\n          <img\n            class=\"gatsby-resp-image-image\"\n            src=\"/static/b37474bf187f3c0428a158efaa4faef0/d9199/image-20221217222748920.png\"\n            alt=\"image-20221217222748920\"\n            title=\"image-20221217222748920\"\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<h3 id=\"viewing-register-information\" style=\"position:relative;\"><a href=\"#viewing-register-information\" aria-label=\"viewing register information 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>Viewing Register Information</h3>\n<p>To inspect the decrypted flag string, we want to check register values — but this time let’s use the Watches window instead of the Register window.</p>\n<p>Open the Watches window (located in the lower right by default), and add entries using the [+] button.</p>\n<p>This time, we set RCX and RSP in the [Expression] column to watch the values of each register.</p>\n<p>Running the program, we can see that when execution hits the breakpoint, RCX holds the first decrypted flag character.</p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 960px; \"\n    >\n      <a\n    class=\"gatsby-resp-image-link\"\n    href=\"/static/778a72ba9cbc46ad955cf8eb34b03342/a8c87/image-20221218012400616.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: 19.583333333333332%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAECAYAAACOXx+WAAAACXBIWXMAAAsTAAALEwEAmpwYAAAA+UlEQVQY0y2MTVOCYBSF+f+/pBZtaoEtGxchIpqkUvJNIh8Wgvo6ovD0at2Z555z75w5ysgwWCUJiSR0HaIoRogju70gL/aUVUe9b6i2gu9tTV2fKH8EYRjgeT6BH1CWJVVVcT5fUMRhR9deJC3XOciyVnohDqyTa7CT/sRWFh6PZ7oOWrnSLGdTFGRpSp5nbDYFTdOg9PUxL5pJ/3WIphsMjDHW3MY0J+jDMeZkxsSaYb3bzG0X+9PD8QIWHy5uEBFEX4TxCsePWCxdlDst5l5f8aB5qCOfp1HEoxGiDuRtxqhviWSNOl3ftPev139vmt54trI/b6X8AtB0IkGKzB5YAAAAAElFTkSuQmCC'); background-size: cover; display: block;\"\n  ></span>\n  <picture>\n          <source\n              srcset=\"/static/778a72ba9cbc46ad955cf8eb34b03342/8ac56/image-20221218012400616.webp 240w,\n/static/778a72ba9cbc46ad955cf8eb34b03342/d3be9/image-20221218012400616.webp 480w,\n/static/778a72ba9cbc46ad955cf8eb34b03342/e46b2/image-20221218012400616.webp 960w,\n/static/778a72ba9cbc46ad955cf8eb34b03342/f992d/image-20221218012400616.webp 1440w,\n/static/778a72ba9cbc46ad955cf8eb34b03342/5e0a5/image-20221218012400616.webp 1538w\"\n              sizes=\"(max-width: 960px) 100vw, 960px\"\n              type=\"image/webp\"\n            />\n          <source\n            srcset=\"/static/778a72ba9cbc46ad955cf8eb34b03342/8ff5a/image-20221218012400616.png 240w,\n/static/778a72ba9cbc46ad955cf8eb34b03342/e85cb/image-20221218012400616.png 480w,\n/static/778a72ba9cbc46ad955cf8eb34b03342/d9199/image-20221218012400616.png 960w,\n/static/778a72ba9cbc46ad955cf8eb34b03342/07a9c/image-20221218012400616.png 1440w,\n/static/778a72ba9cbc46ad955cf8eb34b03342/a8c87/image-20221218012400616.png 1538w\"\n            sizes=\"(max-width: 960px) 100vw, 960px\"\n            type=\"image/png\"\n          />\n          <img\n            class=\"gatsby-resp-image-image\"\n            src=\"/static/778a72ba9cbc46ad955cf8eb34b03342/d9199/image-20221218012400616.png\"\n            alt=\"image-20221218012400616\"\n            title=\"image-20221218012400616\"\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>The user-input string is stored on the local stack.</p>\n<p>However, it appears that the current Ghidra debugger cannot reference values in memory.</p>\n<p>The help documentation suggests a notation like <code class=\"language-text\">*:4 (RSP+8)</code> for reading memory, but in my environment it raised an exception and the value could not be retrieved.</p>\n<p>Looking at the following issue, it seems that memory referencing from Ghidra currently doesn’t work correctly in some cases, and there is no workaround other than using debugger commands from the Interpreter.</p>\n<p>Reference: <a href=\"https://github.com/NationalSecurityAgency/ghidra/issues/2866\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">[Debugger]: Stack Frame Memory Viewer / Editor · Issue #2866 · NationalSecurityAgency/ghidra</a></p>\n<p>For this reason, the screenshot above also shows the WinDbg <code class=\"language-text\">da</code> command being used from the Interpreter to inspect the input string on the local stack.</p>\n<h3 id=\"obtaining-the-flag-1\" style=\"position:relative;\"><a href=\"#obtaining-the-flag-1\" aria-label=\"obtaining the flag 1 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>Obtaining the Flag</h3>\n<p>Finally, let’s retrieve the flag.</p>\n<p>On Linux, we retrieved the flag one character at a time by modifying register values from the Register window, but the Watches window also allows editing register values in edit mode.</p>\n<p>This time, by changing the value of RCX to 0x41 (the same as the input), we passed the password check and were able to retrieve the second and subsequent flag characters.</p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 724px; \"\n    >\n      <a\n    class=\"gatsby-resp-image-link\"\n    href=\"/static/74ec389870f47b777adc984436c5acfb/a242d/image-20221218012444054.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: 18.333333333333336%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAECAYAAACOXx+WAAAACXBIWXMAAAsTAAALEwEAmpwYAAAA+UlEQVQY00XKzU7CUBCG4d6wN6ByASYYtSqN0QjCBhsXilFBWltKz+HYYo0s2OpCF0Ytgr9E8fWkkbh4Mt/MfEbLqdN26wivyVUsiUKfrgy4jBWxClFtnySSmuLiXNBLYvq9RGdJ6LsZoXUCD6kZM0s2s0WX+bLHXOmMXMUnV3LJ79TY3GtQPhJUjkO2D3zWqydYdoNiraVvgq19j2ozYteJKR0G2G4XY0WkmGqE2Rlq0zlktXXLsnNN3r1jUbM6KWviEbN9j6UGbMgHCqc3WbZUyoLOBfmEwXhE5nNqmO2T92e+XgdM3gZ8a9lv/PLf+9A93ZnuP3/5F5Y9DSAD7Ar4AAAAAElFTkSuQmCC'); background-size: cover; display: block;\"\n  ></span>\n  <picture>\n          <source\n              srcset=\"/static/74ec389870f47b777adc984436c5acfb/8ac56/image-20221218012444054.webp 240w,\n/static/74ec389870f47b777adc984436c5acfb/d3be9/image-20221218012444054.webp 480w,\n/static/74ec389870f47b777adc984436c5acfb/79561/image-20221218012444054.webp 724w\"\n              sizes=\"(max-width: 724px) 100vw, 724px\"\n              type=\"image/webp\"\n            />\n          <source\n            srcset=\"/static/74ec389870f47b777adc984436c5acfb/8ff5a/image-20221218012444054.png 240w,\n/static/74ec389870f47b777adc984436c5acfb/e85cb/image-20221218012444054.png 480w,\n/static/74ec389870f47b777adc984436c5acfb/a242d/image-20221218012444054.png 724w\"\n            sizes=\"(max-width: 724px) 100vw, 724px\"\n            type=\"image/png\"\n          />\n          <img\n            class=\"gatsby-resp-image-image\"\n            src=\"/static/74ec389870f47b777adc984436c5acfb/a242d/image-20221218012444054.png\"\n            alt=\"image-20221218012444054\"\n            title=\"image-20221218012444054\"\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<h2 id=\"summary\" style=\"position:relative;\"><a href=\"#summary\" aria-label=\"summary 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</h2>\n<p>This time we used Ghidra’s debugger feature to solve a simple reversing challenge.</p>\n<p>My initial impressions after a quick hands-on session were roughly 40% “this looks promising” and 60% “this is hard to use.”</p>\n<p>The main pain points were the critically sparse knowledge base and the very unstable behavior.</p>\n<p>On the knowledge side, Ghidra’s own help documentation is minimal, and Googling in English barely turns up any blog posts at all.</p>\n<p>On the other hand, the GitHub issues have quite a variety of questions and answers, and those issues served as almost the only useful source of information.</p>\n<p>As for stability, it may partly be my own environment, but the debugger crashed or hung with exceptions at seemingly random moments quite frequently.</p>\n<p>There are clearly still many unimplemented features in the Ghidra debugger, but since GDB and WinDbg commands can both be run from the Interpreter window, the limitation on actual debugging capability doesn’t feel that severe. That said, having the debugger become unstable so often without doing anything particularly complex was quite frustrating.</p>\n<p>Nevertheless, being a free tool that can handle both PE and ELF files in the same UI is genuinely convenient, and being able to set breakpoints directly from decompiled output is also useful. (I’ve barely used IDA, so…)</p>\n<p>Also, although not covered in this article, the Ghidra debugger’s Time feature — which captures execution-trace snapshots and allows you to step back and analyze the state at those points — looked very promising.</p>\n<p>Being limited to snapshot-based tracing is a drawback, but having a feature similar to WinDbg Preview’s Time Travel Debugging (TTD) available for ELF analysis as well is something to be genuinely excited about.</p>","fields":{"slug":"/himitsukichi-ctf-rev-ghidra-dynamic-en","tagSlugs":["/tag/ctf-en/","/tag/rev-en/","/tag/ghidra-en/","/tag/english/"]},"frontmatter":{"date":"2022-12-19","description":"Using the Ghidra debugger feature added in version 10.0 to solve simple Reversing challenges on Windows and Linux.","tags":["CTF (en)","Rev (en)","Ghidra (en)","English"],"title":"Use the Ghidra Debugger in 2023! - A Practical Guide","socialImage":{"publicURL":"/static/83a9435807117e1e99c60e9c8ad1fb67/himitsukichi-ctf-rev-ghidra-dynamic.png"}}}},"pageContext":{"slug":"/himitsukichi-ctf-rev-ghidra-dynamic-en"}},"staticQueryHashes":["251939775","401334301","825871152"]}