1

I have been playing around with radare2, and i am wondering something that seems almost obvious to me but after much googling down the rabbit hole i can not find out how to view the console output of the binary i am debugging. For example, I can not see the output of my hello world program, i can only see the registers and disassembled instructions...

anyone have a clue what key sequence to press to view the console output of the binary i am debugging?

2

You can use rarun2 to manipulate the program's stdin, stdout, arguments, …

To answer your question, by default, radare2 doesn't start in debugger mode, so your program won't run. If you want to debug it, you'll have to start radare2 in debugger mode, with the -d flag, or reopen the binary in this mode with the ood command.

Your program's output will be display as usual, on the console:

$ r2 -d /usr/bin/uptime
Process with PID 25656 started...
= attach 25656 25656
bin.baddr 0x557d50ca7000
USING 557d50ca7000
Assuming filepath /usr/bin/uptime
asm.bits 64
 -- Press 'C' in visual mode to toggle colors
[0x7f016bfd4ca0]> dc
Selecting and continuing: 25656
 22:02:48 up  4:26,  6 users,  load average: 0.18, 0.25, 0.29
PTRACE_EVENT_EXIT pid=25656, status=0x0
[0x7f016bab5b68]> 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.