我使用pip install安装了radare2,然后在python shell中给出了以下几行代码
Python 2.7.6 (default, Jun 22 2015, 17:58:13)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import r2pipe
>>> r = r2pipe.open("/bin/ls")
radare2: invalid option -- '0'我已经交叉检查了/bin/ls是否可用。为什么我会得到这个错误?
发布于 2016-07-28 05:03:35
下面是我所做的:
以下是我从python控制台获得的输出:
>>> r2 = r2pipe.open("/bin/ls")
>>> print(r2.cmd("pd 10"))
;-- entry0:
0x00404890 31ed xor ebp, ebp
0x00404892 4989d1 mov r9, rdx
0x00404895 5e pop rsi
0x00404896 4889e2 mov rdx, rsp
0x00404899 4883e4f0 and rsp, 0xfffffffffffffff0
0x0040489d 50 push rax
0x0040489e 54 push rsp
0x0040489f 49c7c0d01e41. mov r8, 0x411ed0
0x004048a6 48c7c1601e41. mov rcx, 0x411e60
0x004048ad 48c7c7c02840. mov rdi, 0x4028c0 ; "AWAVAUATUH..S..H...." @ 0x4028c0
>>> print(r2.cmdj("pd 10"))
r2pipe.cmdj.Error: No JSON object could be decoded
None请确保您正确安装了radare2。你可以尝试uninstall你当前的radare2并从头开始安装它,以防在radare方面出现一些版本问题。
发布于 2016-12-02 16:37:39
对我来说,解决方案是从git repository安装radare2,而不是从过时的Ubuntu存储库安装。
安装就像运行sys/install.sh一样简单。请注意,这将覆盖任何现有的radare2安装,您可能希望在安装之前使用包管理器(例如apt-get remove radare2)将其删除。
https://stackoverflow.com/questions/38622681
复制相似问题