本文整理汇总了Python中idaapi.add_menu_item方法的典型用法代码示例。如果您正苦于以下问题:Python idaapi.add_menu_item方法的具体用法?Python idaapi.add_menu_item怎么用?Python idaapi.add_menu_item使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类idaapi
的用法示例。
在下文中一共展示了idaapi.add_menu_item方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: insert
# 需要导入模块: import idaapi [as 别名]
# 或者: from idaapi import add_menu_item [as 别名]
def insert(self, option_groups=[]):
if "enable" in option_groups:
self.enable_menu_item = idaapi.add_menu_item("FILE/", "Enable IDASynergy for this IDB", "", 0, self.on_enable_plugin, ())
#self.remove_hooks()
else:
if "svn" in option_groups and self.svn_menuitems == []:
self.svn_menuitems.append( idaapi.add_menu_item("FILE/", "IDASynergy SVN Checkout...", "", 0, self.on_checkout, ()) )
self.svn_menuitems.append( idaapi.add_menu_item("FILE/", "IDASynergy SVN Commit...", "CTRL+SHIFT+C", 0, self.on_commit, () ))
self.svn_menuitems.append( idaapi.add_menu_item("FILE/", "IDASynergy SVN Update...", "CTRL+SHIFT+U", 0, self.on_update, () ))
if "full" in option_groups and self.ex_addmenu_item_ctx == []:
self.ex_addmenu_item_ctx.append( idaapi.add_menu_item("Options/", "IDASynergy...", "", 0, self.on_config, ()) )
self.ex_addmenu_item_ctx.append( idaapi.add_menu_item("FILE/", "IDASynergy Load from local repository", "", 0, self.on_import_all, ()) )
self.ex_addmenu_item_ctx.append( idaapi.add_menu_item("FILE/", "IDASynergy Export analysis to file", "", 0, self.on_export, ()) )
self.ex_addmenu_item_ctx.append( idaapi.add_menu_item("FILE/", "IDASynergy Import analysis from file", "", 0, self.on_import, ()))
#self.insert_hooks()
self.remove(["enable"])
示例2: installMenu
# 需要导入模块: import idaapi [as 别名]
# 或者: from idaapi import add_menu_item [as 别名]
def installMenu():
#hack -> stashing a flag under idaapi to prevent multiple menu items from appearing
if hasattr(sys.modules['idaapi'], '_apply_callee_type_plugin_installFlag'):
#print('Skipping menu install: already present')
return
if using_ida7api:
return installMenuIda7()
global ex_addmenu_item_ctx
ex_addmenu_item_ctx = idaapi.add_menu_item(
MENU_PATH,
PLUGIN_NAME,
PREFERRED_SHORTCUT,
0,
doApplyCallee,
tuple("hello world")
)
if ex_addmenu_item_ctx is None:
print('Failed to init apply_callee_type_plugin')
setattr(sys.modules['idaapi'], '_apply_callee_type_plugin_installFlag', True)
示例3: register_menu
# 需要导入模块: import idaapi [as 别名]
# 或者: from idaapi import add_menu_item [as 别名]
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""")
示例4: init
# 需要导入模块: import idaapi [as 别名]
# 或者: from idaapi import add_menu_item [as 别名]
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 for ida version %s" % idaapi.IDA_SDK_VERSION)
if idaapi.IDA_SDK_VERSION >= 700:
# >= 700
action_desc = idaapi.action_desc_t("tintinweb:batchdecompile:load", self.wanted_name, IdaDecompileUiActionHandler(self))
idaapi.register_action(action_desc)
idaapi.attach_action_to_menu(''.join(self.wanted_menu), "tintinweb:batchdecompile:load", idaapi.SETMENU_APP)
else:
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
示例5: AddMenuElements
# 需要导入模块: import idaapi [as 别名]
# 或者: from idaapi import add_menu_item [as 别名]
def AddMenuElements(self):
idaapi.add_menu_item("File/", "Code editor", "Alt-E", 0, self.popeye, ())
idaapi.set_menu_item_icon("File/Code editor", idaapi.load_custom_icon(":/ico/python.png"))
示例6: add
# 需要导入模块: import idaapi [as 别名]
# 或者: from idaapi import add_menu_item [as 别名]
def add(cls, path, name, callable, hotkey='', flags=0, args=()):
'''Register a `callable` as a menu item at the specified `path` with the provided `name`.'''
# check to see if our menu item is in our cache and remove it if so
if (path, name) in cls.state:
cls.rm(path, name)
# now we can add the menu item since everything is ok
# XXX: I'm not sure if the path needs to be utf8 encoded or not
res = internal.utils.string.to(name)
ctx = idaapi.add_menu_item(path, res, hotkey, flags, callable, args)
cls.state[path, name] = ctx
示例7: init
# 需要导入模块: import idaapi [as 别名]
# 或者: from idaapi import add_menu_item [as 别名]
def init(self):
# register popup menu handlers
try:
# Register Auto Fix IDB handler
VxHunterMCFixIDB.register(self, "Auto Fix IDB With symbol table")
# Register Fix Code handler
VxHunterMCFixCode.register(self, "Fix Code from start address to end address")
# Register Fix Ascii handler
VxHunterMCFixAscii.register(self, "Fix Ascii string table with giving address")
# Register Load symbol file handler
VxHunterMCLoadSymbolFile.register(self, "Load VxWorks symbol file")
except Exception as err:
print("Got Error!!!: %s" % err)
# setup popup menu
if idaapi.IDA_SDK_VERSION >= 700:
# Add menu IDA >= 7.0
idaapi.attach_action_to_menu("Edit/VxHunter/", VxHunterMCFixIDB.get_name(), idaapi.SETMENU_APP)
idaapi.attach_action_to_menu("Edit/VxHunter/", VxHunterMCFixCode.get_name(), idaapi.SETMENU_APP)
idaapi.attach_action_to_menu("Edit/VxHunter/", VxHunterMCFixAscii.get_name(), idaapi.SETMENU_APP)
idaapi.attach_action_to_menu("Edit/VxHunter/", VxHunterMCLoadSymbolFile.get_name(), idaapi.SETMENU_APP)
else:
# add Vxhunter menu
menu = idaapi.add_menu_item("Edit/VxHunter/", "Auto Fix IDB1", "", 1, self.handler_auto_fix_idb, None)
if menu is not None:
pass
print("=" * 80)
return idaapi.PLUGIN_KEEP
示例8: init
# 需要导入模块: import idaapi [as 别名]
# 或者: from idaapi import add_menu_item [as 别名]
def init(self):
"""
Initialize plugin:
"""
self._client_config = load_config()
self._fcc = None
if self._client_config is not None:
self._fcc = FCatalogClient(\
(self._client_config.remote_host,\
self._client_config.remote_port),\
self._client_config.db_name,\
self._client_config.exclude_pattern)
# Make sure that self._client config is built, even if it doesn't have
# any fields inside:
if self._client_config is None:
self._client_config = ClientConfig()
# Set up menus:
ui_path = "Edit/"
self.menu_contexts = []
self.menu_contexts.append(idaapi.add_menu_item(ui_path,
"FCatalog: Configure",
"",
0,
self._show_conf_form,
(None,)))
self.menu_contexts.append(idaapi.add_menu_item(ui_path,
"FCatalog: Commit Functions",
"",
0,
self._commit_funcs,
(None,)))
self.menu_contexts.append(idaapi.add_menu_item(ui_path,
"FCatalog: Find Similars",
"",
0,
self._find_similars,
(None,)))
self.menu_contexts.append(idaapi.add_menu_item(ui_path,
"FCatalog: Clean IDB",
"",
0,
self._clean_idb,
(None,)))
return idaapi.PLUGIN_KEEP