database.py 文件源码

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

项目:idascripts 作者: ctfhacker 项目源码 文件源码
def disasm(ea, **options):
    """Disassemble the instructions at the address ``ea``.
    If the integer ``count`` is specified, then return ``count`` number of instructions.
    If the bool ``comments`` is True, then return the comments for each instruction as well.
    """
    ea = interface.address.inside(ea)

    res,count = [], options.get('count',1)
    while count > 0:
        insn = idaapi.generate_disasm_line(ea)
        unformatted = idaapi.tag_remove(insn)
        nocomment = unformatted[:unformatted.rfind(';')] if ';' in unformatted and not options.get('comments',False) else unformatted
        res.append("{:x}: {:s}".format(ea, reduce(lambda t,x: t + (('' if t.endswith(' ') else ' ') if x == ' ' else x), nocomment, '')) )
        ea = address.next(ea)
        count -= 1
    return '\n'.join(res)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号