Beispiel #1
0
 def _del_action_clear(self):
     """
     Delete the clear prefix action from IDA.
     """
     idaapi.unregister_action(self.ACTION_CLEAR)
     idaapi.free_custom_icon(self._clear_icon_id)
     self._clear_icon_id = idaapi.BADADDR
def unregister_menu_actions(form):
    for action in form.menu_actions:
        if action.name == "-":
            continue

        act_name = "%s:%s" % (PLUGIN_NAME, action.name)
        idaapi.unregister_action(act_name)
Beispiel #3
0
 def _del_action_recursive(self):
     """
     Delete the recursive rename action from IDA.
     """
     idaapi.unregister_action(self.ACTION_RECURSIVE)
     idaapi.free_custom_icon(self._recursive_icon_id)
     self._recursive_icon_id = idaapi.BADADDR
Beispiel #4
0
    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
Beispiel #5
0
 def _del_action_recursive(self):
     """
     Delete the recursive rename action from IDA.
     """
     idaapi.unregister_action(self.ACTION_RECURSIVE)
     idaapi.free_custom_icon(self._recursive_icon_id)
     self._recursive_icon_id = idaapi.BADADDR
Beispiel #6
0
 def _del_action_bulk(self):
     """
     Delete the bulk prefix action from IDA.
     """
     idaapi.unregister_action(self.ACTION_BULK)
     idaapi.free_custom_icon(self._bulk_icon_id)
     self._bulk_icon_id = idaapi.BADADDR
Beispiel #7
0
 def _del_action_clear(self):
     """
     Delete the clear prefix action from IDA.
     """
     idaapi.unregister_action(self.ACTION_CLEAR)
     idaapi.free_custom_icon(self._clear_icon_id)
     self._clear_icon_id = idaapi.BADADDR
Beispiel #8
0
    def term(self):
        if hasattr(self, "ui_hook"):
            self.ui_hook.unhook()

        # Unregister actions
        for action in self.registered_actions:
            idaapi.unregister_action(action)
Beispiel #9
0
    def remove_menus(self):
        if self.qtconsole_action is not None:
            remove_idaipython_menu()
            idaapi.unregister_action(self.qtconsole_action.name)

        for menu_item in self.menu_items:
            idaapi.del_menu_item(menu_item)
Beispiel #10
0
 def _del_action_bulk(self):
     """
     Delete the bulk prefix action from IDA.
     """
     idaapi.unregister_action(self.ACTION_BULK)
     idaapi.free_custom_icon(self._bulk_icon_id)
     self._bulk_icon_id = idaapi.BADADDR
Beispiel #11
0
 def term(self):
     if idaapi.IDA_SDK_VERSION >= 700:
         idaapi.detach_action_from_menu("Search/", "act:mipsrop")
         idaapi.unregister_action("act:mipsrop")
     else:
         idaapi.del_menu_item(self.menu_context)
     return None
Beispiel #12
0
    def destory():

        idaapi.unregister_action(ConfigStingray.ACTION_NAME)
        
        try:
            ConfigStingray.save()
        except IOError:
            logging.getLogger("Stingray").warning("Failed to write config file")
Beispiel #13
0
 def term(self):
     if idaapi.IDA_SDK_VERSION >= 700:
         idaapi.unregister_action(self.action_rizzo_loadfile)
         idaapi.unregister_action(self.action_rizzo_producefile)
     else:
         idaapi.del_menu_item(self.menu_context_load)
         idaapi.del_menu_item(self.menu_context_produce)
     return None
Beispiel #14
0
    def destory():

        idaapi.unregister_action(Config.ACTION_NAME)

        try:
            Config.save()
        except IOError:
            logging.warning("Failed to write config file")
Beispiel #15
0
 def uninstall(self):
     self.reset_all_colors()
     idaapi.remove_hexrays_callback(self.__handle)
     for action in self.actions:
         idaapi.unregister_action(action.name)
     for action in self.popactions:
         idaapi.unregister_action(action.name)
     self.actions = []
     self.popactions = []
