A GDB plug-in that can set stdio of the program you debug.
See issue #1
git clone https://github.com/Ovi3/pstdio.git ~/pstdio
echo "source ~/pstdio/pstdio.py" >> ~/.gdbinit
First open GDB, And type 'pstdio help' to see the help text.
Example:
- When you debug the program, and the program will call the '
<read@plt>
to read data from stdio. - And if you wanna enter the data, like '\x02\x03\x04\x05', just type:
pstdio data /x \\x02\\x03\\x04\\x05
- Then execute the 'call
<read@plt>
', the data you enter will be input. - Or you can type 'psdtio file /path/to/data'. In this case, data of the file will be input.