plugin.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:continuum 作者: zyantific 项目源码 文件源码
def ui_init(self):
        """Initializes the plugins interface extensions."""
        # Register menu entry. 
        # @HR: I really preferred the pre-6.5 mechanic.
        zelf = self
        class MenuEntry(idaapi.action_handler_t):
            def activate(self, ctx):
                zelf.open_proj_creation_dialog()
                return 1

            def update(self, ctx):
                return idaapi.AST_ENABLE_ALWAYS

        action = idaapi.action_desc_t(
            'continuum_new_project',
            "New continuum project...",
            MenuEntry(),
        )
        idaapi.register_action(action)
        idaapi.attach_action_to_menu("File/Open...", 'continuum_new_project', 0)    

        # Alright, is an IDB loaded? Pretend IDB open event as we miss the callback
        # when it was loaded before our plugin was staged.
        if GetIdbPath():
            self.core.handle_open_idb(None, None)

        # Register hotkeys.
        idaapi.add_hotkey('Shift+F', self.core.follow_extern)

        # Sign up for events.
        self.core.project_opened.connect(self.create_proj_explorer)
        self.core.project_closing.connect(self.close_proj_explorer)
        self.core.client_created.connect(self.subscribe_client_events)

        # Project / client already open? Fake events.
        if self.core.project:
            self.create_proj_explorer(self.core.project)
        if self.core.client:
            self.subscribe_client_events(self.core.client)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号