Python 2.7.6 r2pip

2024-09-26 22:51:52 发布

您现在位置:Python中文网/ 问答频道 /正文

我安装了r2管道,但它没有运行。我不明白。你知道吗

 Python 2.7.6 (default, Mar 22 2014, 22:59:56) 
   [GCC 4.8.2] on linux2
   Type "help", "copyright", "credits" or "license" for more information.  
   >>> import r2pipe
   >>> r2 = r2pipe.open("/bin/ls")
   Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
   File "/usr/local/lib/python2.7/dist-packages/r2pipe/__init__.py", line      132, in __init__
   self.process = Popen(cmd, shell=False, stdin=PIPE, stdout=PIPE)
   File "/usr/lib/python2.7/subprocess.py", line 710, in __init__
   errread, errwrite)
   File "/usr/lib/python2.7/subprocess.py", line 1327, in _execute_child
   raise child_exception
   OSError: [Errno 2] No such file or directory

Tags: orinpychild管道initlibusr
1条回答
网友
1楼 · 发布于 2024-09-26 22:51:52

环境

  • Python:Python 2.7.15+(默认值,2019年10月7日,17:39:04)
  • 系统:Ubuntu 18.04 LTS

解决方案

示例

未安装R2管道和雷达2的示例。你知道吗

user@host:~$ python
Python 2.7.15+ (default, Oct  7 2019, 17:39:04) 
[GCC 7.4.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import r2pipe
>>> Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named r2pipe
>>> exit()
user@host:~$

例如,安装了R2管道,但未安装雷达2。你知道吗

user@host:~$ pip install r2pipe
Collection r2pipe
...
Successfully installed r2pipe-1.4.2
user@host:~$ python
Python 2.7.15+ (default, Oct  7 2019, 17:39:04) 
[GCC 7.4.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import r2pipe
>>> r2 = r2pipe.open("/bin/ls")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/user/.local/lib/python2.7/site-packages/r2pipe/open_sync.py", line 62, in __init__
    raise Exception("ERROR: Cannot find radare2 in PATH")
Exception: ERROR: Cannot find radare2 in PATH
>>> exit()
user@host:~$

安装了R2管道和雷达2的示例。你知道吗

user@host:~$ git clone https://github.com/radareorg/radare2.git
cloning into 'radare2'...
...
user@host:~$ ./radare2/sys/install.sh
...
user@host:~$ r2
Usage: r2 [-ACdfLMnNqStuvwzX] [-P patch] [-p prj] [-a arch] [-b bits] [-i file]
          [-s addr] [-B baddr] [-m maddr] [-c cmd] [-e k=v] file|pid|-| |=
user@host:~$ python
Python 2.7.15+ (default, Oct  7 2019, 17:39:04) 
[GCC 7.4.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import r2pipe
>>> r2 = r2pipe.open("/bin/ls")
>>> r2.cmd('aaaa')
...
>>> print r2.cmd('afl')
0x00005850    1 42           entry0
0x0001636c    1 9            sym._fini
0x00003758    3 23           sym._init
0x00015690    5 42   -> 38   sym._obstack_memory_used
...
0x00005950    5 154  -> 67   entry.init0
0x00005910    5 58   -> 51   entry.fini0
0x00005880    4 50   -> 40   fcn.00005880
>>> exit()
user@host:~$



相关问题 更多 >

    热门问题