Python idaapi.UI_Hooks() Examples

The following are 7 code examples of idaapi.UI_Hooks(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module idaapi , or try the search function .
Example #1
Source File: ui.py    From ida-minsc with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
def __start_ida__(cls):
        api = [
            ('idp', idaapi.IDP_Hooks),
            ('idb', idaapi.IDB_Hooks),
            ('ui', idaapi.UI_Hooks),
        ]

        # Create an alias so we save typing 19 chars..
        priorityhook = internal.interface.priorityhook
        for attr, hookcls in api:

            # Attach a priority hooking queue to an instance of IDA's hooks
            instance = priorityhook(hookcls)

            # Explicitly assign the priority instance into our object
            if not hasattr(cls, attr):
                setattr(cls, attr, instance)

            # Now we can enable all the hooks so the user can use them
            instance.hook()
        return 
Example #2
Source File: PatternGenerationWidget.py    From grap with MIT License 5 votes vote down vote up
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") 
Example #3
Source File: lca.py    From Sark with MIT License 5 votes vote down vote up
def idaview_hooks(idaview_handler):
    class Hooks(idaapi.UI_Hooks):
        def finish_populating_widget_popup(self, form, popup):
            if idaapi.get_widget_type(form) == idaapi.BWN_DISASM:
                idaapi.attach_action_to_popup(form, popup, idaview_handler.get_name(), "")

    return Hooks 
Example #4
Source File: LazyIDA.py    From LazyIDA with MIT License 5 votes vote down vote up
def __init__(self):
        idaapi.UI_Hooks.__init__(self) 
Example #5
Source File: util.py    From WatchDBG-IDA with MIT License 5 votes vote down vote up
def __init__(self):
        idaapi.UI_Hooks.__init__(self)
        
        self.popups = [] 
Example #6
Source File: drop.py    From DROP-IDA-plugin with GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, plugin):
        self.plugin = plugin
        idaapi.UI_Hooks.__init__(self) 
Example #7
Source File: installer.py    From IDABuddy with MIT License 5 votes vote down vote up
def _create_hooks(self, install_idabuddy):
        class InstallerUiHooks(idaapi.UI_Hooks):
            def updating_actions(self, ctx):
                if ctx.form_type == idaapi.BWN_DISASM:
                    ida_widget = form_to_widget(ctx.form)
                    idaview = ida_widget.children()[0]
                    install_idabuddy(idaview)
                return super(InstallerUiHooks, self).updating_actions(ctx)

        return InstallerUiHooks()