def decompile(cls, ea):
'''(UNSTABLE) Returns the decompiled code of the basic-block at the address ``ea``.'''
source = idaapi.decompile(ea)
res = map(functools.partial(operator.__getitem__, source.eamap), cls.iterate(ea))
res = itertools.chain(*res)
formatted = reduce(lambda t,c: t if t[-1].ea == c.ea else t+[c], res, [next(res)])
res = []
# FIXME: This is pretty damn unstable in my tests.
try:
for fmt in formatted:
res.append( fmt.print1(source.__deref__()) )
except TypeError: pass
return '\n'.join(map(idaapi.tag_remove,res))
# function frame attributes
# FIXME: put these in their own object and replace them with aliases
评论列表
文章目录