def g_display(self): self.name = 'timeline ' + QString(self.node.name()) if not self.node.hasChildren(): self.setStateInfo(self.node.absolute() + ' doesn\'t have any children.') else: self.vfs = vfs.vfs() self.vlayout = QVBoxLayout() self.vlayout.setMargin(0) self.vlayout.setSpacing(0) self.hsplitter = QSplitter() self.ploter = PaintArea(self) self.options = OptionsLayout(self) self.hsplitter.addWidget(self.ploter) self.hsplitter.addWidget(self.options) self.vlayout.addWidget(self.hsplitter) self.setLayout(self.vlayout) self.draw = Drawer(self) # CountThread compute node amount self.countThread = CountThread(self, self.countThreadOver) self.populateThread = DataThread(self, self.dataThreadOver) self.maxOccThread = MaxOccThread(self, self.maxOccThreadOver) self.workerThread = WorkerThread(self) #comment it to avoid redraw everytime painter is resized self.connect(self.workerThread, SIGNAL('refresh'), self.reDraw)
def start(self, args): self.vfs = vfs.vfs() self.dumpnumber = 1 try : self.nor = args['nor'].value() self.nand = args['nand'].value() except IndexError: return try: self.spareSize = args["spare-size"].value() except IndexError: self.spareSize = 16 try: self.pageSize = args["page-size"].value() except IndexError: self.pageSize = 512 self.k800n = Node("k800-base") self.k800n.__disown__() self.boot = SEBootBlock(self.nor, self.pageSize) self.blockSize = self.boot.blockSize self.nandClean = SpareNode(self, self.nand, "nandfs", self.pageSize, self.spareSize, self.k800n) self.norFs = NorFs(self, self.k800n, self.nor, "norfs", self.boot) self.fullFs = FullFs(self, self.k800n, self.norFs, self.nandClean, "fullfs", self.boot) self.gdfs = GDFS(self, self.k800n, self.nor, "gdfs", self.boot) self.firmware = Firmware(self, self.k800n, self.nor, "firmware", self.boot.norfsoffset) self.tables = Tables(self.fullFs, self.blockSize) self.registerTree(self.nand, self.k800n)
def __init__(self, parent, model): QWidget.__init__(self) Ui_NodeFBox.__init__(parent) EventHandler.__init__(self) self.parent = parent self.setupUi(self) self.model = model self.translation() if IndexerFound: self.opt = ModifIndex(self, model) self.vfs = vfs() if QtCore.PYQT_VERSION_STR >= "4.5.0": self.search.clicked.connect(self.searching) if IndexerFound: self.notIndexed.linkActivated.connect(self.index_opt2) self.indexOpt.clicked.connect(self.explain_this_odd_behavior) self.advancedSearch.clicked.connect(self.adv_search) # self.connect(self, SIGNAL("add_node"), self.parent.model.fillingList) else: QtCore.QObject.connect(self.search, SIGNAL("clicked(bool)"), self.searching) if IndexerFound: QtCore.QObject.connect(self.index_opt, SIGNAL("clicked(bool)"), self.explain_this_odd_behavior) QtCore.QObject.connect(self.notIndexed, SIGNAL("linkActivated()"), self.index_opt2) QtCore.QObject.connect(self.advancedSearch, SIGNAL("clicked(bool)"), self.adv_search) # self.connect(self, SIGNAL("add_node"), self.parent.model.fillingList) self.filterThread = FilterThread() # Future feature self.indexOpt.hide()
def getVfsNode(self): from api.vfs.vfs import vfs vfs = vfs() node = vfs.getnode(self.localHashPath()) if node: return node return None
def __init__(self): Script.__init__(self, "viewerimage") self.type = "imageview" self.icon = None self.vfs = vfs.vfs() self.reg_viewer = re.compile(".*(JPEG|JPG|jpg|jpeg|GIF|gif|bmp|png|PNG|pbm|PBM|pgm|PGM|ppm|PPM|xpm|XPM|xbm|XBM|TIFF|tiff).*", re.IGNORECASE) self.sceneWidth = 0
def exportClick(self, clickState): rect = self.timeline.ploter.selectionRect.rect() exportSelDateMin = self.timeline.draw.findXTime(rect.x()) exportSelDateMax = self.timeline.draw.findXTime(rect.x() + rect.width()) for family in self.configuration: for time in family[1]: if time[1][0][1]: nodes = [] everyNodes = self.timeline.elementsInRangeToNodeList(time[1][5][1], self.timeline.toUSec(exportSelDateMin), self.timeline.toUSec(exportSelDateMax)) for oneGroupNode in everyNodes: for node in oneGroupNode: nodes.append(node) if len(nodes): if not self.exportedNode: # Create /timeline if needed root = vfs.vfs().getnode('/') baseNode = Node('timeline', 0, root) baseNode.__disown__() baseNode.setDir() e = event() e.value = Variant(baseNode) self.VFS.notify(e) # Create /timeline/<ParentName> self.exportedNode = Node(self.timeline.node.name(), 0, baseNode) self.exportedNode.__disown__() self.exportedNode.setDir() timeBaseName = self.exportedNode.absolute() + '/' + str(exportSelDateMin.strftime('%d.%m.%Y %H:%M:%S')) + ' to ' + str(exportSelDateMax.strftime('%d.%m.%Y %H:%M:%S')) timeBaseNode = vfs.vfs().getnode(timeBaseName) if not timeBaseNode: # Create /timeline/<ParentName>/dateStart to dateEnd/<Module:FullTimestampAttributePath>/ timeBaseNode = Node(str(exportSelDateMin.strftime('%d.%m.%Y %H:%M:%S')) + ' to ' + str(exportSelDateMax.strftime('%d.%m.%Y %H:%M:%S')), 0, self.exportedNode) timeBaseNode.__disown__() timeBaseNode.setDir() baseFamilyName = timeBaseNode.absolute() + '/' + ':'.join([family[0]] + time[0]) baseFamilyNode = vfs.vfs().getnode(baseFamilyName) if not baseFamilyNode: # Create /timeline/<ParentName>/dateStart to dateEnd//<Module:FullTimestampAttributePath> if needed baseFamilyNode = Node(':'.join([family[0]] + time[0]), 0, timeBaseNode) baseFamilyNode.__disown__() baseFamilyNode.setDir() for node in nodes: # Add each node in array as child l = VLink(node, baseFamilyNode) l.__disown__()
def __init__(self, console, DEBUG = False, VERBOSITY = 0): self.DEBUG = DEBUG self.VERBOSITY = VERBOSITY self.console = console self.lp = LineParser(self.DEBUG, self.VERBOSITY - 1) self.confmanager = ConfigManager.Get() self.loader = loader() self.vfs = vfs()
def __init__(self): fso.__init__(self, "unzip") self.name = "unzip" self.VFS = VFS.Get() self.vfs = vfs.vfs() self.fdm = FdManager() self.origin = None self.zipcontent = None self.file = None self.mapped_files = {}
def __init__(self): QCompleter.__init__(self) self.vfs = vfs() self.__model = CompleterModel() self.currentNode = self.vfs.getnode("/") self.currentPath = self.currentNode self.setCompletionPrefix(QString.fromUtf8(self.currentNode.absolute())) self.__model.setRootPath(self.currentNode) self.__model.setCurrentPath("/") self.setModel(self.__model) QObject.connect(self, SIGNAL("activated(const QString &)"), self.updatePath)
def __init__(self, root=None, filtersParam=None, recursive=True): EventHandler.__init__(self) self.filters = {} self.root = root self.recursive = recursive self.matchingNodes = [] self.vfs = vfs() self.ai = AttributesIndexer.Get() self.__stop = False if filtersParam != None: self.filtersParam = filtersParam self.compile(self.filtersParam)
def __init__(self, parent): QWidget.__init__(self) self.setupUi(self) #self.search.hide() self.vfs = vfs() self.VFS = libvfs.VFS.Get() self.parent = parent self.button = {} # Force thumbSize height to be the same as viewbox height, because # thumbSize comboBox doesn't have any icon, height is smaller. self.thumbSize.setFixedHeight(self.viewbox.sizeHint().height()) self.history = [] self.history.append("/") self.currentPathId = -1 self.model = self.parent.model self.connect(self.model, SIGNAL("rootPathChanged"), self.rootpathchanged) self.bookmarkCategories = [] self.bookmarkNode = self.vfs.getnode('/Bookmarks/') self.addPropertyTable() self.parent.connect(self.previous, SIGNAL("clicked()"), self.moveToPrevious) self.setPrevDropButton() self.parent.connect(self.next, SIGNAL("clicked()"), self.moveToNext) self.setNextDropButton() self.parent.connect(self.top, SIGNAL("clicked()"), self.moveToTop) self.parent.connect(self.root, SIGNAL("clicked()"), self.goHome) self.completerWidget = CompleterWidget() self.pathedit.addWidget(self.completerWidget) self.connect(self.completerWidget, SIGNAL("returnPressed()"), self.completerChanged) self.connect(self.viewbox, SIGNAL("activated(int)"), self.viewboxChanged) # No more checkBoxAttributes there is now an attributes panel icon self.connect(self.attrSelect, SIGNAL("clicked()"), self.attrSelectView) self.connect(self.addToBookmark, SIGNAL("clicked()"), self.bookmark) self.connect(self.search, SIGNAL("clicked()"), self.searchActivated) self.connect(self.imagethumb, SIGNAL("clicked()"), self.imagethumbActivated) self.connect(self.attrView, SIGNAL("clicked()"), self.attrViewActivated) self.parent.connect(self.thumbSize, SIGNAL("currentIndexChanged(QString)"), self.parent.sizeChanged) self.tableActivated() self.translation()
def __init__(self, DEBUG = False, VERBOSITY = 0): self.DEBUG = DEBUG self.VERBOSITY = VERBOSITY self.confmanager = ConfigManager.Get() self.config = None self.keylessarg = None self.currentArgument = None self.parsedArgument = None self.providedArguments = {} self.remainingArguments = [] self.threaded = False self.currentStr = "" self.vfs = vfs() self.currentStrScope = 0 self.paramsplit = re.compile('(?<!\\\)\,') self.badargs = [] self.tokens = []
def __init__(self, parent): QObject.__init__(self) self.parent = parent self.vfs = vfs.vfs() self.taskmanager = TaskManager() self.loader = loader.loader()
def __init__(self, parent): super(QWidget, self).__init__() EventHandler.__init__(self) self.filterThread = FilterThread(self) self.parent = parent self.vfs = vfs() self.setupUi(self) self.name = self.windowTitle() self.setObjectName(self.name) self.clause_list = [] self.operator_list = [] self.completeClause.setText("") self.__totalnodes = 0 self.__totalhits = 0 self.__processednodes = 0 self.icon = ":search.png" self.translation() self.xtd_attr = PropertyTable(None) self.attrsTree.addWidget(self.xtd_attr) self.model = ListNodeModel(self) self.searchResults = SearchNodeBrowser(self) self.nodeBrowserLayout.addWidget(self.searchResults) self.node_name = QLineEdit() self.node_name.setReadOnly(True) self.nodeBrowserLayout.addWidget(self.node_name) self.searchResults.addTableView() self.searchResults.tableView.setModel(self.model) self.connect(self.searchResults.tableView, SIGNAL("nodeClicked"), self.change_node_name) if QtCore.PYQT_VERSION_STR >= "4.5.0": self.nameContain.textChanged.connect(self.rebuildQuery) self.caseSensitiveName.stateChanged.connect(self.case_sens_changed) self.typeName.currentIndexChanged.connect(self.case_sens_changed) self.launchSearchButton.clicked.connect(self.launchSearch) self.stopSearchButton.clicked.connect(self.stopSearch) self.exportButton.clicked.connect(self.export) else: QtCore.QObject.connect(self.nameContain.textChanged, SIGNAL("clicked(bool)"), self.rebuildQuery) QtCore.QObject.connect(self.caseSensitiveName, SIGNAL("stateChanged(int)"), \ self.case_sens_changed) QtCore.QObject.connect(self.typeName, SIGNAL("currentIndexChanged(int)"), \ self.case_sens_changed) QtCore.QObject.connect(self.launchSearchButton, SIGNAL("clicked(bool)"), self.launchSearch) QtCore.QObject.connect(self.stopSearchButton, SIGNAL("clicked(bool)"), self.stopSearch) QtCore.QObject.connect(self.exportButton, SIGNAL("clicked(bool)"), self.export) self.typeName.addItem("Fixed string", QVariant("f")) self.typeName.addItem("Wildcard", QVariant("w")) self.typeName.addItem("Fuzzy", QVariant("fz")) self.typeName.addItem("Reg exp", QVariant("re")) self.stopSearchButton.hide() self.exportButton.setEnabled(False) self.addedOpt = [] if QtCore.PYQT_VERSION_STR >= "4.5.0": self.addOption.clicked.connect(self.addSearchOptions) else: QtCore.QObject.connect(self.addOption, SIGNAL("clicked(bool)"), self.addSearchOptions) self.connect(self.filterThread, SIGNAL("CountNodes"), self.__progressUpdate) self.connect(self.filterThread, SIGNAL("finished"), self.searchFinished) QtCore.QObject.connect(self.selectAll, SIGNAL("stateChanged(int)"), self.select_all)
def __init__(self, app, debug = False): super(MainWindow, self).__init__() self.app = app self.debug = debug self.sched = scheduler.sched # self.vfs = VFS.Get() self.vfs = vfs.vfs() self.createRootNodes() self.dialog = Dialog(self) self.initCallback() # Set up the user interface from Qt Designer self.setupUi(self) self.translation() # Customization self.setWindowModality(QtCore.Qt.ApplicationModal) self.resize(QtCore.QSize(QtCore.QRect(0,0,1014,693).size()).expandedTo(self.minimumSizeHint())) self.shellActions = ShellActions(self) self.interpreterActions = InterpreterActions(self) self.initDockWidgets() self.setCentralWidget(None) # Signals handling ## File menu self.connect(self.actionOpen_evidence, SIGNAL("triggered()"), self.dialog.addFiles) self.connect(self.actionOpen_device, SIGNAL("triggered()"), self.dialog.addDevices) self.connect(self.actionExit, SIGNAL("triggered()"), self.close) ## Edit menu self.connect(self.actionPreferences, SIGNAL("triggered()"), self.dialog.preferences) ## Module menu self.connect(self.actionLoadModule, SIGNAL("triggered()"), self.dialog.loadDriver) self.connect(self.actionBrowse_modules, SIGNAL("triggered()"), self.dialog.manager) ## Ide menu self.connect(self.actionIdeOpen, SIGNAL("triggered()"), self.addIde) ## View menu self.connect(self.actionMaximize, SIGNAL("triggered()"), self.maximizeDockwidget) self.connect(self.actionFullscreen_mode, SIGNAL("triggered()"), self.fullscreenMode) self.connect(self.actionNodeBrowser, SIGNAL("triggered()"), self.addNodeBrowser) self.connect(self.actionShell, SIGNAL("triggered()"), self.shellActions.create) self.connect(self.actionPython_interpreter, SIGNAL("triggered()"), self.interpreterActions.create) ## About menu self.connect(self.actionHelp, SIGNAL("triggered()"), self.addHelpWidget) self.connect(self.actionAbout, SIGNAL("triggered()"), self.dialog.about) # list used to build toolbar # None will be a separator self.toolbarList = [self.actionOpen_evidence, self.actionOpen_device, None, self.actionNodeBrowser, self.actionShell, self.actionPython_interpreter, self.actionIdeOpen, self.actionHelp, None, self.actionMaximize, self.actionFullscreen_mode, self.actionBrowse_modules, ] # Set up toolbar self.setupToolBar() # Set up modules menu self.MenuTags = MenuTags(self, self) self.refreshTabifiedDockWidgets()
def __init__(self, inheritfromvfsname, filename, flags): self.vfs = vfs() self.node = self.vfs.getnode(filename) self.vfile = self.node.open()