當前位置: 首頁>>代碼示例>>Python>>正文


Python idaapi.action_desc_t方法代碼示例

本文整理匯總了Python中idaapi.action_desc_t方法的典型用法代碼示例。如果您正苦於以下問題:Python idaapi.action_desc_t方法的具體用法?Python idaapi.action_desc_t怎麽用?Python idaapi.action_desc_t使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在idaapi的用法示例。


在下文中一共展示了idaapi.action_desc_t方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: init

# 需要導入模塊: import idaapi [as 別名]
# 或者: from idaapi import action_desc_t [as 別名]
def init(self):
        self._last_enum = ""

        self.rename_action_desc = idaapi.action_desc_t('AutoEnum:RenameImmediate',
                                                       'Rename immediate value',
                                                       RenameImmediateHandler(),
                                                       'Ctrl+Shift+M',
                                                       'Rename immediate value',
                                                       -1)
        idaapi.register_action(self.rename_action_desc)

        self.autoenum_action_desc = idaapi.action_desc_t('AutoEnum:AutoEnum',
                                                         'Automatically create enum',
                                                         AutoEnumHandler(),
                                                         'Shift+M',
                                                         'Automatically create enum',
                                                         -1)
        idaapi.register_action(self.autoenum_action_desc)

        return idaapi.PLUGIN_KEEP 
開發者ID:tmr232,項目名稱:Sark,代碼行數:22,代碼來源:autoenum.py

示例2: get_desc

# 需要導入模塊: import idaapi [as 別名]
# 或者: from idaapi import action_desc_t [as 別名]
def get_desc(cls):
        """Get a descriptor for this handler."""
        name = cls.get_name()
        text = cls.TEXT
        handler = cls()
        hotkey = cls.HOTKEY
        tooltip = cls.TOOLTIP
        icon = cls.ICON
        action_desc = idaapi.action_desc_t(
            name,
            text,
            handler,
            hotkey,
            tooltip,
            icon,
        )
        return action_desc 
開發者ID:tmr232,項目名稱:Sark,代碼行數:19,代碼來源:ui.py

示例3: _init_action_bulk

# 需要導入模塊: import idaapi [as 別名]
# 或者: from idaapi import action_desc_t [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" 
開發者ID:gaasedelen,項目名稱:prefix,代碼行數:22,代碼來源:ida_prefix.py

示例4: _init_action_clear

# 需要導入模塊: import idaapi [as 別名]
# 或者: from idaapi import action_desc_t [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" 
開發者ID:gaasedelen,項目名稱:prefix,代碼行數:22,代碼來源:ida_prefix.py

示例5: _init_action_recursive

# 需要導入模塊: import idaapi [as 別名]
# 或者: from idaapi import action_desc_t [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" 
開發者ID:gaasedelen,項目名稱:prefix,代碼行數:22,代碼來源:ida_prefix.py

示例6: registerAction

# 需要導入模塊: import idaapi [as 別名]
# 或者: from idaapi import action_desc_t [as 別名]
def registerAction(self):
        action_desc = idaapi.action_desc_t(
        self.id,
        self.name,
        self,
		"",
        self.tooltip,
		self.icon
		)      
        if not idaapi.register_action(action_desc):
            return False
        if not idaapi.attach_action_to_menu(self.menuPath, self.id, 0):
            return False
        if not idaapi.attach_action_to_toolbar("AnalysisToolBar", self.id):
            return False
        return True 
開發者ID:sam-b,項目名稱:ida-scripts,代碼行數:18,代碼來源:neo4ida.py

示例7: register_menu_actions

# 需要導入模塊: import idaapi [as 別名]
# 或者: from idaapi import action_desc_t [as 別名]
def register_menu_actions(form):
    widget = form.GetWidget()
    for action in form.menu_actions:
        act_name = action.name
        if act_name != '-':
            act_name = "%s:%s" % (PLUGIN_NAME, action.name)
            idaapi.register_action(
                idaapi.action_desc_t(
                    act_name, 
                    action.title,
                    ActionHandler(form, action), 
                    action.shortcut, 
                    action.tooltip, 
                    action.icon
                )
            )
        if action.checkable is not None:
            idaapi.update_action_checkable(act_name, True)
            idaapi.update_action_checked(act_name, action.checkable)

        idaapi.attach_action_to_popup(widget, None, act_name)

