Exemplo n.º 1
0
 def __del__(self):
     try:
         super(IDAAction, self).__del__()
         if self._icon:
             ida_kernwin.free_custom_icon(self._icon)
     except AttributeError:
         pass
Exemplo n.º 2
0
    def _uninstall_action(self, action, icon_id=ida_idaapi.BADADDR):

        result = ida_kernwin.unregister_action(action)
        if not result:
            logger.warning(f"Failed to unregister {action}...")
            return False

        if icon_id != ida_idaapi.BADADDR:
            ida_kernwin.free_custom_icon(icon_id)

        logger.info(f"Uninstalled the {action} menu entry")
        return True
Exemplo n.º 3
0
    def uninstall(self):
        # Detach the action from the chosen menu
        result = ida_kernwin.detach_action_from_menu(self._menu,
                                                     self._ACTION_ID)
        if not result:
            return False

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

        # Free the custom icon using its id
        ida_kernwin.free_custom_icon(self._icon_id)
        self._icon_id = ida_idaapi.BADADDR

        self._plugin.logger.debug("Uninstalled the action")
        return True