我们从Python开源项目中,提取了以下4个代码示例,用于说明如何使用idaapi.AST_ENABLE_ALWAYS。
def update(self, ctx): """ Ensure the context menu is always available in IDA. """ return idaapi.AST_ENABLE_ALWAYS #------------------------------------------------------------------------------ # Plugin Util #------------------------------------------------------------------------------
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)
def update(self, ctx): return idaapi.AST_ENABLE_ALWAYS # 2) Describe the action