You are on page 1of 2

import binaryninjaui as binja

###inside same directory


fn = 'notepad.exe'
import binaryninjaui as binja
fn = 'rbot.exe'
rr = binaryninja.BinaryViewType.get_view_of_file(fn)
print rr

### bv bv = binja.BinaryViewType.get_view_of_file(bndbFN)
## with bv it gives no output .. so just random name rr by munir bhia

for func in rr.functions:


print func.start

###outFN = 'notepad.exe.txt'

with open(outFN,'w') as fw:

for func in rr.functions:


f_name = func.name
f_type = -1
f_type_name = 'None'
if func.symbol is not None:
f_type = func.symbol.type
f_type_name = func.symbol.type.name

rrs = func.basic_blocks

for bb in rrs:
fw.write('{0} {1} {2} {3} {4}\
n'.format(func.start,bb.start,f_name,f_type,f_type_name))

### bv = binja.BinaryViewType.get_view_of_file(bndbFN)

fw = open('D:\\Users\\naveed\\Desktop\\testscript1.txt', 'a')
#f = open('C:\\Users\\naveed\\Desktop\\testscript.txt', 'a')
f.write( "dddddddddd" + '\n')

for func in rr.functions:


f_name = func.name
f_type = -1
f_type_name = 'None'
if func.symbol is not None:
f_type = func.symbol.type
f_type_name = func.symbol.type.name
rrs = func.basic_blocks
for bb in rrs:
fw.write('{0} {1} {2} {3} {4}\
n'.format(func.start,bb.start,f_name,f_type,f_type_name))

##execfile('extract_function.py')
execfile('function_extract.py') ### workedd

Sep 23,2o21
###run api call code from frond end
###after necessary changes in the extract_raw of deepreflect and removing networkx
code, now going to run it
execfile('extract_raw.py') ### workedd

done.
removed main function that was the error in the script.
###important above point.

execfile('extract_raw_bb_address.py') ### workedd

=========

You might also like