簡體   English   中英

如何將多個輸入從文件重定向到正在gdb中調試的二進制文件?

[英]How to redirect multiple inputs from files to a binary being debugged in gdb?

我在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)

每個輸入都通過對應相應文件的內容傳遞給程序。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM