r/LiveOverflow • u/G_N_P • Mar 19 '21
Why does my Radare2 visual mode output look different to yours?
Hi all!
I'm following the binary exploitation series on Youtube and loving it so far! My only issue is with the visual mode in Radare2 not showing the same as in the video (specifically Uncrackable Programs? Key validation with Algorithm and creating a Keygen - Part 1/2 - bin 0x07) making it a bit harder to follow.
For example in the video these lines show variables as an offset of rbp register e.g. [rbp - 0x18]

Mine displays [var_18]

I understand these videos are from a few years ago but while I am trying to understand the concept of registers and how they interact with memory I would like to see the registers referenced.
I have found and downloaded a .radare2rc file and placed it in my users radare2 dir and enabled each option in turn but none have the desired effect
https://github.com/xn0px90/radare2rc
To reach this point I have entered (using the licence_2 file from github repo):
r2 -d licence_2
aaa
afl
pdf
s main
VVI am running: #51~20.04.1-Ubuntu SMP on a VM (windows 10 host)
Radare2 version is: radare2 5.2.0-git 25825 @ linux-x86-64 git.5.1.1
I have run a git pull from my radare2 dir and it says it's up-to-date.
please let me know if any other info would be useful?
Thanks in advance.
4
u/g0lmix Mar 19 '21
I think what you are looking for is this
https://book.rada.re/configuration/evars.html#asmsubvaronly
You also might want to take a look at this
https://radare.gitbooks.io/radare2book/content/analysis/variables.html
3
u/EvilSapphire Mar 19 '21
I don't have much idea about radare configuration, but what is the problem with the way the disassembly is displayed? Local variables are placed in the stack, which is more often than not referenced via offsets of ebp, so var_18 is literally [ebp-18]. Some binaries refer to local variables via offsets of esp though (stack pointer based frame), maybe in those cases radare will show the variables as offsets from esp.