如何将python函数返回的参数传递给程序并使用GDB进行分析?(How to pass an argument returned by a python function to a program and analyse it with GDB?)
假设我有这个功能:
python -c "print '\x98\x84\x04\x08'"当运行二进制文件时,我可以将参数传递给它(例如通过函数fgets)。
你如何使用python命令的结果在这个二进制文件上启动GDB?
ps:显然在同一命令行中所有这些:-)
Let's say i have this function:
python -c "print '\x98\x84\x04\x08'"And when runnning a binary i can pass an argument to it (through the function fgets for instance).
How do you start GDB on this binary AND with the result of the python command ?
p.s: all of this in the same command line obviously :-)
最满意答案
一种方式是这样的:
gdb --args name-of-your-binary $(python -c "print '\x98\x84\x04\x08'")这将把python打印的结果放到argv [1]中。
One way is like this:
gdb --args name-of-your-binary $(python -c "print '\x98\x84\x04\x08'")This will put result of python print into argv[1].
更多推荐
发布评论