Ejemplo n.º 1
0
    def init(self):
        self.current_idx = -1
        self.hx_hook = None

        # Figure out the current decompiler
        for idx, plugin_id in enumerate(hx_switch_plugin_t.hx_alternatives):
            ptr = ida_plugins.find_plugin(plugin_id)
            if ptr:
                self.current_idx = idx
                print '[+] Current decompiler: [%d]: %s' % (idx,
                                                            repr(plugin_id))
                break
        else:
            print '[!] Default decompiler not found'
            return idaapi.PLUGIN_SKIP

        self.hx_hook = hx_switch_plugin_t.hx_hook_t()
        if not self.hx_hook.hook():
            print '[!] Decompiler hook failed'
            return idaapi.PLUGIN_SKIP

        # Now that we ensured that initialization was a success
        # Time to put in more branding info
        addon_info = idaapi.addon_info_t()
        addon_info.id = 'net.ezforever.hexrays.hx_switch'
        addon_info.name = hx_switch_plugin_t.wanted_name
        addon_info.producer = 'Eric Zhang (EZForever)'
        addon_info.version = '0.0.0'
        addon_info.url = 'https://github.com/EZForever'
        addon_info.freeform = 'This plugin is licensed under The Unlicense.'
        idaapi.register_addon(addon_info)

        # Keep us in memory since we need to hold the current state
        return idaapi.PLUGIN_KEEP
Ejemplo n.º 2
0
    def init(self):
        addon = idaapi.addon_info_t()
        addon.id = "milan.bohacek.api_palette"
        addon.name = "API Palette"
        addon.producer = "Milan Bohacek"
        addon.url = "*****@*****.**"
        addon.version = "7.00"
        idaapi.register_addon(addon)
        api_register_actions()

        return idaapi.PLUGIN_KEEP
Ejemplo n.º 3
0
    def init(self):
        addon = idaapi.addon_info_t()
        addon.id = "milan.bohacek.command_palette"
        addon.name = "Command Palette"
        addon.producer = "Milan Bohacek"
        addon.url = "*****@*****.**"
        addon.version = "6.95"
        idaapi.register_addon(addon)
        register_actions()

        return idaapi.PLUGIN_KEEP
Ejemplo n.º 4
0
    def init(self):
        self._hook = Hooks()
        self._hook.hook()

        addon = idaapi.addon_info_t()
        addon.id = "naim94a.oss.rebasedcomment"
        addon.url = "https://abda.nl/?rebasedcomment"
        addon.version = __version__
        addon.producer = "Naim A. <*****@*****.**>"
        addon.freeform = "Copyright (C) 2020 Naim A."
        addon.name = "RebasedComment"
        idaapi.register_addon(addon)
        return ida_idaapi.PLUGIN_KEEP
Ejemplo n.º 5
0
    def init(self):
        idaapi.msg('[*] Pwndbg XML RPC plugin loaded.\n')

        if idaapi.init_hexrays_plugin():
            addon = idaapi.addon_info_t()
            addon.id = "com.pwndbg.pwndbg"
            addon.name = "Pwndbg XML RPC"
            addon.producer = "pwndbg"
            addon.url = "https://github.com/pwndbg/pwndbg"
            addon.version = "1.0.0.0"
            idaapi.register_addon(addon)

        self.pwndbgRPC = PwndbgRPC()

        return idaapi.PLUGIN_KEEP
Ejemplo n.º 6
0
    def init(self):
        # Some initialization
        global hexnight_cb_info, hexnight_cb, inttype

        if idaapi.init_hexrays_plugin() and idaapi.ph_get_id() == idaapi.PLFM_ARM:
            inttype = idaapi.get_int_type_by_width_and_sign(4, True)
            hexnight_cb_info = hexrays_callback_info()
            hexnight_cb = hexnight_cb_info.event_callback
            if idaapi.install_hexrays_callback(hexnight_cb):
                print "Hexnight plugin installed"
                addon = idaapi.addon_info_t();
                addon.id = "org.xerub.hexnight";
                addon.name = "Hexnight";
                addon.producer = "xerub";
                addon.url = "https://twitter.com/xerub";
                addon.version = "7.0";
                idaapi.register_addon( addon );
                return idaapi.PLUGIN_KEEP
        print "Hexnight plugin failed"
        return idaapi.PLUGIN_SKIP
