我在 gdb 中调试的二进制文件首先要求我输入一个 id,然后如果 id 有效则要求我输入第二个输入。
gef➤ run
Agent ID : 48093572 //This is the first input which the user has to enter
Login Validated
Main Menu:
1. Extraction Points
2. Request Extraction
3. Submit Report
0. Exit
Enter selection: // This is the second input the user has to enter
如何使用“<”运算符传递文件中的两个输入。如果只有一个输入,我可以这样做
gef➤ run < input.txt
但上述方法不适用于多个输入。
*注意:- gef 是 gdb 的插件
最佳答案
如果您还没有找到解决方案,或者其他人需要这些信息,这对我有用:
gdb$ r < <(cat 1_intest.txt 2_intest.txt)
每个输入都通过匹配相应文件的内容传递给程序。
关于linux - 如何将多个输入从文件重定向到正在 gdb 中调试的二进制文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47789602/