IDA Pro:程序参数

逆向工程 艾达 外壳代码
2021-06-12 17:10:20

我目前正在处理 C 程序中的简单缓冲区溢出问题,并且我试图通过在 IDA Pro 中逐步执行来理解该程序。

该程序接受一个参数并将其写入缓冲区strcpy()我可以AAAA...向 IDA Pro 中的程序(调试器->进程选项)传递一个简单的参数,并查看返回地址是如何被覆盖的。

我现在想做的是传递一些 shellcode 作为参数,然后在 IDA Pro 中查看程序如何将 shellcode 写入缓冲区并覆盖返回地址。

在 shell 中,我会执行类似的操作:

$ ./vuln \`perl -e 'print "\x55\x89\xe5..."'`

或者

$ ./vuln \`cat shellcode.txt`

所以我的问题是:如何将不可打印的字符作为参数传递给 IDA Pro 中的程序?

1个回答

尝试使用IDC功能StartDebugger您可以"\x55\x89\xe5"为程序参数传递 C 样式字符串(例如):

***********************************************
** Launch the debugger
   arguments:
        path - path to the executable file.
        args - command line arguments
        sdir - initial directory for the process
for all args: if empty, the default value from the database will be used
   returns: -1-failed, 0-cancelled by the user, 1-ok
   See the important note to the StepInto() function

long StartDebugger(string path, string args, string sdir);