createScriptHelper.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:r4ge 作者: gast04 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号