Various comments here:
- in debian/arch/void/gentoo there are binary packages for those
bindings (i also built a version for windows too)
- it's recommended to use git version
- enable-devel is deprecated
- bindings are inside r2-bindings subdirectory
- r.py is just a r_core_cmd() wrapper api, not real api, just parses
commands text instead.
- current git have two different implementation of the python bindings,
both based on valabind (ctypes and swig)
- both implementations should be compatible and same code should run on both
- there are scripts in sys/*.sh to automate those builds
- You may like to run sys/python.sh
- the bindings are compiled by the farm (see bin.rada.re and ci.rada.re)
- "import radare" are the old text-based bindings for radare1
- see r2-bindings/python/test-*.py to see some code examples.
- if you want to build bindings for windows see doc/windows
Hope this helps :)
Here's a sample program:
from r2.r_bin import *
b = RBin ()
b.load ("/bin/ls", False)
baddr= b.get_baddr ()
print '-> Sections'
for i in b.get_sections ():
print 'offset=0x%08x va=0x%08x size=%05i %s' % (
i.offset, baddr+i.rva, i.size, i.name)
On 07/15/13 04:20, Andrew Case wrote:
Hello,
I have compiled radare with python bindings following the instructions
in the source code:
./configure --prefix=/usr --enable-devel --enable=python
but I cannot import radare as it will error with being unable to find
a module named 'r', which from reading docs and source code seems to
be the module that drives everything.
I did a search across disk and could not find a "r.py" file.
Is there other documentation I should be following?
_______________________________________________
radare mailing list
[email protected]
http://lists.nopcode.org/listinfo.cgi/radare-nopcode.org
_______________________________________________
radare mailing list
[email protected]
http://lists.nopcode.org/listinfo.cgi/radare-nopcode.org