Beispiel #16
0
    def close(self):
        self.YaCoUI.unhook()
        self.ida_hooks.unhook()
        ya.StopYatools()

        for menu_item in self.yaco_menus:
            name = menu_item[0]
            idaapi.detach_action_from_menu("Edit/YaTools/", name)
            idaapi.unregister_action(name)
Beispiel #17
0
def uninstall_ui_hooks():
    """
    Deregisters the context menu's send address action
    """
    idaapi.unregister_action(CONTEXT_MENU_ACTION_NAME)

    global g_ui_hooks
    if g_ui_hooks is not None:
        g_ui_hooks.unhook()
        g_ui_hooks = None
 def term(self):
     ALI_MSG("unloading!")
     if ALI_IDA_ACTION_API:
         if self.hooks is not None:
             self.hooks.unhook()
         idaapi.unregister_action(type(self).action_wfuncs_add_name)
         idaapi.unregister_action(type(self).action_wfuncs_del_name)
         idaapi.unregister_action(type(self).action_menu_annotate_name)
         idaapi.unregister_action(type(self).action_menu_loadpdb_name)
         idaapi.unregister_action(type(self).action_menu_retrypdb_name)
 def OnClose(self, form):
     '''
     OnClose event, overriden. Just unhook stuff.
     '''
     try:
         idaapi.unregister_action('pyrebox:show_funcs')
         idaapi.detach_action_from_menu(
             'Edit/PyREBox/Show function arguments...', 'pyrebox:show_funcs')
         self.hooks.is_closed = True
         pass
     except Exception:
         traceback.print_exc()
Beispiel #20
0
    def term(self):
        if idaapi.IDA_SDK_VERSION < 700:
            idaapi.del_menu_item(self.menu_context_load)
            idaapi.del_menu_item(self.menu_context_produce)
        else:
            idaapi.detach_action_from_menu('File/Load file/',
                                           'my:rizzoloadsig')
            idaapi.detach_action_from_menu('File/Produce file/',
                                           'my:rizzoproducesig')
            idaapi.unregister_action('my:rizzoloadsig')
            idaapi.unregister_action('my:rizzoproducesig')

        return None
Beispiel #21
0
    def term(self):

        if idaapi.IDA_SDK_VERSION >= 700:
            idaapi.unregister_action("rizzo_load")
            idaapi.unregister_action("rizzo_produce")

            # No need to call detach_action_from_menu(); it'll be
            # done automatically on destruction of the action.
        else:
            idaapi.del_menu_item(self.menu_context_load)
            idaapi.del_menu_item(self.menu_context_produce)

        return None
Beispiel #22
0
 def term(self):
     # IDA 7.x
     if idaapi.IDA_SDK_VERSION >= 700:
         if idaapi.unregister_action(action_alleycat_from) is None:
             print "Failed to unregister action."
         if idaapi.unregister_action(action_alleycat_to) is None:
             print "Failed to unregister action."
         if idaapi.unregister_action(action_alleycat_block) is None:
             print "Failed to unregister action."
     # IDA 6.x
     else:
         for context in self.menu_contexts:
             idaapi.del_menu_item(context)
     return None
Beispiel #23
0
    def OnClose(self, form):
        rs_debug("form close")
        self.smooth_kill()

        idaapi.unregister_action('hexrays_sync_toogle:action')
        idaapi.detach_action_from_toolbar("DebugToolBar",
                                          'hexrays_sync_toogle:action')

        idaapi.unregister_action('g_sync_toogle:action')
        idaapi.detach_action_from_toolbar("DebugToolBar",
                                          'g_sync_toogle:action')

        global SyncForm
        del SyncForm
Beispiel #24
0
    def term(self):
        if self.ui_hook:
            self.ui_hook.unhook()

        # Unregister actions
        for action in self.registered_actions:
            idaapi.unregister_action(action)

        if self.hexrays_inited:
            # Unregister hexrays actions
            for action in self.registered_hx_actions:
                idaapi.unregister_action(action)
            if self.hx_hook:
                idaapi.remove_hexrays_callback(self.hx_hook.callback)
            idaapi.term_hexrays_plugin()
