def activate(self, ctx): if self.action == ACTION_HX_REMOVERETTYPE: if IDA7: vdui = idaapi.get_widget_vdui(ctx.widget) else: vdui = idaapi.get_tform_vdui(ctx.form) self.remove_rettype(vdui) vdui.refresh_ctext() elif self.action == ACTION_HX_COPYEA: ea = idaapi.get_screen_ea() if ea != idaapi.BADADDR: copy_to_clip("0x%X" % ea) print("Address 0x%X has been copied to clipboard" % ea) elif self.action == ACTION_HX_COPYNAME: if IDA7: name = idaapi.get_highlight(idaapi.get_current_viewer())[0] else: name = idaapi.get_highlighted_identifier() if name: copy_to_clip(name) print("%s has been copied to clipboard" % name) elif self.action == ACTION_HX_GOTOCLIP: loc = parse_location(clip_text()) print("Goto location 0x%x" % loc) Jump(loc) else: return 0 return 1
def activate(self, ctx): if self.action == ACTION_HX_REMOVERETTYPE: if IDA7: vdui = idaapi.get_widget_vdui(ctx.widget) else: vdui = idaapi.get_tform_vdui(ctx.form) self.remove_rettype(vdui) vdui.refresh_ctext() elif self.action == ACTION_HX_COPYEA: ea = idaapi.get_screen_ea() if ea != idaapi.BADADDR: copy_to_clip("0x%X" % ea) print "Address 0x%X has been copied to clipboard" % ea elif self.action == ACTION_HX_COPYNAME: if IDA7: name = idaapi.get_highlight(idaapi.get_current_viewer())[0] else: name = idaapi.get_highlighted_identifier() if name: copy_to_clip(name) print "%s has been copied to clipboard" % name else: return 0 return 1
def get_highlighted_identifier(): if not hasattr(idaapi, "get_highlighted_identifier"): thing = idaapi.get_highlight(idaapi.get_current_viewer()) if thing and thing[1]: return thing[0] else: return idaapi.get_highlighted_identifier()
def populating_tform_popup(self, form, popup): global highlight if idaapi.get_tform_type(form) == idaapi.BWN_DISASM: highlight = idaapi.get_highlight(form) if highlight: idaapi.update_action_label("search:action", "Search Google for \"" + highlight[0] + "\"") idaapi.attach_action_to_popup(form, popup, "search:action", None)
def symbol(cls): '''Return the current highlighted symbol name.''' if idaapi.__version__ < 7.0: return idaapi.get_highlighted_identifier() # IDA 7.0 way of getting the currently selected text viewer = idaapi.get_current_viewer() res = idaapi.get_highlight(viewer) if res and res[1]: return res[0] return res
def get_highlighted_identifier(): thing = idaapi.get_highlight(idaapi.get_current_viewer()) if thing and thing[1]: return thing[0]
def get_highlight(): highlight_result = idaapi.get_highlight(idaapi.get_current_viewer()) return highlight_result[ 0] if highlight_result and highlight_result[1] else ''
def F**k(): InitFn() name, _ = idaapi.get_highlight(idaapi.get_current_viewer()) if name in funcDB.keys(): os.startfile(funcDB[name], 'open')