def printSolution( r2proj ):
# 0=offset, 1=size, 2=name
symb_variables = getSymbolicMemoryRegions( r2proj )
content = '''
# print soltion if we found a path
if len(pg.found) > 0:
state_found = pg.found[0].state
print "found the target!"
'''
for variable in symb_variables:
tmp = '''
concrete_memory = state_found.memory.load({0}, {1}) # {2}
print state_found.se.any_str(concrete_memory)'''.format(hex(variable[0]), variable[1], variable[2])
content += tmp
if len(symb_variables) == 0: # -> check for static mode
content += "IPython.embed()"
content += '''
else:
print "start IPython shell"
print "Variables: state_found, start_state, pg, proj"
IPython.embed()
'''
return content
评论列表
文章目录