def run(self, arg): # Get form and widget form = idaapi.create_empty_widget(self.comment) widget = sip.wrapinstance(int(form), QtWidgets.QWidget) runtime = IDARuntime(form) # Try to find the IDA input file filename = idaapi.get_input_file_path() if not filename: return if not os.path.isfile(filename): filename = os.path.basename(filename) if not os.path.isfile(filename): filename = runtime.ask_file(os.path.basename(filename), "Where is the input file?") if not filename: return # Map input file self.pe_tree_form = pe_tree.form.PETreeForm(widget, None, runtime) self.pe_tree_form.map_pe(image_base=idaapi.get_imagebase(), filename=filename) self.pe_tree_form.show()
def __init__(self, controller): # create a dockable view self.twidget = idaapi.create_empty_widget(ControlPanelViewWrapper.NAME) self.widget = sip.wrapinstance(int(self.twidget), QWidget) self.widget.name = ControlPanelViewWrapper.NAME self.width_hint = 250 self._controller = controller self._w = None self._init_widgets()
def create_dockable_widget(self, parent, dockable_name): import sip # create a dockable widget, and save a reference to it for later use twidget = idaapi.create_empty_widget(dockable_name) self._dockable_widgets[dockable_name] = twidget # cast the IDA 'twidget' as a Qt widget for use widget = sip.wrapinstance(int(twidget), QtWidgets.QWidget) widget.name = dockable_name widget.visible = False # return the dockable QtWidget / container return widget
def __init__(self, title): self._title = title # IDA 7+ Widgets if USING_IDA7API: import sip self._form = idaapi.create_empty_widget(self._title) self.widget = sip.wrapinstance(long(self._form), QtWidgets.QWidget) # legacy IDA PluginForm's else: self._form = idaapi.create_tform(self._title, None) if USING_PYQT5: self.widget = idaapi.PluginForm.FormToPyQtWidget(self._form) else: self.widget = idaapi.PluginForm.FormToPySideWidget(self._form)
def __init__(self, title, icon_path): self._title = title self._icon = QtGui.QIcon(icon_path) # IDA 7+ Widgets if using_ida7api: import sip self._form = idaapi.create_empty_widget(self._title) self._widget = sip.wrapinstance(long(self._form), QtWidgets.QWidget) # NOTE: LOL # legacy IDA PluginForm's else: self._form = idaapi.create_tform(self._title, None) if using_pyqt5: self._widget = idaapi.PluginForm.FormToPyQtWidget(self._form) else: self._widget = idaapi.PluginForm.FormToPySideWidget(self._form) self._widget.setWindowIcon(self._icon)
def __init__(self, window_title, icon_path): super(DockableWindow, self).__init__(window_title, icon_path) # IDA 7+ Widgets if IDAAPI.USING_IDA7API: import sip self._form = idaapi.create_empty_widget(self._window_title) self._widget = sip.wrapinstance(long(self._form), QtWidgets.QWidget) # legacy IDA PluginForm's else: self._form = idaapi.create_tform(self._window_title, None) if USING_PYQT5: self._widget = idaapi.PluginForm.FormToPyQtWidget( self._form, sys.modules[__name__]) else: self._widget = idaapi.PluginForm.FormToPySideWidget( self._form, sys.modules[__name__]) # set the window icon self._widget.setWindowIcon(self._window_icon)