{"componentChunkName":"component---src-templates-post-template-js","path":"/note-gdb-wt-wsl-en","result":{"data":{"markdownRemark":{"id":"94601e59-6726-542b-8b53-5ea07bc9b716","html":"<blockquote>\n<p>This page has been machine-translated from the <a href=\"/note-gdb-wt-wsl\">original page</a>.</p>\n</blockquote>\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=\"#how-to-change-the-pane-split-width\">How to change the pane split width</a></li>\n<li>\n<p><a href=\"#bonus-an-issue-when-using-pwntools-and-gdb-peda-with-wsl2-and-windows-terminal\">Bonus: an issue when using pwntools and gdb-peda with WSL2 and Windows Terminal</a></p>\n<ul>\n<li><a href=\"#workaround-1-use-tmux\">Workaround 1: use tmux</a></li>\n<li><a href=\"#workaround-2-use-gef-or-pwndbg\">Workaround 2: use gef or pwndbg</a></li>\n</ul>\n</li>\n<li><a href=\"#summary\">Summary</a></li>\n</ul>\n<p>This is a memo on how to change the pane split ratio through context settings when using pwntools’ debugging features with WSL2 and Windows Terminal.</p>\n<p>As a bonus, I also summarize a workaround for the issue where register information becomes unavailable when using pwntools together with gdb-peda in a WSL2 &#x26; Windows Terminal environment.</p>\n<h2 id=\"how-to-change-the-pane-split-width\" style=\"position:relative;\"><a href=\"#how-to-change-the-pane-split-width\" aria-label=\"how to change the pane split width 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>How to change the pane split width</h2>\n<p>When using pwntools’ <code class=\"language-text\">gdb.debug()</code> on WSL2 &#x26; Windows Terminal, it seems the debug terminal is launched with the following command by default.</p>\n<div class=\"gatsby-highlight\" data-language=\"bash\"><pre class=\"language-bash\"><code class=\"language-bash\"><span class=\"token punctuation\">[</span><span class=\"token string\">'/mnt/c/Windows/system32/cmd.exe'</span>, <span class=\"token string\">'/c'</span>, <span class=\"token string\">'start'</span>, <span class=\"token string\">'wt.exe'</span>, <span class=\"token string\">'-w'</span>, <span class=\"token string\">'0'</span>, <span class=\"token string\">'split-pane'</span>, <span class=\"token string\">'-d'</span>, <span class=\"token string\">'.'</span>, <span class=\"token string\">'wsl.exe'</span>, <span class=\"token string\">'-d'</span>, <span class=\"token string\">'Ubuntu'</span>, <span class=\"token string\">'bash'</span>, <span class=\"token string\">'-c'</span>, <span class=\"token string\">'/tmp/tmpnhyc4xx1'</span><span class=\"token punctuation\">]</span></code></pre></div>\n<p>In this context, <code class=\"language-text\">wt.exe -w 0 split-pane -d .</code> launches a pane-split terminal inside the currently open window using the default profile.</p>\n<p>Reference: <a href=\"https://learn.microsoft.com/ja-jp/windows/terminal/command-line-arguments?tabs=windows\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">Windows Terminal command-line arguments | Microsoft Learn</a></p>\n<p>However, as-is, the window split ratio is forced to 5:5 and cannot be changed afterward, which is a little inconvenient for debugging.</p>\n<p>Therefore, by adding the split ratio to the context with the <code class=\"language-text\">-s</code> option of Windows Terminal’s <code class=\"language-text\">split-pane</code> feature, you can make the debug window larger.</p>\n<p>The context I actually use is shown below.</p>\n<div class=\"gatsby-highlight\" data-language=\"bash\"><pre class=\"language-bash\"><code class=\"language-bash\">context.terminal <span class=\"token operator\">=</span> <span class=\"token punctuation\">[</span><span class=\"token string\">\"/mnt/c/Windows/system32/cmd.exe\"</span>, <span class=\"token string\">\"/c\"</span>, <span class=\"token string\">\"start\"</span>, <span class=\"token string\">\"wt.exe\"</span>, <span class=\"token string\">\"-w\"</span>, <span class=\"token string\">\"0\"</span>, <span class=\"token string\">\"sp\"</span>, <span class=\"token string\">\"-s\"</span>, <span class=\"token string\">\".7\"</span>, <span class=\"token string\">\"-d\"</span>, <span class=\"token string\">\".\"</span>, <span class=\"token string\">\"wsl.exe\"</span>, <span class=\"token string\">'-d'</span>, <span class=\"token string\">\"Ubuntu\"</span>, <span class=\"token string\">\"bash\"</span>, <span class=\"token string\">\"-c\"</span><span class=\"token punctuation\">]</span></code></pre></div>\n<p>By defining this setting inside the Python script that uses pwntools, you can make the split ratio 3:7 when splitting the screen as shown below, giving the debug window more space.</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/dbedb75ef3634c6b0f3d0db6309faa31/c587f/image-20240725233901766.png\"\n    style=\"display: block\"\n    target=\"_blank\"\n    rel=\"noopener\"\n  >\n    <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 60%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAMCAYAAABiDJ37AAAACXBIWXMAAAsTAAALEwEAmpwYAAACXElEQVQoz01Ta4+bMBDk1AsQG2MbsHkZAwlJ7nqnk679/79tOpBK7YfVmodmZ3bGSR9bVM6gGwOW64Z5vSLEGbf7DdfrG+ZlwzJHzHwXpwl93/+t7r/zs8ZxRFJ7B98ohEYgO52QvLzgNU2xXWZMw4zQEXAIGLsIVztobWBMBVvVsJbd2qOMsSgKhWQg6hoDYlOjZWmjIQuJ+XLF2A+YfY/YTxhihLYeStcojed/e/GsKw6pjr4PSULTHPImyqoJqFSBs8gxLQ+0bj3YTd2ItnUQUnBYcXQhniWlJDOJLEuxLAuShoD7Psqy5KQSKWXvkh+3FdvosC4tpuC5vxm993Baoyao5WBtCUZAxecsy7CuKyU7T+SZCx3guM+CH9M8x3WJeBs8LnHFQMm+HmEoWRYGpaqoxEKVmv9rng2yXGLlmpKBUweChSkcfRh62LrCsIyYtwWutSitgBJkVFRwinvj8s9kJvYiAakU0jQnsQt36Bwmgu2A2hqcKDfNM0Sy3i4bvLeo2gZNH1BVDh3dDLaDVy1cyefCopcWtVH4+XEnYNsihABHh5zYmQik+4IvF2zbA7bRcF3DaHjkQhJEY6x71MqjUhxEyZ5r0Eri9rg+XZ4Y2DI7o0wSyNdXCDL8+PrG+83hthrcI7O4RyfEIzaCIIKyhWQVJYTSJCGw8FIkkaFc44SO5tidIQEVGX79+o3vT4+vu8FnmPHgbqdIlxmjnuCVrY9kFLKgKeqfy4aAe57y8xk/9ptClid2V3c0JKIbFijLDJYVHeZtKD2LaShrVkNDnj07a7p8xx/XFCiKn2cj6wAAAABJRU5ErkJggg=='); background-size: cover; display: block;\"\n  ></span>\n  <picture>\n          <source\n              srcset=\"/static/dbedb75ef3634c6b0f3d0db6309faa31/8ac56/image-20240725233901766.webp 240w,\n/static/dbedb75ef3634c6b0f3d0db6309faa31/d3be9/image-20240725233901766.webp 480w,\n/static/dbedb75ef3634c6b0f3d0db6309faa31/e46b2/image-20240725233901766.webp 960w,\n/static/dbedb75ef3634c6b0f3d0db6309faa31/f992d/image-20240725233901766.webp 1440w,\n/static/dbedb75ef3634c6b0f3d0db6309faa31/2fa9d/image-20240725233901766.webp 1863w\"\n              sizes=\"(max-width: 960px) 100vw, 960px\"\n              type=\"image/webp\"\n            />\n          <source\n            srcset=\"/static/dbedb75ef3634c6b0f3d0db6309faa31/8ff5a/image-20240725233901766.png 240w,\n/static/dbedb75ef3634c6b0f3d0db6309faa31/e85cb/image-20240725233901766.png 480w,\n/static/dbedb75ef3634c6b0f3d0db6309faa31/d9199/image-20240725233901766.png 960w,\n/static/dbedb75ef3634c6b0f3d0db6309faa31/07a9c/image-20240725233901766.png 1440w,\n/static/dbedb75ef3634c6b0f3d0db6309faa31/c587f/image-20240725233901766.png 1863w\"\n            sizes=\"(max-width: 960px) 100vw, 960px\"\n            type=\"image/png\"\n          />\n          <img\n            class=\"gatsby-resp-image-image\"\n            src=\"/static/dbedb75ef3634c6b0f3d0db6309faa31/d9199/image-20240725233901766.png\"\n            alt=\"image-20240725233901766\"\n            title=\"image-20240725233901766\"\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=\"bonus-an-issue-when-using-pwntools-and-gdb-peda-with-wsl2--windows-terminal\" style=\"position:relative;\"><a href=\"#bonus-an-issue-when-using-pwntools-and-gdb-peda-with-wsl2--windows-terminal\" aria-label=\"bonus an issue when using pwntools and gdb peda with wsl2  windows terminal 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>Bonus: an issue when using pwntools and gdb-peda with WSL2 &#x26; Windows Terminal</h2>\n<p>Although I have no idea what the cause is, in a Windows Terminal and WSL2 environment, using pwntools’ <code class=\"language-text\">gdb.debug()</code> causes gdb-peda’s register view to stop working.</p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 730px; \"\n    >\n      <a\n    class=\"gatsby-resp-image-link\"\n    href=\"/static/5042b463804bdbc6ed207de3bd2174b0/e9beb/image-20240725205328140.png\"\n    style=\"display: block\"\n    target=\"_blank\"\n    rel=\"noopener\"\n  >\n    <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 66.66666666666666%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAANCAYAAACpUE5eAAAACXBIWXMAAAsTAAALEwEAmpwYAAACSElEQVQ4y3VTa3ObMBDkQxrbkpAAPQABAb8dx2/HjT2x+///1fbseBLaph92brTDHXe3ewH3FjyzqKopTPGErovR1yW89ugWCTJbwadTsLKk7wwaV2JuaxiXEWchKJd7A1nlCGOHQGmL8WyOwXCKp2aIZjRG6nIkiYMyBmmaw6YNWJSAKQUlY6gwhpARuCLIDwhFHPGBMRrn93dsNxssFi/Y73bIModYhdBSoXYOlgrFjMEwjpAzMALnHKIFfueCNM1wPB6xXK7w/PyM9XoDR2NkfQcZSvBOB4KKKSEQcQFBkYuvyFvvKwKtE5zPZ2yow/V6hcNhj6KsoV2NKJLwPofWMRjrUeJHJ+K/oA5lZLBabTGZzjCZzDCjfY7GMxpLITEp5osNqv4c2nri5G1PXET/4s4Hm+0etnjBD7VAV+/RSXaUXGD+soIvajw8MnSYQZf9mcjDFj55heByOaEavOIxOYClv9BzF4wnU5yObyTSAksSarmY00rWGI9HkDK8j/3d+DTy29sBRbPFY7ynYmcwd8KUxj6RUFf1L5cL9vtX8mmFMAw/1G2J8Lc4wfH4E77Z4YE6vHbXs0dUZYNdM8CMPDoZjlA3DYnj8VTXtwLWOhhrkROnyauM3X9y7bCqx2STAZnVQ0RDMnAN6RKY3CNOMvREQtC0oy8IaVpv04rJtWCNsixQkkVk5METuorcIbQ58ryBTiLEEafdqU8zt2Pb4LeRp9TJsqpR0EWIKKXz6tNJDShSYenhbIQ8DcmT8bf7a+/wWvQ3itJGVlINJrwAAAAASUVORK5CYII='); background-size: cover; display: block;\"\n  ></span>\n  <picture>\n          <source\n              srcset=\"/static/5042b463804bdbc6ed207de3bd2174b0/8ac56/image-20240725205328140.webp 240w,\n/static/5042b463804bdbc6ed207de3bd2174b0/d3be9/image-20240725205328140.webp 480w,\n/static/5042b463804bdbc6ed207de3bd2174b0/87ca7/image-20240725205328140.webp 730w\"\n              sizes=\"(max-width: 730px) 100vw, 730px\"\n              type=\"image/webp\"\n            />\n          <source\n            srcset=\"/static/5042b463804bdbc6ed207de3bd2174b0/8ff5a/image-20240725205328140.png 240w,\n/static/5042b463804bdbc6ed207de3bd2174b0/e85cb/image-20240725205328140.png 480w,\n/static/5042b463804bdbc6ed207de3bd2174b0/e9beb/image-20240725205328140.png 730w\"\n            sizes=\"(max-width: 730px) 100vw, 730px\"\n            type=\"image/png\"\n          />\n          <img\n            class=\"gatsby-resp-image-image\"\n            src=\"/static/5042b463804bdbc6ed207de3bd2174b0/e9beb/image-20240725205328140.png\"\n            alt=\"image-20240725205328140\"\n            title=\"image-20240725205328140\"\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>Because the register view is displayed normally when I simply run the <code class=\"language-text\">gdb</code> command in the same environment, I feel that the cause is the use of pwntools’ gdb module (or perhaps <code class=\"language-text\">gdbserver</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: 960px; \"\n    >\n      <a\n    class=\"gatsby-resp-image-link\"\n    href=\"/static/2587310660db1eb23f8f4743356dedd9/8d68c/image-20240725205359559.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: 68.33333333333333%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAOCAYAAAAvxDzwAAAACXBIWXMAAAsTAAALEwEAmpwYAAAB0klEQVQ4y51T2W7bMBA0Jd6HSJHUYbmW28I2HBT5/8+brly3aNAmSPIwWAqSZpczszuXA5Tr0SqqxsH5AOs7CBPAWgHWtAT+AJ1bjt2OEXb/R9p3GI435DogRiIS4vWP3wNfHWL5Cl9PGOc9xml4TMA+R9gXh+IyUt9jmiY4Z2G0/vyEeY6Y5pX08xBKQ1LdtQpcSFhrYZ0j2PvZhwDvPTV1VDe9HaSULwm7wjGkgDpOWMiQw3JEnhbUWqjRAKcVSorwnaMmDaQS4Jz/QdM0LwnjELBfV9T9gIG6W6OQS0ItGbJTSDRpVArCcUpCA27IZfaGvut6wtPTDefLBXWq0JpDUTwEayD++eEdZh2PX/D8/AO32xWHw0JXkgibMVQZfcA+asq8HFDm4x15mJBKRaJM2pDoaps+v8F+PdP0bxJ+O18g4wGqfEfXV6xDQeYCmjZCW0PuGhhy2JG+ilLQkhHGGLTtK8Tn6xU6r7DjBX0ecUoJM2UyEIGgSORSoCiXWzykFLRJpDHJsW3U325vuDep8wKrA3QYoSNtTS7waQRXluAgbITQnjLY3RG6+MihR6Bcblnczlsu9bYQp9wjG7qKoolcolh09EKSKQyMfXz9fgJfyDAbTrL39gAAAABJRU5ErkJggg=='); background-size: cover; display: block;\"\n  ></span>\n  <picture>\n          <source\n              srcset=\"/static/2587310660db1eb23f8f4743356dedd9/8ac56/image-20240725205359559.webp 240w,\n/static/2587310660db1eb23f8f4743356dedd9/d3be9/image-20240725205359559.webp 480w,\n/static/2587310660db1eb23f8f4743356dedd9/e46b2/image-20240725205359559.webp 960w,\n/static/2587310660db1eb23f8f4743356dedd9/5dcdf/image-20240725205359559.webp 1234w\"\n              sizes=\"(max-width: 960px) 100vw, 960px\"\n              type=\"image/webp\"\n            />\n          <source\n            srcset=\"/static/2587310660db1eb23f8f4743356dedd9/8ff5a/image-20240725205359559.png 240w,\n/static/2587310660db1eb23f8f4743356dedd9/e85cb/image-20240725205359559.png 480w,\n/static/2587310660db1eb23f8f4743356dedd9/d9199/image-20240725205359559.png 960w,\n/static/2587310660db1eb23f8f4743356dedd9/8d68c/image-20240725205359559.png 1234w\"\n            sizes=\"(max-width: 960px) 100vw, 960px\"\n            type=\"image/png\"\n          />\n          <img\n            class=\"gatsby-resp-image-image\"\n            src=\"/static/2587310660db1eb23f8f4743356dedd9/d9199/image-20240725205359559.png\"\n            alt=\"image-20240725205359559\"\n            title=\"image-20240725205359559\"\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=\"workaround-1-use-tmux\" style=\"position:relative;\"><a href=\"#workaround-1-use-tmux\" aria-label=\"workaround 1 use tmux 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>Workaround 1: use tmux</h3>\n<p>I have not been able to identify the cause, but I confirmed that using <code class=\"language-text\">tmux</code> avoids the problem for now.</p>\n<p>First, start <code class=\"language-text\">tmux</code> in the terminal where you run the pwntools script.</p>\n<p>Then run a pwntools script with <code class=\"language-text\">context.terminal</code> replaced as follows.</p>\n<div class=\"gatsby-highlight\" data-language=\"python\"><pre class=\"language-python\"><code class=\"language-python\">context<span class=\"token punctuation\">.</span>terminal <span class=\"token operator\">=</span>  <span class=\"token punctuation\">[</span><span class=\"token string\">\"tmux\"</span><span class=\"token punctuation\">,</span> <span class=\"token string\">\"splitw\"</span><span class=\"token punctuation\">,</span> <span class=\"token string\">\"-h\"</span><span class=\"token punctuation\">]</span></code></pre></div>\n<p>With this, you can view gdb-peda’s register information even in a WSL2 &#x26; Windows Terminal environment.</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/420c9a4b6d1f26f4bc4627113f67a538/46435/image-20240725205624716.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,iVBORw0KGgoAAAANSUhEUgAAABQAAAAMCAYAAABiDJ37AAAACXBIWXMAAAsTAAALEwEAmpwYAAAB60lEQVQoz51S246bMBTEYAzmYjCYS2AJWbKbqspD1Ye2//9l07EbVanUVaU+TGL5HMZzZk60zhPWZcL764zr9cC6rgET77uuC3CDw7KtGOeF9zNOC3u2HeM4oe8dejcEDM4hsvwZW429TZHLBFEsEMcxhBCIoigglhGaqUMzbLB8oDYGKst+1//AwZevbweO1x3b9oKmbaAUyfM8QEqeSwXrLFp7wnreMFN99hHh3HfY2ORHbG0LrXVQ+NyUKAE3GXSthSlLlHWDsiph6gploSHT5IlwHLDvZxhTo67roMoTSimDiqIooIscdmwx0L/eNPS1R9dTcVWgYk1qSVseIo6XFZfLTm8s6sbAEJ4kVSqo9Y8oleFgYPf750CkkgTJ38b1eFsXvH+64eRH5jheaUNSTXU5CXUgl5jZN64XOCZraVPVtBAxR/XhhQAfIV7p33G7odcFRl44+mKSGC1hOF5VVii0wnK+IOsPTMOM27ZxbV6CPSVF+Em8RWEzziyclhMsV8HoHFWaQpNYESHlRCKl6Qv7Wsct6Ac01lE1vU5zqFyjqjkRBaWpRJTIR0IxIR4+iKezT1kKdJWGShUSqlF5xo/jsLPC723y61/Eof8Dc/8X4z3G+u0f+PGAP39/4Kk+fxGYvwoMd4GfyggSV+CxVG8AAAAASUVORK5CYII='); background-size: cover; display: block;\"\n  ></span>\n  <picture>\n          <source\n              srcset=\"/static/420c9a4b6d1f26f4bc4627113f67a538/8ac56/image-20240725205624716.webp 240w,\n/static/420c9a4b6d1f26f4bc4627113f67a538/d3be9/image-20240725205624716.webp 480w,\n/static/420c9a4b6d1f26f4bc4627113f67a538/e46b2/image-20240725205624716.webp 960w,\n/static/420c9a4b6d1f26f4bc4627113f67a538/f992d/image-20240725205624716.webp 1440w,\n/static/420c9a4b6d1f26f4bc4627113f67a538/58129/image-20240725205624716.webp 1885w\"\n              sizes=\"(max-width: 960px) 100vw, 960px\"\n              type=\"image/webp\"\n            />\n          <source\n            srcset=\"/static/420c9a4b6d1f26f4bc4627113f67a538/8ff5a/image-20240725205624716.png 240w,\n/static/420c9a4b6d1f26f4bc4627113f67a538/e85cb/image-20240725205624716.png 480w,\n/static/420c9a4b6d1f26f4bc4627113f67a538/d9199/image-20240725205624716.png 960w,\n/static/420c9a4b6d1f26f4bc4627113f67a538/07a9c/image-20240725205624716.png 1440w,\n/static/420c9a4b6d1f26f4bc4627113f67a538/46435/image-20240725205624716.png 1885w\"\n            sizes=\"(max-width: 960px) 100vw, 960px\"\n            type=\"image/png\"\n          />\n          <img\n            class=\"gatsby-resp-image-image\"\n            src=\"/static/420c9a4b6d1f26f4bc4627113f67a538/d9199/image-20240725205624716.png\"\n            alt=\"image-20240725205624716\"\n            title=\"image-20240725205624716\"\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=\"workaround-2-use-gef-or-pwndbg\" style=\"position:relative;\"><a href=\"#workaround-2-use-gef-or-pwndbg\" aria-label=\"workaround 2 use gef or pwndbg 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>Workaround 2: use gef or pwndbg</h3>\n<p>As another solution, you can stop using gdb-peda in the first place.</p>\n<p>After checking, I confirmed that when using <code class=\"language-text\">gef</code> or <code class=\"language-text\">pwndbg</code>, information including register details is displayed normally even when using pwntools’ <code class=\"language-text\">gdb.debug()</code> in a WSL2 &#x26; Windows Terminal environment.</p>\n<p>So although I had long preferred gdb-peda, unfortunately this became the trigger for me to switch to <code class=\"language-text\">pwndbg</code>.</p>\n<p>Reference: <a href=\"https://github.com/pwndbg/pwndbg\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">pwndbg/pwndbg: Exploit Development and Reverse Engineering with GDB Made Easy</a></p>\n<p>Reference: <a href=\"https://github.com/hugsy/gef\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">hugsy/gef: GEF (GDB Enhanced Features) - a modern experience for GDB with advanced debugging capabilities for exploit devs &#x26; reverse engineers on Linux</a></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>Just a memo.</p>","fields":{"slug":"/note-gdb-wt-wsl-en","tagSlugs":["/tag/notes/","/tag/memo/","/tag/ctf/","/tag/english/"]},"frontmatter":{"date":"2024-07-24","description":"This article summarizes how to change the pane split ratio via context settings when using pwntools debugging with WSL2 and Windows Terminal","tags":["Notes","Memo","CTF","English"],"title":"Change the Pane Split Ratio via Context Settings When Using pwntools Debugging with WSL2 and Windows Terminal","socialImage":{"publicURL":"/static/7e9f3b6ff4cf08a2700f074829d32f71/note-gdb-wt-wsl.png"}}}},"pageContext":{"slug":"/note-gdb-wt-wsl-en"}},"staticQueryHashes":["251939775","401334301","825871152"]}