Python idaapi.install_hexrays_callback() Examples

The following are 5 code examples of idaapi.install_hexrays_callback(). 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: ida_painter.py    From lighthouse with MIT License 6 votes vote down vote up
def _notify_status_changed(self, status):

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

        # send the status changed signal...
        super(IDAPainter, self)._notify_status_changed(status)

    #------------------------------------------------------------------------------
    # Paint Actions
    #------------------------------------------------------------------------------ 
Example #2
Source File: stack_strings_helper.py    From flare-ida with Apache License 2.0 6 votes vote down vote up
def main():
    show_banner()

    print "Unregistering old action..."
    ida_kernwin.unregister_action(ACTION_NAME)

    if ida_hexrays.init_hexrays_plugin():
        ida_kernwin.register_action(
            ida_kernwin.action_desc_t(
                ACTION_NAME,
                "Keep sanity (stack strings)",
                stack_strings_ah_t(),
                None))

        print "Registered new action"

        idaapi.install_hexrays_callback(cb)

    else:
        print "[x] No decompiler found!"
        return 
Example #3
Source File: ida_prefix.py    From prefix with MIT License 5 votes vote down vote up
def _init_hexrays_hooks(self):
        """
        Install Hex-Rrays hooks (when available).

        NOTE: This is called when the ui_ready_to_run event fires.
        """
        if idaapi.init_hexrays_plugin():
            idaapi.install_hexrays_callback(self._hooks.hxe_callback)

    #--------------------------------------------------------------------------
    # IDA Actions
    #-------------------------------------------------------------------------- 
Example #4
Source File: hexrays.py    From bap-ida-python with MIT License 5 votes vote down vote up
def init(self):
        """
        Ensure plugin's line modification function is called whenever needed.

        If Hex-Rays is not installed, or is not initialized yet, then plugin
        will not load. To ensure that the plugin loads after Hex-Rays, please
        name your plugin's .py file with a name that starts lexicographically
        after "hexx86f"
        """
        try:
            if idaapi.init_hexrays_plugin():
                def hexrays_event_callback(event, *args):
                    if event == idaapi.hxe_refresh_pseudocode:
                        # We use this event instead of hxe_text_ready because
                        #   MacOSX doesn't seem to work well with it
                        # TODO: Look into this
                        vu, = args
                        self.visit_func(vu.cfunc)
                    return 0
                idaapi.install_hexrays_callback(hexrays_event_callback)
            else:
                return idaapi.PLUGIN_SKIP
        except AttributeError:
            idc.Warning('''init_hexrays_plugin() not found.
            Skipping Hex-Rays plugin.''')
        return idaapi.PLUGIN_KEEP 
Example #5
Source File: find_get_proc_address.py    From flare-ida with Apache License 2.0 5 votes vote down vote up
def main():
    if not idaapi.init_hexrays_plugin():
        return False

    print "Hex-rays version %s has been detected" % idaapi.get_hexrays_version()
    idaapi.install_hexrays_callback(event_callback)