# ----------------------------------------------------------------------- 
開發者ID:danigargu,項目名稱:deREferencing,代碼行數:25,代碼來源:actions.py

示例8: register_munu_actions

# 需要導入模塊: import idaapi [as 別名]
# 或者: from idaapi import action_desc_t [as 別名]
def register_munu_actions():
    act_registers = '%s:registers' % PLUGIN_NAME
    act1 = idaapi.action_desc_t(
        act_registers,
        REGS_WIDGET_TITLE,
        StartHandler(REGS_WIDGET_TITLE),
        'Alt-Shift-D',
        'Start plugin',
        122
    )
    idaapi.register_action(act1)
    idaapi.attach_action_to_menu(DBG_MENU_PATH, act_registers, idaapi.SETMENU_APP)

    act_stack = '%s:stack' % PLUGIN_NAME
    act2 = idaapi.action_desc_t(act_stack,
        STACK_WIDGET_TITLE,
        StartHandler(STACK_WIDGET_TITLE),
        'Alt-Shift-E',
        'Start plugin',
        122
    )
    idaapi.register_action(act2)
    idaapi.attach_action_to_menu(DBG_MENU_PATH, act_stack, idaapi.SETMENU_APP) 
開發者ID:danigargu,項目名稱:deREferencing,代碼行數:25,代碼來源:dereferencing.py

示例9: registerAction

# 需要導入模塊: import idaapi [as 別名]
# 或者: from idaapi import action_desc_t [as 別名]
def registerAction(self):
        action_desc = idaapi.action_desc_t(
            self.id,
            self.name,
            self,
            self.shortcut,
            self.tooltip,
            0
        )
        if not idaapi.register_action(action_desc):
            return False
        if not idaapi.attach_action_to_menu(self.menuPath, self.id, 0):
            return False
        return True 
開發者ID:FSecureLABS,項目名稱:win_driver_plugin,代碼行數:16,代碼來源:win_driver_plugin.py

示例10: register_dynamic_action

# 需要導入模塊: import idaapi [as 別名]
# 或者: from idaapi import action_desc_t [as 別名]
def register_dynamic_action(form, popup, description, handler):
    """Registers a new item in a popup which will trigger a function when selected""" 

    # Note the 'None' as action name (1st parameter).
    # That's because the action will be deleted immediately
    # after the context menu is hidden anyway, so there's
    # really no need giving it a valid ID.
    action = idaapi.action_desc_t(None, description, handler)
    idaapi.attach_dynamic_action_to_popup(form, popup, action, 'Driver Plugin/') 
開發者ID:FSecureLABS,項目名稱:win_driver_plugin,代碼行數:11,代碼來源:win_driver_plugin.py

示例11: _createContextActions

# 需要導入模塊: import idaapi [as 別名]
# 或者: from idaapi import action_desc_t [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 
開發者ID:AirbusCyber,項目名稱:grap,代碼行數:38,代碼來源:PatternGenerationWidget.py

示例12: init

# 需要導入模塊: import idaapi [as 別名]
# 或者: from idaapi import action_desc_t [as 別名]
def init(brutal_self):
        idaapi.unregister_action('Undo')
        idaapi.unregister_action('Redo')

        brutal_self.brutal_action_handler = BrutalActionHandler()
        brutal_action_desc = idaapi.action_desc_t('BRUTAL', 'BRUTAL IDA', brutal_self.brutal_action_handler, '',
                                                  'IDA', BRUTAL6_ICON)
        idaapi.register_action(brutal_action_desc)
        idaapi.create_toolbar('BRUTAL IDA', 'BRUTAL IDA')

        brutal_self.brutal_letter_handlers = []

        for brutal_letter in 'BRUTAL':
            brutal_letter_handler = BrutalLetterHandler()
            brutal_self.brutal_letter_handlers.append(brutal_letter_handler)

            brutal_label = 'BRUTAL {}'.format(brutal_letter)
            brutal_letter_desc = idaapi.action_desc_t(brutal_label,
                                                      brutal_label,
                                                      brutal_letter_handler,
                                                      '',
                                                      brutal_letter,
                                                      BRUTAL_LETTERS[brutal_letter])
            idaapi.register_action(brutal_letter_desc)
            idaapi.attach_action_to_toolbar('BRUTAL IDA', brutal_label)

        idaapi.attach_action_to_toolbar('BRUTAL IDA', 'BRUTAL')

        brutal_self.brutal_hotkey = idaapi.add_hotkey('Ctrl+Z', brutal_self.dispatch_brutality)

        return idaapi.PLUGIN_KEEP 
