示例#1
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")
示例#2
0
def main():
    # dummy way to register action to unload hexrays-callback, thus it won't be triggered multiple times at once
    #
    __register_action(UnloadCallbackAction())
    # __register_action(ReloadScripts())

    if not idaapi.init_hexrays_plugin():
        print("Failed to initialize Hex-Rays SDK")
        return

    action = ShowScriptManager()
    idaapi.register_action(
        idaapi.action_desc_t(action.name, action.description, action,
                             action.hotkey))

    for cb in ida_hexrays.__cbhooks_t.instances:
        callback = cb.callback
        if callback.__dict__.get("__reload_helper", False):
            idaapi.remove_hexrays_callback(callback)

    print('Hooking for HexRays events')
    idaapi.install_hexrays_callback(herast_callback)

    storage_manager.load_all_storages()
    action_manager.initialize()
    hx_callback_manager.initialize()
示例#3
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 = []
示例#4
0
    def _notify_status_changed(self, status):

        # enable / disable hook based on the painter being enabled or disabled
        if status:
            self._idp_hooks.hook()
            if hexrays_available():
                idaapi.install_hexrays_callback(self._hxe_callback)
        else:
            self._idp_hooks.unhook()
            if hexrays_available():
                idaapi.remove_hexrays_callback(self._hxe_callback)

        # send the status changed signal...
        super(IDAPainter, self)._notify_status_changed(status)
示例#5
0
文件: LazyIDA.py 项目: L4ys/LazyIDA
    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()
示例#6
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()
 def run(self, arg_=None):
     if idaapi.remove_hexrays_callback(hx_callback):
         print "removed the callback"
     else:
         if idaapi.install_hexrays_callback(hx_callback):
             print "installed the callback"
         else:
             print "failed to install the callback"
示例#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)

        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.")
示例#9
0
def hr_remove():
    idaapi.remove_hexrays_callback(hexrays_events_callback_m)
 def finalize(self):
     print("remove hooks")
     idaapi.remove_hexrays_callback(self.__handle)
示例#11
0
 def disable(self):
     idaapi.remove_hexrays_callback(self.event_cb)
     self.enabled = False
示例#12
0
 def term(self):
     if self.inited:
         if not idaapi.remove_hexrays_callback(callback):
             log.warn("Failed to remove hexrays callback")
         idaapi.term_hexrays_plugin()
示例#13
0
 def finalize(self):
     idaapi.remove_hexrays_callback(self.__handle)
示例#14
0
 def term(self):
     if self.inited:
         idaapi.remove_hexrays_callback(callback)
         idaapi.term_hexrays_plugin()
示例#15
0
def unload_callback():
    try:
        return idaapi.remove_hexrays_callback(herast_callback)
    except:
        pass
示例#16
0
def remove():
    if hexlight_cb:
        idaapi.remove_hexrays_callback(hexlight_cb)
示例#17
0
 def unload(self):
     if self.installed:
         idaapi.remove_hexrays_callback(self.callback)
         self.installed = False