本文整理汇总了Python中idaapi.load_custom_icon方法的典型用法代码示例。如果您正苦于以下问题:Python idaapi.load_custom_icon方法的具体用法?Python idaapi.load_custom_icon怎么用?Python idaapi.load_custom_icon使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类idaapi
的用法示例。
在下文中一共展示了idaapi.load_custom_icon方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: load_icon
# 需要导入模块: import idaapi [as 别名]
# 或者: from idaapi import load_custom_icon [as 别名]
def load_icon(self, icon_filename, icon_key_name):
"""
Load a single custom icon
@param icon_filename: Icon file name
@param icon_key_name: The key value to store the icon with in the icon_list.
"""
try:
icons_path = self.die_config.icons_path
icon_filename = os.path.join(icons_path, icon_filename)
icon_num = idaapi.load_custom_icon(icon_filename)
self.icon_list[icon_key_name.lower()] = icon_num
return True
except Exception as ex:
self.logger.error("Failed to load icon %s: %s", icon_filename, ex)
return False
示例2: _init_action_bulk
# 需要导入模块: import idaapi [as 别名]
# 或者: from idaapi import load_custom_icon [as 别名]
def _init_action_bulk(self):
"""
Register the bulk prefix action with IDA.
"""
# load the icon for this action
self._bulk_icon_id = idaapi.load_custom_icon(plugin_resource("bulk.png"))
# describe the action
action_desc = idaapi.action_desc_t(
self.ACTION_BULK, # The action name.
"Prefix selected functions", # The action text.
IDACtxEntry(bulk_prefix), # The action handler.
None, # Optional: action shortcut
"Assign a user prefix to the selected functions", # Optional: tooltip
self._bulk_icon_id # Optional: the action icon
)
# register the action with IDA
assert idaapi.register_action(action_desc), "Action registration failed"
示例3: _init_action_clear
# 需要导入模块: import idaapi [as 别名]
# 或者: from idaapi import load_custom_icon [as 别名]
def _init_action_clear(self):
"""
Register the clear prefix action with IDA.
"""
# load the icon for this action
self._clear_icon_id = idaapi.load_custom_icon(plugin_resource("clear.png"))
# describe the action
action_desc = idaapi.action_desc_t(
self.ACTION_CLEAR, # The action name.
"Clear prefixes", # The action text.
IDACtxEntry(clear_prefix), # The action handler.
None, # Optional: action shortcut
"Clear user prefixes from the selected functions", # Optional: tooltip
self._clear_icon_id # Optional: the action icon
)
# register the action with IDA
assert idaapi.register_action(action_desc), "Action registration failed"
示例4: _init_action_recursive
# 需要导入模块: import idaapi [as 别名]
# 或者: from idaapi import load_custom_icon [as 别名]
def _init_action_recursive(self):
"""
Register the recursive rename action with IDA.
"""
# load the icon for this action
self._recursive_icon_id = idaapi.load_custom_icon(plugin_resource("recursive.png"))
# describe the action
action_desc = idaapi.action_desc_t(
self.ACTION_RECURSIVE, # The action name.
"Recursive function prefix", # The action text.
IDACtxEntry(recursive_prefix_cursor), # The action handler.
None, # Optional: action shortcut
"Recursively prefix callees of this function", # Optional: tooltip
self._recursive_icon_id # Optional: the action icon
)
# register the action with IDA
assert idaapi.register_action(action_desc), "Action registration failed"
示例5: _createContextActions
# 需要导入模块: import idaapi [as 别名]
# 或者: from idaapi import load_custom_icon [as 别名]
def _createContextActions(self):
actions = [
("grap:pg:set_root", None, "[grap] Set root node", self._onSetRootNode),
("grap:pg:add_target", None, "[grap] Add target node", self._onAddTargetNode),
("grap:pg:match_default", config['icons_path'] + "icons8-asterisk-24.png", "[grap] Default match (apply options)", self._onSetMatchDefault),
("grap:pg:match_full", None, "[grap] Full match", self._onSetMatchFull),
("grap:pg:match_opcode_arg1", None, "[grap] Opcode+arg1", self._onSetMatchOpcodeArg1),
("grap:pg:match_opcode_arg2", None, "[grap] Opcode+arg2", self._onSetMatchOpcodeArg2),
("grap:pg:match_opcode_arg3", None, "[grap] Opcode+arg3", self._onSetMatchOpcodeArg3),
("grap:pg:match_opcode", None, "[grap] Opcode", self._onSetMatchOpcode),
("grap:pg:match_wildcard", None, "[grap] Wildcard: *", self._onSetMatchWildcard),
("grap:pg:remove_target", config['icons_path'] + "icons8-delete.png", "[grap] Remove target node", self._onRemoveTargetNode)
]
for actionId, icon_path, text, method in (a for a in actions):
if icon_path is not None and icon_path != "":
icon_number = idaapi.load_custom_icon(icon_path)
# Describe the action
action_desc = idaapi.action_desc_t(
actionId, # The action name. This acts like an ID and must be unique
text, # The action text.
PatternGenerationHandler(method), # The action handler.
None,
None,
icon_number)
else:
# Describe the action
action_desc = idaapi.action_desc_t(
actionId, # The action name. This acts like an ID and must be unique
text, # The action text.
PatternGenerationHandler(method)) # The action handler.
# Register the action
idaapi.register_action(action_desc)
self.actionsDefined = True
示例6: __init__
# 需要导入模块: import idaapi [as 别名]
# 或者: from idaapi import load_custom_icon [as 别名]
def __init__(self, cc):
idaapi.UI_Hooks.__init__(self)
self.cc = cc
self.selected_icon_number = idaapi.load_custom_icon(config['icons_path'] + "icons8-asterisk-24.png")
示例7: get_brutal_icon_path
# 需要导入模块: import idaapi [as 别名]
# 或者: from idaapi import load_custom_icon [as 别名]
def get_brutal_icon_path(brutal_icon_name):
return idaapi.load_custom_icon(os.path.join(os.path.dirname(__file__), 'BRUTAL-ICONS', brutal_icon_name))
示例8: _install_load_file
# 需要导入模块: import idaapi [as 别名]
# 或者: from idaapi import load_custom_icon [as 别名]
def _install_load_file(self):
"""
Install the 'File->Load->Code coverage file...' menu entry.
"""
# create a custom IDA icon
icon_path = plugin_resource(os.path.join("icons", "load.png"))
icon_data = open(icon_path, "rb").read()
self._icon_id_file = idaapi.load_custom_icon(data=icon_data)
# describe a custom IDA UI action
action_desc = idaapi.action_desc_t(
self.ACTION_LOAD_FILE, # The action name
"~C~ode coverage file...", # The action text
IDACtxEntry(self.interactive_load_file), # The action handler
None, # Optional: action shortcut
"Load individual code coverage file(s)", # Optional: tooltip
self._icon_id_file # Optional: the action icon
)
# register the action with IDA
result = idaapi.register_action(action_desc)
if not result:
RuntimeError("Failed to register load_file action with IDA")
# attach the action to the File-> dropdown menu
result = idaapi.attach_action_to_menu(
"File/Load file/", # Relative path of where to add the action
self.ACTION_LOAD_FILE, # The action ID (see above)
idaapi.SETMENU_APP # We want to append the action after ^
)
if not result:
RuntimeError("Failed action attach load_file")
logger.info("Installed the 'Code coverage file' menu entry")
示例9: _install_load_batch
# 需要导入模块: import idaapi [as 别名]
# 或者: from idaapi import load_custom_icon [as 别名]
def _install_load_batch(self):
"""
Install the 'File->Load->Code coverage batch...' menu entry.
"""
# create a custom IDA icon
icon_path = plugin_resource(os.path.join("icons", "batch.png"))
icon_data = open(icon_path, "rb").read()
self._icon_id_batch = idaapi.load_custom_icon(data=icon_data)
# describe a custom IDA UI action
action_desc = idaapi.action_desc_t(
self.ACTION_LOAD_BATCH, # The action name
"~C~ode coverage batch...", # The action text
IDACtxEntry(self.interactive_load_batch), # The action handler
None, # Optional: action shortcut
"Load and aggregate code coverage files", # Optional: tooltip
self._icon_id_batch # Optional: the action icon
)
# register the action with IDA
result = idaapi.register_action(action_desc)
if not result:
RuntimeError("Failed to register load_batch action with IDA")
# attach the action to the File-> dropdown menu
result = idaapi.attach_action_to_menu(
"File/Load file/", # Relative path of where to add the action
self.ACTION_LOAD_BATCH, # The action ID (see above)
idaapi.SETMENU_APP # We want to append the action after ^
)
if not result:
RuntimeError("Failed action attach load_batch")
logger.info("Installed the 'Code coverage batch' menu entry")
示例10: _install_open_coverage_xref
# 需要导入模块: import idaapi [as 别名]
# 或者: from idaapi import load_custom_icon [as 别名]
def _install_open_coverage_xref(self):
"""
Install the right click 'Coverage Xref' context menu entry.
"""
# create a custom IDA icon
icon_path = plugin_resource(os.path.join("icons", "batch.png"))
icon_data = open(icon_path, "rb").read()
self._icon_id_xref = idaapi.load_custom_icon(data=icon_data)
# describe a custom IDA UI action
action_desc = idaapi.action_desc_t(
self.ACTION_COVERAGE_XREF, # The action name
"Xrefs coverage sets...", # The action text
IDACtxEntry(self._pre_open_coverage_xref),# The action handler
None, # Optional: action shortcut
"List coverage sets containing this address", # Optional: tooltip
self._icon_id_xref # Optional: the action icon
)
# register the action with IDA
result = idaapi.register_action(action_desc)
if not result:
RuntimeError("Failed to register coverage_xref action with IDA")
self._ui_hooks.hook()
logger.info("Installed the 'Coverage Xref' menu entry")
示例11: _install_open_coverage_overview
# 需要导入模块: import idaapi [as 别名]
# 或者: from idaapi import load_custom_icon [as 别名]
def _install_open_coverage_overview(self):
"""
Install the 'View->Open subviews->Coverage Overview' menu entry.
"""
# create a custom IDA icon
icon_path = plugin_resource(os.path.join("icons", "overview.png"))
icon_data = open(icon_path, "rb").read()
self._icon_id_overview = idaapi.load_custom_icon(data=icon_data)
# describe a custom IDA UI action
action_desc = idaapi.action_desc_t(
self.ACTION_COVERAGE_OVERVIEW, # The action name
"~C~overage Overview", # The action text
IDACtxEntry(self.open_coverage_overview), # The action handler
None, # Optional: action shortcut
"Open database code coverage overview", # Optional: tooltip
self._icon_id_overview # Optional: the action icon
)
# register the action with IDA
result = idaapi.register_action(action_desc)
if not result:
RuntimeError("Failed to register open coverage overview action with IDA")
# attach the action to the View-> dropdown menu
result = idaapi.attach_action_to_menu(
"View/Open subviews/Hex dump", # Relative path of where to add the action
self.ACTION_COVERAGE_OVERVIEW, # The action ID (see above)
idaapi.SETMENU_INS # We want to insert the action before ^
)
if not result:
RuntimeError("Failed action attach to 'View/Open subviews' dropdown")
logger.info("Installed the 'Coverage Overview' menu entry")
示例12: init
# 需要导入模块: import idaapi [as 别名]
# 或者: from idaapi import load_custom_icon [as 别名]
def init( self ):
self.icon_id = idaapi.load_custom_icon( data = ReefConfig.PLUGIN_ICON_PNG,
format = "png" )
if self.icon_id == 0:
raise RuntimeError("Failed to load icon data!")
self.finder = XrefsFromFinder()
return idaapi.PLUGIN_KEEP
示例13: AddMenuElements
# 需要导入模块: import idaapi [as 别名]
# 或者: from idaapi import load_custom_icon [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"))
示例14: init
# 需要导入模块: import idaapi [as 别名]
# 或者: from idaapi import load_custom_icon [as 别名]
def init( self ):
self.icon_id = idaapi.load_custom_icon( data = ConfigStingray.PLUGIN_ICON_PNG,
format = "png" )
if self.icon_id == 0:
raise RuntimeError("Failed to load icon data!")
self.finder = StringFinder()
ConfigStingray.init()
return idaapi.PLUGIN_KEEP
示例15: __init__
# 需要导入模块: import idaapi [as 别名]
# 或者: from idaapi import load_custom_icon [as 别名]
def __init__(self, id, name, tooltip, menuPath, callback, icon):
idaapi.action_handler_t.__init__(self)
self.id = id
self.name = name
self.tooltip = tooltip
self.menuPath = menuPath
self.callback = callback
scriptPath = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
self.icon = idaapi.load_custom_icon(
scriptPath + "/" + "icon" + ".png"
)