I'm debugging a file with radare2 and when I come to scanf function I want to forward input from a .txt file. In gdb I would do this by typing r < text.txt.

Is something like that possible in radare2? I've tried dc < text.txt but it seems that it's not working.

2 Answers 2


Always ensure you use radare2 git version.

For that purpose you can use rarun2:

For stdio check what is the tty using tty for stdin just add what file you want to add, then in your rarun2 config file:


Then just r2 -d /bin/ls -e dbg.profile=bla.rr2


I don't have enough reputation to comment maijin answer, but due to that answer(r2 issue #9788) passing params after -d flag can get side effects.

... don't pass flags after -d or may be taken as args of the program in some systems.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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