def get_idaview(title=None, form=None, widget=None): if form is not None: ida_widget = form_to_widget(form) elif widget is not None: ida_widget = widget else: ida_widget = get_widget(title) ida_holder = ida_widget.children()[0] idaview = ida_holder.children()[0] return idaview
def OnCreate(self, form): """ Called when the view is created """ self.data_parser = DataParser.getParser() self.ptable_widget = QtWidgets.QTreeWidget() # Get parent widget self.parent = form_to_widget(form) self._add_parser_data() layout = QtWidgets.QGridLayout() layout.addWidget(self.ptable_widget) self.parent.setLayout(layout)
def OnCreate(self, form): """ Called when the view is created """ self.die_db = DIE.Lib.DIEDb.get_db() self.function_view = DIE.UI.FunctionViewEx.get_view() # Get parent widget self.parent = form_to_widget(form) self.valueModel = QtGui.QStandardItemModel() self.valueTreeView = QtWidgets.QTreeView() self.valueTreeView.setExpandsOnDoubleClick(False) self.valueTreeView.doubleClicked.connect(self.itemDoubleClickSlot) self._model_builder(self.valueModel) self.valueTreeView.setModel(self.valueModel) # Toolbar self.value_toolbar = QtWidgets.QToolBar() # Value type combobox type_list = [] if self.die_db: type_list = self.die_db.get_all_value_types() type_list.insert(0, "All Values") self.value_type_combo = QtWidgets.QComboBox() self.value_type_combo.addItems(type_list) self.value_type_combo.activated[str].connect( self.on_value_type_combobox_change) self.value_type_label = QtWidgets.QLabel("Value Type: ") self.value_toolbar.addWidget(self.value_type_label) self.value_toolbar.addWidget(self.value_type_combo) # Layout layout = QtWidgets.QGridLayout() layout.addWidget(self.value_toolbar) layout.addWidget(self.valueTreeView) self.parent.setLayout(layout)
def OnCreate(self, form): """ Called when the view is created """ self.bp_tree_widget = QtWidgets.QTreeWidget() self.bp_handler = BpHandler.get_bp_handler() self.die_icons = DIE.UI.Die_Icons.get_die_icons() # Get parent widget self.parent = form_to_widget(form) self._add_parser_data() toolbar = QtWidgets.QToolBar() action_refresh = QtWidgets.QAction(self.die_icons.icon_refresh, "Refresh", toolbar) action_refresh.triggered.connect(self.refresh) toolbar.addAction(action_refresh) layout = QtWidgets.QGridLayout() layout.addWidget(toolbar) layout.addWidget(self.bp_tree_widget) self.parent.setLayout(layout)
def OnCreate(self, form): """ Called when the plugin form is created """ self.value_view = DIE.UI.ValueViewEx.get_view() self.bp_handler = DIE.Lib.BpHandler.get_bp_handler() self.die_icons = DIE.UI.Die_Icons.get_die_icons() self.die_db = DIE.Lib.DIEDb.get_db() # Get parent widget self.parent = form_to_widget(form) self.functionModel = QtGui.QStandardItemModel() self.functionTreeView = QtWidgets.QTreeView() self.functionTreeView.setExpandsOnDoubleClick(False) #self.functionTreeView.setSortingEnabled(True) delegate = TreeViewDelegate(self.functionTreeView) self.functionTreeView.setItemDelegate(delegate) self.functionTreeView.doubleClicked.connect(self.itemDoubleClickSlot) self._model_builder(self.functionModel) self.functionTreeView.setModel(self.functionModel) self.functionTreeView.setColumnWidth(0, 200) self.functionTreeView.setColumnWidth(1, 20) self.functionTreeView.setColumnWidth(2, 20) self.functionTreeView.setColumnWidth(3, 20) self.functionTreeView.setColumnWidth(4, 250) self.functionTreeView.setColumnWidth(5, 100) self.functionTreeView.setColumnWidth(6, 20) self.functionTreeView.setColumnWidth(7, 450) self.functionTreeView.setColumnWidth(8, 20) self.functionTreeView.setColumnWidth(9, 450) # Context menus self.functionTreeView.setContextMenuPolicy(QtCore.Qt.CustomContextMenu) self.functionTreeView.customContextMenuRequested.connect( self.onCustomContextMenu) # Actions self.context_menu_param = None # Parameter to be passed to context menu slots action_exclude_func = QtWidgets.QAction( "Exclude Function", self.functionTreeView, triggered=lambda: self.on_exclude_func(self.context_menu_param)) action_exclude_func_adrs = QtWidgets.QAction( "Exclude All Function Calls", self.functionTreeView, triggered=lambda: self.on_exclude_func_adrs(self.context_menu_param )) action_exclude_ea = QtWidgets.QAction( "Exclude Address", self.functionTreeView, triggered=lambda: self.on_exclude_ea(self.context_menu_param)) action_exclude_library = QtWidgets.QAction( "Exclude Library", self.functionTreeView, triggered=lambda: self.on_exclude_library(self.context_menu_param)) action_value_detail = QtWidgets.QAction( "Inspect Value Details", self.functionTreeView, triggered=lambda: self.on_value_detail(self.context_menu_param)) action_show_callgraph = QtWidgets.QAction( "Show Call-Graph", self.functionTreeView, triggered=lambda: self.on_show_callgraph(self.context_menu_param)) # Function ContextMenu self.function_context_menu = QtWidgets.QMenu(self.functionTreeView) self.function_context_menu.addAction(action_exclude_func) self.function_context_menu.addAction(action_exclude_library) self.function_context_menu.addAction(action_exclude_func_adrs) # Function ea ContextMenu self.ea_context_menu = QtWidgets.QMenu(self.functionTreeView) self.ea_context_menu.addAction(action_exclude_ea) self.ea_context_menu.addAction(action_show_callgraph) # Argument value ContextMenu self.value_context_menu = QtWidgets.QMenu(self.functionTreeView) self.value_context_menu.addAction(action_value_detail) # Therad ComboBox threads = [] if self.die_db is not None: threads = self.die_db.get_thread_list() thread_id_list = [] thread_id_list.append("All Threads") for thread in threads: thread_id_list.append(str(thread.thread_num)) self.thread_id_combo = QtWidgets.QComboBox() self.thread_id_combo.addItems(thread_id_list) self.thread_id_combo.activated[str].connect( self.on_thread_combobox_change) self.thread_id_label = QtWidgets.QLabel("Thread: ") # Toolbar self.function_toolbar = QtWidgets.QToolBar() self.function_toolbar.addWidget(self.thread_id_label) self.function_toolbar.addWidget(self.thread_id_combo) # Grid layout = QtWidgets.QGridLayout() layout.addWidget(self.function_toolbar) layout.addWidget(self.functionTreeView) self.parent.setLayout(layout)
def updating_actions(self, ctx): if ctx.form_type == idaapi.BWN_DISASM: ida_widget = form_to_widget(ctx.form) idaview = ida_widget.children()[0] install_idabuddy(idaview) return super(InstallerUiHooks, self).updating_actions(ctx)