Ejemplo n.º 7
0
    def init(self):
        # Some initialization
        global hexlight_cb_info, hexlight_cb

        if idaapi.init_hexrays_plugin():
            hexlight_cb_info = hexrays_callback_info()
            hexlight_cb = hexlight_cb_info.event_callback
            if not idaapi.install_hexrays_callback(hexlight_cb):
                #    print "could not install hexrays_callback"
                return idaapi.PLUGIN_SKIP
            print("Hexlight plugin installed")
            addon = idaapi.addon_info_t()
            addon.id = "milan.bohacek.hexlight"
            addon.name = "Hexlight"
            addon.producer = "Milan Bohacek"
            addon.url = "*****@*****.**"
            addon.version = "6.95"
            idaapi.register_addon(addon)
            return idaapi.PLUGIN_KEEP
        #print "init_hexrays_plugin failed"
        return idaapi.PLUGIN_SKIP
Ejemplo n.º 8
0
    def init(self):
        # Some initialization
        global hexnight_cb_info, hexnight_cb, inttype

        if idaapi.init_hexrays_plugin() and idaapi.ph_get_id(
        ) == idaapi.PLFM_ARM and idaapi.BADADDR > 0xFFFFFFFF:
            inttype = idaapi.get_int_type_by_width_and_sign(4, True)
            enu = idaapi.add_enum(0, myenum, 0)
            for i in regs.keys():
                idaapi.add_enum_member(enu, regs[i], i)
            hexnight_cb_info = hexrays_callback_info()
            hexnight_cb = hexnight_cb_info.event_callback
            if idaapi.install_hexrays_callback(hexnight_cb):
                print "Hexnight plugin installed"
                addon = idaapi.addon_info_t()
                addon.id = "org.xerub.hexnight"
                addon.name = "Hexnight"
                addon.producer = "xerub"
                addon.url = "https://twitter.com/xerub"
                addon.version = "6.95"
                idaapi.register_addon(addon)
                return idaapi.PLUGIN_KEEP
        print "Hexnight plugin failed"
        return idaapi.PLUGIN_SKIP
