如何将多个输入从文件重定向到在gdb中调试的二进制文件?

问题描述 投票:0回答:1

我在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的插件

linux gcc gdb buffer-overflow exploit
1个回答
1
投票

如果您没有找到解决方案,或者其他任何人需要这些信息,这对我有用:

gdb$ r < <(cat 1_intest.txt 2_intest.txt)

每个输入都通过引用相应文件的内容传递给程序。

© www.soinside.com 2019 - 2024. All rights reserved.