Ejemplo n.º 1
0
    def register_actions(self):
        toolbar_name, menupath = self.name, self.name
        idaapi.create_toolbar(toolbar_name, self.name)
        idaapi.create_menu(menupath, self.name, "Help")

        UIManager.ActionHandler(self.name, self.name).register_action(self.binaryai_callback, toolbar_name)
        action = UIManager.ActionHandler("BinaryAI:About", "About", "")
        action.register_action(self.binaryai_callback, menupath=menupath)
        action = UIManager.ActionHandler("BinaryAI:RetrieveFunction", "Retrieve function", "Ctrl+Shift+d", icon=99)
        action.register_action(self.retrieve_callback, toolbar_name, menupath)
        action = UIManager.ActionHandler("BinaryAI:UploadFunction", "Upload function", "", icon=97)
        action.register_action(self.upload_callback, toolbar_name, menupath)
        action = UIManager.ActionHandler("BinaryAI:MatchAll", "Match all functions", "", icon=188)
        action.register_action(self.match_all_callback, toolbar_name, menupath)
        action = UIManager.ActionHandler("BinaryAI:UploadAll", "Upload all functions", "", icon=88)
        action.register_action(self.upload_all_callback, toolbar_name, menupath)

        apply_action = UIManager.ActionHandler("BinaryAI:Apply", "Apply")
        apply_action.register_action(self.apply_callback)

        match_action = UIManager.ActionHandler("BinaryAI:MatchSelected", "Match")
        upload_action = UIManager.ActionHandler("BinaryAI:UploadSelected", "Upload")
        revert_action = UIManager.ActionHandler("BinaryAI:RevertSelected", "Revert")
        if match_action.register_action(self.selected_callback) and \
                upload_action.register_action(self.selected_callback) and \
                revert_action.register_action(self.selected_callback):
            self.hooks.hook()
            return True
        return False
Ejemplo n.º 2
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
Ejemplo n.º 3
0
 def register_actions(self):
     toolbar_name, menupath = self.name, self.name
     idaapi.create_toolbar(toolbar_name, self.name)
     idaapi.create_menu(menupath, self.name, "Help")
     action1 = UIManager.ActionHandler(self.name, self.name)
     action2 = UIManager.ActionHandler("BinaryAI:RetrieveFunction", "Retrieve function", "Ctrl+Shift+d", icon=199)
     action3 = UIManager.ActionHandler("BinaryAI:RetrieveAll", "Retrieve all functions", "", icon=188)
     action4 = UIManager.ActionHandler("BinaryAI:RetrieveSelected", "Retrieve")
     if action1.register_action(self.mgr.binaryai_callback, toolbar_name) and \
         action2.register_action(self.mgr.retrieve_function_callback, toolbar_name, menupath) and \
             action3.register_action(self.mgr.retrieve_all_callback, toolbar_name, menupath) and \
             action4.register_action(self.retrieve_selected_callback):
         self.hooks.hook()
         return True
     return False
Ejemplo n.º 4
0
    def init(self):
        self.handler = SyncHandler()

        self.toolbar_name = 'DebugToolBar'

        try:
            if idaapi.create_toolbar('Ret-Sync', 'Ret-Sync'):
                self.toolbar_name = 'Ret-Sync'
        except AttributeError:
            # Can't create own toolbar. Probably older version of IDA. Never-mind.
            pass

        action_desc = idaapi.action_desc_t(SYNC_ACTION_NAME, 'Ret-Sync',
                                           self.handler, '',
                                           'Enable/Disable Debugger Sync',
                                           SYNC_OFF_ICON)
        idaapi.register_action(action_desc)
        idaapi.attach_action_to_toolbar(self.toolbar_name, SYNC_ACTION_NAME)
        return idaapi.PLUGIN_KEEP