Ejemplo n.º 9
0
    def init(self):
        self.hexrays_inited = False
        self.registered_actions = []
        self.registered_hx_actions = []

        global ARCH
        global BITS
        ARCH = idaapi.ph_get_id()
        info = idaapi.get_inf_structure()
        if info.is_64bit():
            BITS = 64
        elif info.is_32bit():
            BITS = 32
        else:
            BITS = 16

        print("LazyIDA (v1.0.0.3) plugin has been loaded.")

        # Register menu actions
        menu_actions = (
            idaapi.action_desc_t(ACTION_CONVERT[0], "Convert to string", menu_action_handler_t(ACTION_CONVERT[0]), None, None, 80),
            idaapi.action_desc_t(ACTION_CONVERT[1], "Convert to hex string", menu_action_handler_t(ACTION_CONVERT[1]), None, None, 8),
            idaapi.action_desc_t(ACTION_CONVERT[2], "Convert to C/C++ array (BYTE)", menu_action_handler_t(ACTION_CONVERT[2]), None, None, 38),
            idaapi.action_desc_t(ACTION_CONVERT[3], "Convert to C/C++ array (WORD)", menu_action_handler_t(ACTION_CONVERT[3]), None, None, 38),
            idaapi.action_desc_t(ACTION_CONVERT[4], "Convert to C/C++ array (DWORD)", menu_action_handler_t(ACTION_CONVERT[4]), None, None, 38),
            idaapi.action_desc_t(ACTION_CONVERT[5], "Convert to C/C++ array (QWORD)", menu_action_handler_t(ACTION_CONVERT[5]), None, None, 38),
            idaapi.action_desc_t(ACTION_CONVERT[6], "Convert to python list (BYTE)", menu_action_handler_t(ACTION_CONVERT[6]), None, None, 201),
            idaapi.action_desc_t(ACTION_CONVERT[7], "Convert to python list (WORD)", menu_action_handler_t(ACTION_CONVERT[7]), None, None, 201),
            idaapi.action_desc_t(ACTION_CONVERT[8], "Convert to python list (DWORD)", menu_action_handler_t(ACTION_CONVERT[8]), None, None, 201),
            idaapi.action_desc_t(ACTION_CONVERT[9], "Convert to python list (QWORD)", menu_action_handler_t(ACTION_CONVERT[9]), None, None, 201),
            idaapi.action_desc_t(ACTION_XORDATA, "Get xored data", menu_action_handler_t(ACTION_XORDATA), None, None, 9),
            idaapi.action_desc_t(ACTION_FILLNOP, "Fill with NOPs", menu_action_handler_t(ACTION_FILLNOP), None, None, 9),
            idaapi.action_desc_t(ACTION_SCANVUL, "Scan format string vulnerabilities", menu_action_handler_t(ACTION_SCANVUL), None, None, 160),
        )
        for action in menu_actions:
            idaapi.register_action(action)
            self.registered_actions.append(action.name)

        # Register hotkey actions
        hotkey_actions = (
            idaapi.action_desc_t(ACTION_COPYEA, "Copy EA", hotkey_action_handler_t(ACTION_COPYEA), "w", "Copy current EA", 0),
            idaapi.action_desc_t(ACTION_GOTOCLIP, "Goto clip EA", hotkey_action_handler_t(ACTION_GOTOCLIP), "Shift-G", "Goto clipboard EA", 0),
        )
        for action in hotkey_actions:
            idaapi.register_action(action)
            self.registered_actions.append(action.name)

        # Add ui hook
        self.ui_hook = UI_Hook()
        self.ui_hook.hook()

        # Add hexrays ui callback
        if idaapi.init_hexrays_plugin():
            addon = idaapi.addon_info_t()
            addon.id = "tw.l4ys.lazyida"
            addon.name = "LazyIDA"
            addon.producer = "Lays"
            addon.url = "https://github.com/L4ys/LazyIDA"
            addon.version = "1.0.0.3"
            idaapi.register_addon(addon)

            hx_actions = (
                idaapi.action_desc_t(ACTION_HX_REMOVERETTYPE, "Remove return type", hexrays_action_handler_t(ACTION_HX_REMOVERETTYPE), "v"),
                idaapi.action_desc_t(ACTION_HX_COPYEA, "Copy ea", hexrays_action_handler_t(ACTION_HX_COPYEA), "w"),
                idaapi.action_desc_t(ACTION_HX_COPYNAME, "Copy name", hexrays_action_handler_t(ACTION_HX_COPYNAME), "c"),
                idaapi.action_desc_t(ACTION_HX_GOTOCLIP, "Goto clipboard ea", hexrays_action_handler_t(ACTION_HX_GOTOCLIP), "Shift-G"),
            )
            for action in hx_actions:
                idaapi.register_action(action)
                self.registered_hx_actions.append(action.name)

            self.hx_hook = HexRays_Hook()
            idaapi.install_hexrays_callback(self.hx_hook.callback)
            self.hexrays_inited = True

        return idaapi.PLUGIN_KEEP