Beispiel #25
0
    def term(self):
        if self.ui_hook:
            self.ui_hook.unhook()

        # Unregister actions
        for action in self.registered_actions:
            idaapi.unregister_action(action)

        if self.hexrays_inited:
            # Unregister hexrays actions
            for action in self.registered_hx_actions:
                idaapi.unregister_action(action)
            if self.hx_hook:
                idaapi.remove_hexrays_callback(self.hx_hook.callback)
            idaapi.term_hexrays_plugin()
Beispiel #26
0
def main():
    # Unregister previous action
    idaapi.detach_action_from_menu(
        'Edit/Other/', 'DronCode:GenerateClassRepresentationCxxAction')
    idaapi.unregister_action('DronCode:GenerateClassRepresentationCxxAction')

    # Register our action
    action_description = idaapi.action_desc_t(
        'DronCode:GenerateClassRepresentationCxxAction',
        'Generate C/C++ Class Defs', GenerateClassRepresentationAction())

    idaapi.register_action(action_description)
    idaapi.attach_action_to_menu(
        'Edit/Other/Toggle border',
        'DronCode:GenerateClassRepresentationCxxAction', idaapi.SETMENU_APP)
    print("Plugin registered!")
Beispiel #27
0
    def term(self):
        if hasattr(self, "ui_hook"):
            self.ui_hook.unhook()

        # Unregister actions
        for action in self.registered_actions:
            idaapi.unregister_action(action)

        if self.hexrays_inited:
            # Unregister hexrays actions
            for action in self.registered_hx_actions:
                idaapi.unregister_action(action)
            if self.hx_hook:
                idaapi.remove_hexrays_callback(self.hx_hook.callback)
            idaapi.term_hexrays_plugin()

        print("[LazyIDA] plugin terminated.")
Beispiel #28
0
    def term(self):
        if self.ui_hook:
            self.ui_hook.unhook()
            self.ui_hook = None

        # Unregister actions
        if self.registered_hotkey_actions:
            for action in self.registered_hotkey_actions:
                idaapi.unregister_action(action)
            del self.registered_hotkey_actions[:]

        if self.registered_menu_actions:
            for action in self.registered_menu_actions:
                idaapi.unregister_action(action)
            del self.registered_menu_actions[:]

        if self.hexrays_inited:
            if self.hx_hook:
                idaapi.remove_hexrays_callback(self.hx_hook.callback)
                self.hx_hook = None

            # Unregister hexrays actions
            if self.registered_hexray_actions:
                for action in self.registered_hexray_actions:
                    idaapi.unregister_action(action)
                del self.registered_hexray_actions[:]

            idaapi.term_hexrays_plugin()

        plg_print("plugin terminated")
Beispiel #29
0
 def term(self):
     ui_path = 'View/Graphs/'
     idaapi.detach_action_from_menu(ui_path, 'ac:from_many')
     idaapi.detach_action_from_menu(ui_path, 'ac:to_many')
     idaapi.detach_action_from_menu(ui_path, 'ac:to_current')
     idaapi.unregister_action('ac:from_many')
     idaapi.unregister_action('ac:to_many')
     idaapi.unregister_action('ac:to_current')
     return None
Beispiel #30
0
    def _uninstall_open_coverage_xref(self):
        """
        Remove the right click 'Coverage Xref' context menu entry.
        """
        self._ui_hooks.unhook()

        # unregister the action
        result = idaapi.unregister_action(self.ACTION_COVERAGE_XREF)
        if not result:
            return False

        # delete the entry's icon
        idaapi.free_custom_icon(self._icon_id_xref)
        self._icon_id_xref = idaapi.BADADDR

        logger.info("Uninstalled the 'Coverage Xref' menu entry")
