# How to DUMP the full hexa of each function extracted by analysis of binary file?

I used a script python from radare2-bindings to write a code analysing a binary file, i extracted the name , the start address and the size of each function , but i can't dump the hexa of each function , i am asking if there is a methode or python script in radare2 or another tool (capstone , miasm , angr ...) to solve this problem .

the script is :

    import sys
import sqlite3 as lite
try:
import os, signal
from r_core import *
except:
from r2.r_core import *

rc = RCore()
rc.file_open("/home/younes/Bureau/a.out", 0, 0)

rc.anal_all()
funcs = rc.anal.get_fcns()
for f in funcs:
blocks = f.get_bbs()
print("+" + (72 * "-"))
print("| FUNCTION: %s @ 0x%x" % (f.name, f.addr))
print("| (%d blocks)" % (len (blocks)))
print("+" + (72 * "-"))
funcSize=0
for b in blocks:
funcSize+=b.size

print("   | f.size:      0x%x" %(funcSize))

os.kill (os.getpid (), signal.SIGTERM)

• What does your "I can't" mean, in this context? Do regular Python file operations not work in this environment, don't you have direct access to the raw data ... or, literally, you can't do it because you don't know how to? – usr2564301 Jul 18 '16 at 18:03
• yes i don't know how to access to the raw data – Y.hadj.younes Jul 18 '16 at 19:12

import r2pipe