OMG!! this night a bunch of pythons got inside the core of radare!
I would like to thanks wzzx for getting interest on it and make my head
turn into write a first version of the python API for radare.
So, now all the python friends will be happy and I will consider to
close my war against the snakes. I tried to make the api as plain as
possible. Here's a small example:
$ cat example.py
from radare import *
seek(0x8048000)
eval_set("asm.lines", "false")
eval_set("asm.comments", "false")
# enumerate flags
for i in range (0, len(list)):
q = list[i]
print "%s"%q["name"]
#print "%s"%q["offset"]
print flag_get("entrypoint")
print hex(3)
write("90 90 90")
print hex(3)
print dis(1)
print asm("mov eax,33")
op = analyze_opcode()
print "opcode string: %s"%op["opcode"]
print "opcode size: %s"%op["size"]
dbg_step(1)
#dbg_bp_set(0x8049412)
#dbg_continue()
eip = dbg_register_get("eip")
print eip
$ radare -i example.py -d /bin/ls
There's some stuff for using the debugger, breakpoints, flags, metadata
analyze code, assemble disassemble, hashing in multiple algorithms,
etc.. Feel free to feed be back with more ideas, patches for the API and
so.
Enjoy :)
--pancake
_______________________________________________
radare mailing list
[email protected]
http://lists.nopcode.org/listinfo.cgi/radare-nopcode.org