Advertisement
joxeankoret

IDAPython script to get pseudocode comments

Jan 2nd, 2018
460
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.42 KB | None | 0 0
  1. """
  2. IDAPython script to get pseudocode comments
  3. """
  4.  
  5. ea = idaapi.get_screen_ea()
  6. cfunc = idaapi.decompile(ea)
  7. sv = cfunc.get_pseudocode()
  8.  
  9. cmts = idaapi.restore_user_cmts(cfunc.entry_ea)
  10. if cmts is not None:
  11.   for tl, cmt in cmts.iteritems():
  12.     print "0x%08x: %s " % (tl.ea, str(cmt))
  13.  
  14. index = 0
  15. for item in cfunc.treeitems:
  16.   if item.ea != BADADDR:
  17.     print index, hex(item.ea), item.index
  18.     index += 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement