Radare2 Disassembler How Do You Organize Visual Panels (V!)?
Asked Answered
F

1

7

I would like to use Radare2 to learn about how C is assembled into assembly but I am having trouble with the layout. I think the V! mode would be very handy as you can watch the registers update as the instruction pointer moves through the program, but I don't understand the layout.

This is an example of they layout I would like: enter image description here

It seems when I add a window (like Stack or Registers in this photo) it appears offscreen and I have to try closing different and splitting windows until the layout kind of falls into place. Is there an easy way to change exactly what is in each window?

I know "X" closes a window, "z" switches the current window to the front, and "-" / "|" split a window.

I have tried looking at the help but can't seem to figure out any other commands related to this issue.

Fraternity answered 15/1, 2019 at 15:24 Comment(0)
F
4

ENVIRONMENT

  • radare2: 4.2.0-git 23712 @ linux-x86-64 git.4.1.1-97-g5a48a4017 commit: 5a48a401787c0eab31ecfb48bebf7cdfccb66e9b build: 2020-01-09__21:44:51
  • system: Ubuntu 18.04.3 LTS

SOLUTION

  • This problem can be solved in a variety of ways and this is just one example.
  • To create the layout you have described change the commands shown in the default layout by:

    1. Clicking inside/selecting the panel you wish to change.
    2. Right clicking in the panel and select new command or
    3. Enter "e" then type the new command. (Ex: Registers = dr)
  • The further documentation shown below can be found here: 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

EXAMPLE

Open visual panels

user@host:~$ r2 /bin/ls
[0x00005850]> aaaa
...
[0x00005850]> s main
[0x00003e90]> V!

Default view after opening visual panels default panel view

Select top right panel then right click and select registers selecting registers command

Select lower right panel then right click and select stack selecting stack command

Final view enter image description here

Frankfurter answered 15/1, 2020 at 0:16 Comment(1)
Also consider checking out reverseengineering.stackexchange.com for reverse engineering questions!Frankfurter

© 2022 - 2024 — McMap. All rights reserved.