Ejemplo n.º 10
0
    def init(self):
        self.hexrays_inited = False
        self.registered_actions = []
        self.registered_hx_actions = []

        global ARCH
        global BITS
        ARCH = idaapi.ph_get_id()
        info = idaapi.get_inf_structure()
        if info.is_64bit():
            BITS = 64
        elif info.is_32bit():
            BITS = 32
        else:
            BITS = 16

        print "LazyIDA (v1.0.0.3) plugin has been loaded."

        # Register menu actions
        menu_actions = (
            idaapi.action_desc_t(ACTION_CONVERT[0], "Convert to string", menu_action_handler_t(ACTION_CONVERT[0]), None, None, 80),
            idaapi.action_desc_t(ACTION_CONVERT[1], "Convert to hex string", menu_action_handler_t(ACTION_CONVERT[1]), None, None, 8),
            idaapi.action_desc_t(ACTION_CONVERT[2], "Convert to C/C++ array (BYTE)", menu_action_handler_t(ACTION_CONVERT[2]), None, None, 38),
            idaapi.action_desc_t(ACTION_CONVERT[3], "Convert to C/C++ array (WORD)", menu_action_handler_t(ACTION_CONVERT[3]), None, None, 38),
            idaapi.action_desc_t(ACTION_CONVERT[4], "Convert to C/C++ array (DWORD)", menu_action_handler_t(ACTION_CONVERT[4]), None, None, 38),
            idaapi.action_desc_t(ACTION_CONVERT[5], "Convert to C/C++ array (QWORD)", menu_action_handler_t(ACTION_CONVERT[5]), None, None, 38),
            idaapi.action_desc_t(ACTION_CONVERT[6], "Convert to python list (BYTE)", menu_action_handler_t(ACTION_CONVERT[6]), None, None, 201),
            idaapi.action_desc_t(ACTION_CONVERT[7], "Convert to python list (WORD)", menu_action_handler_t(ACTION_CONVERT[7]), None, None, 201),
            idaapi.action_desc_t(ACTION_CONVERT[8], "Convert to python list (DWORD)", menu_action_handler_t(ACTION_CONVERT[8]), None, None, 201),
            idaapi.action_desc_t(ACTION_CONVERT[9], "Convert to python list (QWORD)", menu_action_handler_t(ACTION_CONVERT[9]), None, None, 201),
            idaapi.action_desc_t(ACTION_XORDATA, "Get xored data", menu_action_handler_t(ACTION_XORDATA), None, None, 9),
            idaapi.action_desc_t(ACTION_FILLNOP, "Fill with NOPs", menu_action_handler_t(ACTION_FILLNOP), None, None, 9),
            idaapi.action_desc_t(ACTION_SCANVUL, "Scan format string vulnerabilities", menu_action_handler_t(ACTION_SCANVUL), None, None, 160),
        )
        for action in menu_actions:
            idaapi.register_action(action)
            self.registered_actions.append(action.name)

        # Register hotkey actions
        hotkey_actions = (
            idaapi.action_desc_t(ACTION_COPYEA, "Copy EA", hotkey_action_handler_t(ACTION_COPYEA), "w", "Copy current EA", 0),
        )
        for action in hotkey_actions:
            idaapi.register_action(action)
            self.registered_actions.append(action.name)

        # Add ui hook
        self.ui_hook = UI_Hook()
        self.ui_hook.hook()

        # Add hexrays ui callback
        if idaapi.init_hexrays_plugin():
            addon = idaapi.addon_info_t()
            addon.id = "tw.l4ys.lazyida"
            addon.name = "LazyIDA"
            addon.producer = "Lays"
            addon.url = "https://github.com/L4ys/LazyIDA"
            addon.version = "1.0.0.3"
            idaapi.register_addon(addon)

            hx_actions = (
                idaapi.action_desc_t(ACTION_HX_REMOVERETTYPE, "Remove return type", hexrays_action_handler_t(ACTION_HX_REMOVERETTYPE), "v"),
                idaapi.action_desc_t(ACTION_HX_COPYEA, "Copy ea", hexrays_action_handler_t(ACTION_HX_COPYEA), "w"),
                idaapi.action_desc_t(ACTION_HX_COPYNAME, "Copy name", hexrays_action_handler_t(ACTION_HX_COPYNAME), "c"),
            )
            for action in hx_actions:
                idaapi.register_action(action)
                self.registered_hx_actions.append(action.name)

            self.hx_hook = HexRays_Hook()
            idaapi.install_hexrays_callback(self.hx_hook.callback)
            self.hexrays_inited = True

        return idaapi.PLUGIN_KEEP
