Radare2 反汇编器如何组织可视化面板 (V!)?

Aar*_*ron 6 reverse-engineering x86-64 disassembly radare2

我想使用 Radare2 来了解 C 是如何组装成程序集的,但我在布局方面遇到了问题。我觉得是V!模式将非常方便,因为您可以在指令指针在程序中移动时观察寄存器更新,但我不了解布局。

这是我想要的布局示例: 在此处输入图片说明

似乎当我添加一个窗口(如这张照片中的 Stack 或 Registers)时,它出现在屏幕外,我必须尝试关闭不同的窗口和拆分窗口,直到布局合适为止。是否有一种简单的方法可以准确更改每个窗口中的内容?

我知道“X”关闭一个窗口,“z”将当前窗口切换到最前面,“-”/“|” 分割一个窗口。

我曾尝试查看帮助,但似乎无法找出与此问题相关的任何其他命令。

Kum*_*uma 3

环境

  • radare2: 4.2.0-git 23712 @ linux-x86-64 git.4.1.1-97-g5a48a4017 提交:5a48a401787c0eab31ecfb48bebf7cdfccb66e9b 版本:2020-01-09__21:44:51
  • 系统: Ubuntu 18.04.3 LTS

解决方案

  • 这个问题可以通过多种方式解决,这只是一个例子。
  • 要创建您所描述的布局,请通过以下方式更改默认布局中显示的命令:

    1. 单击内部/选择您想要更改的面板。
    2. 右键单击面板并选择新命令或
    3. 输入“e”,然后键入新命令。(例如:寄存器 = dr)
  • 下面显示的更多文档可以在这里找到:https://radare.gitbooks.io/radare2book/visual_mode/visual_panels.html

|Visual Ascii Art Panels:
| |      split the current panel vertically
| -      split the current panel horizontally
| :      run r2 command in prompt
| _      start the hud input mode
| ?      show this help
| ??     show the user-friendly hud
| !      run r2048 game
| .      seek to PC or entrypoint
| *      show pseudo code/r2dec in the current panel
| /      highlight the keyword
| (      toggle snow
| &      toggle cache
| [1-9]  follow jmp/call identified by shortcut (like ;[1])
| ' '    (space) toggle graph / panels
| tab    go to the next panel
| a      toggle auto update for decompiler
| b      browse symbols, flags, configurations, classes, ...
| c      toggle cursor
| C      toggle color
| d      define in the current address. Same as Vd
| D      show disassembly in the current panel
| e      change title and command of current panel
| g      go/seek to given offset
| G      show graph in the current panel
| i      insert hex
| hjkl   move around (left-down-up-right)
| J      scroll panels down by page
| K      scroll panels up by page
| H      scroll panels left by page
| L      scroll panels right by page
| m      select the menu panel
| M      open new custom frame
| nN     create new panel with given command
| pP     seek to next or previous scr.nkey
| q      quit, back to visual mode
| r      toggle jmphints/leahints
| sS     step in / step over
| t      rotate related commands in a panel
| uU     undo / redo seek
| w      start Window mode
| V      go to the graph mode
| X      close current panel
| z      swap current panel with the first one
Run Code Online (Sandbox Code Playgroud)

例子

打开可视面板

|Visual Ascii Art Panels:
| |      split the current panel vertically
| -      split the current panel horizontally
| :      run r2 command in prompt
| _      start the hud input mode
| ?      show this help
| ??     show the user-friendly hud
| !      run r2048 game
| .      seek to PC or entrypoint
| *      show pseudo code/r2dec in the current panel
| /      highlight the keyword
| (      toggle snow
| &      toggle cache
| [1-9]  follow jmp/call identified by shortcut (like ;[1])
| ' '    (space) toggle graph / panels
| tab    go to the next panel
| a      toggle auto update for decompiler
| b      browse symbols, flags, configurations, classes, ...
| c      toggle cursor
| C      toggle color
| d      define in the current address. Same as Vd
| D      show disassembly in the current panel
| e      change title and command of current panel
| g      go/seek to given offset
| G      show graph in the current panel
| i      insert hex
| hjkl   move around (left-down-up-right)
| J      scroll panels down by page
| K      scroll panels up by page
| H      scroll panels left by page
| L      scroll panels right by page
| m      select the menu panel
| M      open new custom frame
| nN     create new panel with given command
| pP     seek to next or previous scr.nkey
| q      quit, back to visual mode
| r      toggle jmphints/leahints
| sS     step in / step over
| t      rotate related commands in a panel
| uU     undo / redo seek
| w      start Window mode
| V      go to the graph mode
| X      close current panel
| z      swap current panel with the first one
Run Code Online (Sandbox Code Playgroud)

打开可视面板后的默认视图 默认面板视图

选择右上角面板,然后右键单击并选择寄存器 选择寄存器命令

选择右下面板然后右键单击并选择堆栈 选择堆栈命令

最终视图 在此输入图像描述

  • 另请考虑查看 https://reverseengineering.stackexchange.com/ 了解逆向工程问题! (2认同)