開發者ID:tmr232,項目名稱:BRUTAL-IDA,代碼行數:33,代碼來源:brutal_ida.py

示例13: add_menus

# 需要導入模塊: import idaapi [as 別名]
# 或者: from idaapi import action_desc_t [as 別名]
def add_menus(self):
        # To avoid creating multiple plugin_t instances
        this = self
        class StartHandler(idaapi.action_handler_t):
            def __init__(self):
                idaapi.action_handler_t.__init__(self)
                
            def activate(self, ctx):
                this.run()
                return 1

            def update(self, ctx):
                return idaapi.AST_ENABLE_ALWAYS

        act_name = '%s:start' % PLUGNAME
        act_desc = idaapi.action_desc_t(
            act_name,       # The action name. Must be unique
            PLUGNAME,       # Action Text
            StartHandler(), # Action handler
            None,           # Optional shortcut
            'Start plugin', # Action tooltip
            122             # Icon
        )
        idaapi.register_action(act_desc)
        idaapi.attach_action_to_menu(
            'Debugger/Debugger windows/',
            act_name,
            idaapi.SETMENU_APP
        ) 
開發者ID:danigargu,項目名稱:heap-viewer,代碼行數:31,代碼來源:heap_viewer.py

示例14: add_menu_item_helper

# 需要導入模塊: import idaapi [as 別名]
# 或者: from idaapi import action_desc_t [as 別名]
def add_menu_item_helper(self, name, text, tooltip, handler, icon, shortcut):
        description = idaapi.action_desc_t(name, text, handler, shortcut, tooltip, icon)
        idaapi.register_action(description)
        idaapi.attach_action_to_menu("DIE/" + text, name, idaapi.SETMENU_APP)

        self._menus_names.append(name) 
開發者ID:ynvb,項目名稱:DIE,代碼行數:8,代碼來源:DIE.py

示例15: init

# 需要導入模塊: import idaapi [as 別名]
# 或者: from idaapi import action_desc_t [as 別名]
def init(self):
        self.lines = set()
        self.settings = IDASettings('HighlightCalls')
        try:
            self.set_color(self.settings['color'])
        except KeyError:
            self.settings.user['color'] = HIGHLIGHT_COLOR
            self.set_color(HIGHLIGHT_COLOR)
        self.ui_hooks = UiHooks(self.lines)

        self.toggle_action_desc = idaapi.action_desc_t('HighlightCalls:Toggle',
                                                       'Toggle call highlighting',
                                                       ToggleHighlightHandler(self.enable_highlights,
                                                                              self.disable_highlights),
                                                       '',
                                                       'Toggle call highlighting',
                                                       -1)
        idaapi.register_action(self.toggle_action_desc)

        self.color_selector = idaapi.action_desc_t('HighlightCalls:SelectColor',
                                                   'Select highlight color',
                                                   SelectColorHandler(set_color=self.set_color),
                                                   '',
                                                   'Select highlight color',
                                                   -1)
        idaapi.register_action(self.color_selector)

        idaapi.attach_action_to_menu('View/', self.toggle_action_desc.name, idaapi.SETMENU_APP)
        idaapi.attach_action_to_menu('View/', self.color_selector.name, idaapi.SETMENU_APP)

        return idaapi.PLUGIN_KEEP 
開發者ID:tmr232,項目名稱:Sark,代碼行數:33,代碼來源:highlight_calls.py


注:本文中的idaapi.action_desc_t方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。