def init(): idaapi.CompileLine('static Go() { RunPythonStatement("GoEx()"); }') idaapi.CompileLine('static GetRva() { RunPythonStatement("GetRVA()"); }') idaapi.CompileLine('static Search() { RunPythonStatement("SearchEx()"); }') idc.AddHotkey("Shift+G", 'Go') idc.AddHotkey("Shift+R", 'GetRva') idc.AddHotkey("Shift+S", 'Search')
def copy_rva_main() -> None: if ida_version_below_74: idaapi.CompileLine('static send_ea_to_clipboard() { RunPythonStatement("copy_ea_to_clipboard()"); }') idc.AddHotkey(PLUGIN_HOTKEY, "send_ea_to_clipboard") else: ida_expr.compile_idc_text('static send_ea_to_clipboard() { RunPythonStatement("copy_ea_to_clipboard()"); }') ida_kernwin.add_idc_hotkey(PLUGIN_HOTKEY, "send_ea_to_clipboard") print("[+] Press '{:s}' to copy RVA to clipboard".format(PLUGIN_HOTKEY)) return
view.Show() # Support ida 6.9 and ida 7 all_views = [] hooks = Hooks() hooks.hook() action_expand = idaapi.action_desc_t('my:expand', 'Expand', ActionHandlerExpand(), 'E', 'Expand expression', 50) action_translate = idaapi.action_desc_t( 'my:translate', 'Translate', ActionHandlerTranslate(), 'T', 'Translate expression in C/python/z3...', 103) idaapi.register_action(action_expand) idaapi.register_action(action_translate) if __name__ == '__main__': idaapi.CompileLine( 'static key_F3() { RunPythonStatement("symbolic_exec()"); }') idc.AddHotkey("F3", "key_F3") print "=" * 50 print """Available commands: symbolic_exec() - F3: Symbolic execution of current selection """
complete_path = os.path.sep.join([cache_path, file_name]) if not os.path.isfile(complete_path): src = str(idaapi.decompile(idaapi.get_screen_ea())) self.tools.save_file(complete_path, src) self.tools.set_file_path(complete_path) max_title = self.config_main.getint('etc', 'max_title') self.gui = include.gui.Canvas(self.config_main, self.config_theme, self.tools, demangled_name[:max_title]) self.gui.Show('HRDEV') self.parser = include.syntax.Parser(self) self.parser.run(complete_path) return def main(real_dir): '''Simple wrapper.''' try: Plugin(real_dir).run() except Exception, error: print error return if __name__ == '__main__': PLUGIN_PATH = os.path.realpath(__file__) idaapi.CompileLine('static __run_main()' '{ RunPythonStatement("main(PLUGIN_PATH)"); }') idc.AddHotkey('Alt-,', '__run_main')
def enable_shortcut(): idaapi.CompileLine( 'static copy2clip() { RunPythonStatement("copy2clip()"); }') idc.AddHotkey(PLUGIN_HOTKEY, "copy2clip") return
def addHotkey(self, key, handler): return idc.AddHotkey(key, handler)
size = int(self.size.text(), base=16) create_struc(str(self.name.text()), size) else: create_struc_from_skeleton( str(self.name.text()), gen_skeleton_and_eas( phrase.keys()[self.reg.currentIndex()])[0]) def run_structs(): global gui gui = StructuresGui() idaapi.CompileLine('static key_2() {RunPythonStatement("run_structs()");}') idc.AddHotkey("2", "key_2") #gui.show() #create_struc_from_skeleton('DXGDEVICE', gen_skeleton_and_eas('esi')[0]) #print get_struc_offset(ScreenEA(), 1) #def copy_struc_members(src, dest, src_offset, dest_offset, size): # # TODO structure with member as structures # src_sid = idc.GetStrucIdByName(src) # dest_sid = idc.GetStrucIdByName(dest) # while src_offset != idc.BADADDR and src_offset < src_offset + size: # name = idc.GetMemberName(src_sid, src_offset) # flag = idc.GetMemberFlag(src_sid, src_offset) # idc.SetMemberName(dest_sid, dest_offset, name) # idc.SetMemberType(dest_sid, dest_offset, flag, -1, 1) # src_offset = idc.GetStrucNextOff(src_sid, src_offset)
confirmationLayout) tabWidget = QtGui.QTabWidget() tabWidget.addTab(diffContainer, 'Input') tabWidget.addTab(confirmationContainer, 'Detected Modifications') self.tabs = tabWidget mainLayout = QtGui.QVBoxLayout() mainLayout.addWidget(tabWidget) self.parent.setLayout(mainLayout) def OnClose(self, form): self.ClearTable() if self.orgCustViewer: self.orgCustViewer.Show() self.orgCustViewer.Close() if self.modCustViewer: self.modCustViewer.Show() self.modCustViewer.Close() def main(): gsrc = GlobalSymbolRenameClass() gsrc.Show("Mass Rename") if __name__ == "__main__": idaapi.CompileLine( 'static __MassRename() { RunPythonStatement("main()"); }') idc.AddHotkey(HOTKEY, '__MassRename')
def registerHotkey(shortcut): idaapi.CompileLine(r'static extractCode() { RunPythonStatement("tq.extractCode()"); }') idc.AddHotkey(shortcut, "extractCode")
def registerHotkey_2(shortcut): idaapi.CompileLine( r'static Run_2() { RunPythonStatement("Fix_Vmp_Dump_API.Run_2()"); }') idc.AddHotkey(shortcut, "Run_2")