When radare2 analyzes a function, it gives local variables names such as local_4h
for ebp - 0x4
. It also offers the ability to give these variables more meaningful names when their purpose becomes clear. However, after the variables are renamed it becomes more difficult to print them. When I see an instruction such as mov eax, dword [ebp - i]
I have to
- Look at the top of the disassembly to find the line
var int i @ ebp-0xc
- Type
pxw @ebp-0xc
- Read off the value of
i
from the first of 16(!) lines of output - Find my place again in the disassembly after it was shifted from the last command
It's not a lot of work, but when when I'm looking through lots of assembly with many variables it becomes tedious quite quickly.
As a follow-up question, is it possible to print a variable/location each time execution stops at a breakpoint, like with GDB's display
command?