Ejemplo n.º 11
0
    def init(self):
        global LAZY_ARCH
        global LAZY_BITS
        LAZY_ARCH = idaapi.ph_get_id()
        info = idaapi.get_inf_structure()
        if info.is_64bit():
            LAZY_BITS = 64
        elif info.is_32bit():
            LAZY_BITS = 32
        else:
            LAZY_BITS = 16

        plg_print("v1.0.0.4 - plugin has been loaded.")

        # Register hotkey actions
        for HK_ACT in ALL_HOTKEY_ACTIONS:
            action = idaapi.action_desc_t(HK_ACT[0],    # name
                                          HK_ACT[1],    # label
                                          hotkey_action_handler_t(HK_ACT[0]), # action handler
                                          HK_ACT[2],    # shortcut
                                          HK_ACT[3],    # tooltip
                                          HK_ACT[4])    # iconid
            idaapi.register_action(action)
            self.registered_hotkey_actions.append(action.name)

        # Register menu actions
        menu_actions = (
            idaapi.action_desc_t(ACTION_MENU_CONVERT[0], "Convert to string", menu_action_handler_t(ACTION_MENU_CONVERT[0]), None, None, 80),
            idaapi.action_desc_t(ACTION_MENU_CONVERT[1], "Convert to hex string space", menu_action_handler_t(ACTION_MENU_CONVERT[1]), None, None, 8),
            idaapi.action_desc_t(ACTION_MENU_CONVERT[2], "Convert to C/C++ array (BYTE)", menu_action_handler_t(ACTION_MENU_CONVERT[2]), None, None, 38),
            idaapi.action_desc_t(ACTION_MENU_CONVERT[3], "Convert to C/C++ array (WORD)", menu_action_handler_t(ACTION_MENU_CONVERT[3]), None, None, 38),
            idaapi.action_desc_t(ACTION_MENU_CONVERT[4], "Convert to C/C++ array (DWORD)", menu_action_handler_t(ACTION_MENU_CONVERT[4]), None, None, 38),
            idaapi.action_desc_t(ACTION_MENU_CONVERT[5], "Convert to C/C++ array (QWORD)", menu_action_handler_t(ACTION_MENU_CONVERT[5]), None, None, 38),
            idaapi.action_desc_t(ACTION_MENU_CONVERT[6], "Convert to python list (BYTE)", menu_action_handler_t(ACTION_MENU_CONVERT[6]), None, None, 201),
            idaapi.action_desc_t(ACTION_MENU_CONVERT[7], "Convert to python list (WORD)", menu_action_handler_t(ACTION_MENU_CONVERT[7]), None, None, 201),
            idaapi.action_desc_t(ACTION_MENU_CONVERT[8], "Convert to python list (DWORD)", menu_action_handler_t(ACTION_MENU_CONVERT[8]), None, None, 201),
            idaapi.action_desc_t(ACTION_MENU_CONVERT[9], "Convert to python list (QWORD)", menu_action_handler_t(ACTION_MENU_CONVERT[9]), None, None, 201),
            idaapi.action_desc_t(ACTION_MENU_CONVERT[10], "Convert to MASM array (BYTE)", menu_action_handler_t(ACTION_MENU_CONVERT[10]), None, None, 38),
            idaapi.action_desc_t(ACTION_MENU_CONVERT[11], "Convert to GNU ASM array (BYTE)", menu_action_handler_t(ACTION_MENU_CONVERT[11]), None, None, 38),
            idaapi.action_desc_t(ACTION_MENU_COPY_DATA, "Copy hex data to clipboard", menu_action_handler_t(ACTION_MENU_COPY_DATA), None, None, 9),
            idaapi.action_desc_t(ACTION_MENU_DUMP_DATA, "Dump data to file", menu_action_handler_t(ACTION_MENU_DUMP_DATA), None, None, 0x1B),
            idaapi.action_desc_t(ACTION_MENU_XOR_DATA, "Get xored data", menu_action_handler_t(ACTION_MENU_XOR_DATA), None, None, 9),
            idaapi.action_desc_t(ACTION_MENU_FILL_NOP, "Fill with NOPs", menu_action_handler_t(ACTION_MENU_FILL_NOP), None, None, 9),
            idaapi.action_desc_t(ACTION_MENU_B64STD, "Base64Std decode", menu_action_handler_t(ACTION_MENU_B64STD), None, None, 9),
            idaapi.action_desc_t(ACTION_MENU_B64URL, "Base64Url decode", menu_action_handler_t(ACTION_MENU_B64URL), None, None, 9),
            idaapi.action_desc_t(ACTION_MENU_SCAN_VUL, "Scan format string vulnerabilities", menu_action_handler_t(ACTION_MENU_SCAN_VUL), None, None, 160),
        )
        for action in menu_actions:
            idaapi.register_action(action)
            self.registered_menu_actions.append(action.name)

        # Add ui hook
        self.ui_hook = UI_Hook()
        self.ui_hook.hook()

        # Add hexrays ui callback
        if idaapi.init_hexrays_plugin():
            hx_actions = (
                idaapi.action_desc_t(ACTION_HX_REMOVE_RET_TYPE[0],
                                     ACTION_HX_REMOVE_RET_TYPE[1],
                                     hexrays_action_handler_t(ACTION_HX_REMOVE_RET_TYPE[0]),
                                     ACTION_HX_REMOVE_RET_TYPE[2],
                                     ACTION_HX_REMOVE_RET_TYPE[3],
                                     -1),
            )
            for action in hx_actions:
                idaapi.register_action(action)
                self.registered_hexray_actions.append(action.name)

            self.hx_hook = HexRays_Hook()
            idaapi.install_hexrays_callback(self.hx_hook.callback)
            self.hexrays_inited = True

        addon = idaapi.addon_info_t()
        addon.id = "htc_lazyida"
        addon.name = "LazyIDA"
        addon.producer = "HTC (Original: Lays - tw.l4ys.lazyida)"
        addon.url = "https://github.com/HongThatCong/LazyIDA"
        addon.version = "1.0.0.5"
        idaapi.register_addon(addon)

        return idaapi.PLUGIN_KEEP