我们从Python开源项目中,提取了以下5个代码示例,用于说明如何使用idaapi.add_menu_item()。
def init(self): global initialized if initialized == False: initialized = True # menu = idaapi.add_menu_item("Edit/x64dbgida/", "About", "", 0, # self.about, None) # if menu is not None: idaapi.attach_action_to_menu("Edit/x64dbgida/", 'my:exportdb', idaapi.SETMENU_APP) idaapi.attach_action_to_menu("Edit/x64dbgida/", 'my:importdb', idaapi.SETMENU_APP) # idaapi.add_menu_item("Edit/x64dbgida/", # "Import (uncompressed) database", "", 0, # self.importdb, None) # elif idaapi.IDA_SDK_VERSION < 680: # idaapi.add_menu_item("File/Produce file/", # "Export x64dbg database", "", 0, # self.exportdb, None) # idaapi.add_menu_item("File/Load file/", # "Import x64dbg database", "", 0, # self.importdb, None) return idaapi.PLUGIN_OK
def init(self): NO_HOTKEY = "" SETMENU_INS = 0 NO_ARGS = tuple() logger.debug("[+] %s.init()" % self.__class__.__name__) self.menuitems = [] logger.debug("[+] setting up menus") menu = idaapi.add_menu_item(self.wanted_menu[0], self.wanted_menu[1], NO_HOTKEY, SETMENU_INS, self.menu_config, NO_ARGS) self.menuitems.append(menu) return idaapi.PLUGIN_KEEP
def add(cls, path, name, fn, hotkey='', flags=0, args=()): if (path,name) in cls.state: cls.rm(path, name) ctx = idaapi.add_menu_item(path, name, hotkey, flags, fn, args) cls.state[path,name] = ctx
def register_menu(self): global g_bindiff g_bindiff = self idaapi.add_menu_item("Edit/Plugins/", "Diaphora - Show results", "F3", 0, show_choosers, ()) idaapi.add_menu_item("Edit/Plugins/", "Diaphora - Save results", None, 0, save_results, ()) idaapi.add_menu_item("Edit/Plugins/", "Diaphora - Load results", None, 0, load_results, ()) Warning("""AUTOHIDE REGISTRY\nIf you close one tab you can always re-open it by pressing F3 or selecting Edit -> Plugins -> Diaphora - Show results""")
def RegisterMenuActions(handler): global g_MenuList g_MenuList.append(add_menu_item("Edit/Plugin/Frida Link/", "Unload Plugin", "SHIFT+CTRL+U", 0, handler.unloadPlugin, ())) g_MenuList.append(add_menu_item("Edit/Plugin/Frida Link/", "Stop Server", None, 0, handler.stopServer, ())) g_MenuList.append(add_menu_item("Edit/Plugin/Frida Link/", "Start Server", None, 0, handler.startServer, ())) add_menu_item( "Edit/Plugin/Frida Link/", "-", None, 0, handler.doNothing, ()) g_MenuList.append(add_menu_item("Edit/Plugin/Frida Link/", "Debug Log Toggle", None, 0, handler.logToggle, ())) g_MenuList.append(add_menu_item("Edit/Plugin/Frida Link/", "Symbol Overwrite Toggle", None, 0, handler.overwriteSymbolToggle, ())) g_MenuList.append(add_menu_item("Edit/Plugin/Frida Link/", "Show Settings", None, 0, handler.showSettings, ())) add_menu_item( "Edit/Plugin/Frida Link/", "-", None, 0, handler.doNothing, ()) g_MenuList.append(add_menu_item("Edit/Plugin/Frida Link/", "Close DB", None, 0, handler.showCloseDB, ())) g_MenuList.append(add_menu_item("Edit/Plugin/Frida Link/", "Execute DB Query", None, 0, handler.showExecQuery, ())) g_MenuList.append(add_menu_item("Edit/Plugin/Frida Link/", "Open DB", None, 0, handler.showOpenDB, ())) g_MenuList.append(add_menu_item("Edit/Plugin/Frida Link/", "Create DB", None, 0, handler.showCreateDB, ())) add_menu_item( "Edit/Plugin/Frida Link/", "-", None, 0, handler.doNothing, ()) g_MenuList.append(add_menu_item("Edit/Plugin/Frida Link/", "Step Over Breakpoint", "SHIFT+CTRL+O", 0, handler.handleDebugStepOver, ())) g_MenuList.append(add_menu_item("Edit/Plugin/Frida Link/", "Step Into Breakpoint", "SHIFT+CTRL+I", 0, handler.handleDebugStepInto, ())) g_MenuList.append(add_menu_item("Edit/Plugin/Frida Link/", "Release Breakpoint", "SHIFT+CTRL+R", 0, handler.handleDebugContinue, ())) add_menu_item( "Edit/Plugin/Frida Link/", "-", None, 0, handler.doNothing, ()) g_MenuList.append(add_menu_item("Edit/Plugin/Frida Link/", "Show Target Log", None, 0, handler.showTargetLog, ())) g_MenuList.append(add_menu_item("Edit/Plugin/Frida Link/", "Show FRAPL Log", "SHIFT+CTRL+L", 0, handler.showFraplLog, ())) g_MenuList.append(add_menu_item("Edit/Plugin/Frida Link/", "Show Address Converter", "SHIFT+CTRL+A", 0, handler.showAddressConverter, ())) g_MenuList.append(add_menu_item("Edit/Plugin/Frida Link/", "Show Module List", None, 0, handler.showModuleList, ())) g_MenuList.append(add_menu_item("Edit/Plugin/Frida Link/", "Show Memory Manager", "SHIFT+CTRL+M", 0, handler.showMemoryManager, ())) g_MenuList.append(add_menu_item("Edit/Plugin/Frida Link/", "Show Arbitrary Hooks", None, 0, handler.showArbitraryHooks, ())) g_MenuList.append(add_menu_item("Edit/Plugin/Frida Link/", "Show Replaced Funcs", None, 0, handler.showReplacedFuncs, ())) g_MenuList.append(add_menu_item("Edit/Plugin/Frida Link/", "Show Import Hooks", "SHIFT+CTRL+S", 0, handler.showImportHooks, ())) g_MenuList.append(add_menu_item("Edit/Plugin/Frida Link/", "Show IDB Hooks", None, 0, handler.showDatabaseHooks, ())) add_menu_item( "Edit/Plugin/Frida Link/", "-", None, 0, handler.doNothing, ()) g_MenuList.append(add_menu_item("Edit/Plugin/Frida Link/", "Execute Frida Script", "SHIFT+CTRL+E", 0, handler.showExecScriptDlg, ())) g_MenuList.append(add_menu_item("Edit/Plugin/Frida Link/", "Fetch Target Modules", None, 0, handler.requestModules, ())) g_MenuList.append(add_menu_item("Edit/Plugin/Frida Link/", "Load Module", None, 0, handler.loadModule, ())) add_menu_item( "Edit/Plugin/Frida Link/", "-", None, 0, handler.doNothing, ()) g_MenuList.append(add_menu_item("Edit/Plugin/Frida Link/", "Save Project", None, 0, handler.saveProject, ())) g_MenuList.append(add_menu_item("Edit/Plugin/Frida Link/", "Load Project", None, 0, handler.loadProject, ()))