Beispiel #31
0
def init_hooks(idausr):
    _setter = IdausrTemporarySetter(idausr)

    class ActionHandler(idaapi.action_handler_t):
        def __init__(self, handler):
            idaapi.action_handler_t.__init__(self)
            self.handler = handler

        def activate(self, ctx):
            with _setter:
                self.handler()

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

    for name, label, handler, before in _HOOKS:
        if idaapi.unregister_action(name):
            action = idaapi.action_desc_t(name, label, ActionHandler(handler))
            idaapi.register_action(action)
            idaapi.attach_action_to_menu(before, name, idaapi.SETMENU_INS)
    def _uninstall_load_batch(self):
        """
        Remove the 'File->Load file->Code coverage batch...' menu entry.
        """

        # remove the entry from the File-> menu
        result = idaapi.detach_action_from_menu("File/Load file/",
                                                self.ACTION_LOAD_BATCH)
        if not result:
            return False

        # unregister the action
        result = idaapi.unregister_action(self.ACTION_LOAD_BATCH)
        if not result:
            return False

        # delete the entry's icon
        idaapi.free_custom_icon(self._icon_id_batch)
        self._icon_id_batch = idaapi.BADADDR

        logger.info("Uninstalled the 'Code coverage batch' menu entry")
    def _uninstall_open_coverage_overview(self):
        """
        Remove the 'View->Open subviews->Coverage Overview' menu entry.
        """

        # remove the entry from the View-> menu
        result = idaapi.detach_action_from_menu("View/Open subviews/Hex dump",
                                                self.ACTION_COVERAGE_OVERVIEW)
        if not result:
            return False

        # unregister the action
        result = idaapi.unregister_action(self.ACTION_COVERAGE_OVERVIEW)
        if not result:
            return False

        # delete the entry's icon
        idaapi.free_custom_icon(self._icon_id_overview)
        self._icon_id_overview = idaapi.BADADDR

        logger.info("Uninstalled the 'Coverage Overview' menu entry")
Beispiel #34
0
    def uninstall(self):
        """
        Uninstall the action from the IDA UI.

        :return: did the uninstall succeed
        """
        # Detach the action from the chosen menu
        result = idaapi.detach_action_from_menu(self._menu, self._ACTION_ID)
        if not result:
            return False

        # Un-register the action using its id
        result = idaapi.unregister_action(self._ACTION_ID)
        if not result:
            return False

        # Free the custom icon using its id
        idaapi.free_custom_icon(self._iconId)
        self._iconId = idaapi.BADADDR

        logger.debug("Uninstalled the action")
        return True
Beispiel #35
0
    #
    # Instead, we can opt for a different method: attach our action on-the-fly,
    # when the popup for "IDA View-A" is being populated, right before
    # it is displayed.
    class Hooks(idaapi.UI_Hooks):
        def finish_populating_widget_popup(self, widget, popup):
            # We'll add our action to all "IDA View-*"s.
            # If we wanted to add it only to "IDA View-A", we could
            # also discriminate on the widget's title:
            #
            #  if idaapi.get_widget_title(widget) == "IDA View-A":
            #      ...
            #
            if idaapi.get_widget_type(widget) == idaapi.BWN_DISASM:
                idaapi.attach_action_to_popup(widget, popup, act_name, None)

    hooks = Hooks()
    hooks.hook()
else:
    print("Action found; unregistering.")
    # No need to call detach_action_from_menu(); it'll be
    # done automatically on destruction of the action.
    if idaapi.unregister_action(act_name):
        print("Unregistered.")
    else:
        print("Failed to unregister action.")

    if hooks is not None:
        hooks.unhook()
        hooks = None
Beispiel #36
0
 def term(self):
     self.disable_highlights()
     idaapi.unregister_action(self.toggle_action_desc.name)
     idaapi.unregister_action(self.color_selector.name)
Beispiel #37
0
 def term(self):
     idaapi.unregister_action(self.autoenum_action_desc.name)
     idaapi.unregister_action(self.rename_action_desc.name)
def main():  # type: () -> None
    existing = idaapi.unregister_action(ACTION_NAME)
    idaapi.register_action(
        idaapi.action_desc_t(ACTION_NAME, "Rename vtable",
                             rename_vtable_ah_t(), "F10"))
Beispiel #39
0
 def unregisterAction(self):
     idaapi.detach_action_from_menu(self.menuPath, self.id)
     idaapi.unregister_action(self.id)
Beispiel #40
0
 def unregister(cls):
     """Unregister the action.
     After unregistering the class cannot be used.
     """
     idaapi.unregister_action(cls.get_name())
 def unregisterAction(self):
     idaapi.detach_action_from_menu(self.menuPath, self.id)
     idaapi.detach_action_from_toolbar("SearchToolBar", self.id)
     idaapi.unregister_action(self.id)