I have a program that waits for the user to enter a string input, how can I enter that string input while debugging my program with IDA?
2 Answers
You can use I/O redirection operators in the Process options-Parameters field:
The standard input/output/error channels can be redirected using the bash shell notations. for example:
>output 2>&1
I have found the answer after hours of searching, it is really sad that such a great tool doesn't have this option easily enabled. anyway, you have to lunch the IDA from the terminal but you have to add
"cat |"
before it. For me, it was like this
cat | ./ida64
and then when the program waits for the user's input, you have to go back to the terminal and supply it there.
If you want to add a file as an input you can do this
cat myfile | ./ida64
If you know any better solution please post it here.
-
You may as well use
yes
then. If this above method worked you may also want to check outexpect
and its variants (such aspexpect
).– 0xC0000022L ♦Jul 3, 2019 at 21:52