#include<stdio.h>
#include<stdlib.h>
int main() {
puts("Enter input: ");
char buf[100];
fgets(buf, 100, stdin);
printf("%s", buf);
}
Suppose I am debugging a program, such as the one above, where I need to type in some input. Usually, what radare2 does is that it will allow me to type in any ascii input whenever the program demands that I have user input, and it will look like the following:
Enter input: Hello
Hello
However, what if I need to type in hex input? Normally, if I wanted to use hex input for my program outside of radare2, I would use a command that looks like the following:
python -c "print('\x48\x65\x6c\x6c\x6f')" | ./program
But if I am debugging the program with radare2 and use something like \x48\x65\x6c\x6c\x6f as the input, radare2 will literally interpret the backlash x as a string that looks like "\x" instead of interpreting the input as hexadecimal. How would I go about inputting hex while inside of radare2 properly?
rarun2