I have just played a bit with the python api and now we have an initial working
api with a command execution interface:

You can run this script with:

$ radare /bin/ls
[0x00000000]> _.src/entrypoint.py
Entrypoint at 0x8048590



Source code:

$ cat src/entrypoint.py 
#
# Sample python-radare script
#
import r

# Disable color
r.cmd(":%COLOR 0")

head = r.cmd(":pX 4 @ 0").strip()

if head == "7f 45 4c 46":
        r.cmd("e 0") # little endian
        entry = r.cmd(":pW 4 @ 0x18").strip()
        print "Entrypoint at 0x" + entry
else:
        print "Unknown file type"

# Enable color again
r.cmd(":%COLOR 1")


  --pancake
_______________________________________________
radare mailing list
[email protected]
https://lists.nopcode.org/mailman/listinfo/radare

Reply via email to