def __init__(self): super(STM32FProgrammerDialog, self).__init__(CWMainGUI.getInstance()) # self.setWindowFlags(self.windowFlags() | Qt.WindowStaysOnTopHint) self.stm32f = STM32FProgrammer() self.setWindowTitle("Serial STM32F Programmer") layout = QVBoxLayout() layoutFW = QHBoxLayout() self.flashLocation = QtFixes.QLineEdit() flashFileButton = QPushButton("Find") flashFileButton.clicked.connect(self.findFlash) layoutFW.addWidget(QLabel("FLASH File")) layoutFW.addWidget(self.flashLocation) layoutFW.addWidget(flashFileButton) layout.addLayout(layoutFW) self.flashLocation.setText(QSettings().value("stm32f-flash-location")) # Add buttons readSigBut = QPushButton("Check Signature") readSigBut.clicked.connect(self.readSignature) verifyFlashBut = QPushButton("Verify FLASH") verifyFlashBut.clicked.connect(self.verifyFlash) verifyFlashBut.setEnabled(False) progFlashBut = QPushButton("Erase/Program/Verify FLASH") progFlashBut.clicked.connect(self.writeFlash) layoutBut = QHBoxLayout() layoutBut.addWidget(readSigBut) layoutBut.addWidget(verifyFlashBut) layoutBut.addWidget(progFlashBut) layout.addLayout(layoutBut) layoutsetting = QHBoxLayout() mode = QComboBox() mode.addItem("fast", False) mode.addItem("slow", True) mode.currentIndexChanged.connect(self.modechanged) layoutsetting.addWidget(QLabel("Speed:")) layoutsetting.addWidget(mode) blocksize = QComboBox() blocksize.addItem("256", False) blocksize.addItem("64", True) blocksize.currentIndexChanged.connect(self.blocksizechanged) layoutsetting.addStretch() layoutsetting.addWidget(QLabel("Read Block Size:")) layoutsetting.addWidget(blocksize) layout.addLayout(layoutsetting) # Add status stuff self.statusLine = QPlainTextEdit() self.statusLine.setReadOnly(True) # self.statusLine.setFixedHeight(QFontMetrics(self.statusLine.font()).lineSpacing() * 5 + 10) self.stm32f.newTextLog.connect(self.append) layout.addWidget(self.statusLine) # Set dialog layout self.setLayout(layout)
def __init__(self, parent): AutoScript.__init__(self) self._autoscript_init = False self.parent = parent self.poi = POI(self) self.poiDock = CWMainGUI.getInstance().addDock(self.poi, "Partition Comparison POI Table", area=Qt.TopDockWidgetArea) self.poiDock.hide() self.defineName() self._traces = None self.api = CWCoreAPI.getInstance() self.graph = GraphWidget() self.bselection = QToolBar() self.graph.addWidget(self.bselection) self.graphDock = CWMainGUI.getInstance().addDock(self.graph, "Partition Comparison Graph", area=Qt.TopDockWidgetArea) self.graphDock.hide()
def __init__(self, parent): AutoScript.__init__(self) self._autoscript_init = False self.parent = parent self.poi = POI(self) self.poiDock = CWMainGUI.getInstance().addDock( self.poi, "Partition Comparison POI Table", area=Qt.TopDockWidgetArea) self.poiDock.hide() self.defineName() self._traces = None self.api = CWCoreAPI.getInstance() self.graph = GraphWidget() self.bselection = QToolBar() self.graph.addWidget(self.bselection) self.graphDock = CWMainGUI.getInstance().addDock( self.graph, "Partition Comparison Graph", area=Qt.TopDockWidgetArea) self.graphDock.hide()
def updateTable(self): self.dock.show() tm = CWMainGUI.getInstance().api.getInstance().project().traceManager() tend = tm.numTraces() self.tablewid.setRowCount(tend) for tnum in range(0,tend): tin = tm.getTextin(tnum) tout = tm.getTextout(tnum) k = tm.getKnownKey(tnum) self.tablewid.setItem(tnum, 0, QTableWidgetItem(util.list2hexstr(tin))) self.tablewid.setItem(tnum, 1, QTableWidgetItem(util.list2hexstr(tout))) self.tablewid.setItem(tnum, 2, QTableWidgetItem(util.list2hexstr(k)))
def __init__(self, parent): AutoScript.__init__(self) self.parent = parent self.getParams().addChildren([ {'name':'Update/Display Table', 'type':'action', 'action':lambda _:self.updateTable()}, ]) self.tablewid = QTableWidget() self.tablewid.setRowCount(0) self.tablewid.setColumnCount(4) self.tablewid.setHorizontalHeaderLabels(["Text In", "Text Out", "Key", "Trace Data"]) #self.tablewid.verticalHeader().hide() #self.tablewid.setSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.MinimumExpanding) self.dock = CWMainGUI.getInstance().addDock(self.tablewid, "Text Display Table", area=Qt.TopDockWidgetArea) self.dock.hide()
def __init__(self, smartCardAPI): super(SmartCardGUICard, self).__init__(CWMainGUI.getInstance()) self.setWindowTitle("Smartcard Explorer") self.smartCardAPI = smartCardAPI self.mainLayout = QVBoxLayout() self.butLayout = QHBoxLayout() pbAddRow = QPushButton("Add Row") pbAddRow.clicked.connect(self.addRow) self.butLayout.addWidget(pbAddRow) pbSendChecked = QPushButton("Send Checked") pbSendChecked.clicked.connect(self.executeAPDUs) self.butLayout.addWidget(pbSendChecked) pbClearOutput = QPushButton("Clear Output") pbClearOutput.clicked.connect(self.clearOutput) self.butLayout.addWidget(pbClearOutput) pbSaveToClipboard = QPushButton("Copy to Clipboard") pbSaveToClipboard.clicked.connect(self.copyToClipboard) self.butLayout.addWidget(pbSaveToClipboard) pbSaveFromClipboard = QPushButton("Copy from Clipboard") pbSaveFromClipboard.clicked.connect(self.copyFromClipboard) self.butLayout.addWidget(pbSaveFromClipboard) self.butLayout.addStretch() self.table = QTableWidget(0, 3) self.table.setSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.MinimumExpanding) self.table.horizontalHeader().setResizeMode(0, QHeaderView.Interactive) self.table.horizontalHeader().setResizeMode(1, QHeaderView.Stretch) self.table.horizontalHeader().setResizeMode(2, QHeaderView.Interactive) self.table.setHorizontalHeaderLabels( ["Name", "APDU Transmit", "Response"]) self.mainLayout.addWidget(self.table) self.mainLayout.addLayout(self.butLayout) self.setLayout(self.mainLayout) self._updateInProgress = False self.filtlist = []
def __init__(self): super(XMEGAProgrammerDialog, self).__init__(CWMainGUI.getInstance()) # self.setWindowFlags(self.windowFlags() | Qt.WindowStaysOnTopHint) self.xmega = XMEGAProgrammer() self.setWindowTitle("ChipWhisperer-Lite XMEGA Programmer") layout = QVBoxLayout() layoutFW = QHBoxLayout() self.flashLocation = QtFixes.QLineEdit() flashFileButton = QPushButton("Find") flashFileButton.clicked.connect(self.findFlash) layoutFW.addWidget(QLabel("FLASH File")) layoutFW.addWidget(self.flashLocation) layoutFW.addWidget(flashFileButton) layout.addLayout(layoutFW) self.flashLocation.setText(QSettings().value("xmega-flash-location")) # Add buttons readSigBut = QPushButton("Check Signature") readSigBut.clicked.connect(self.readSignature) verifyFlashBut = QPushButton("Verify FLASH") verifyFlashBut.clicked.connect(self.verifyFlash) verifyFlashBut.setEnabled(False) progFlashBut = QPushButton("Erase/Program/Verify FLASH") progFlashBut.clicked.connect(self.writeFlash) layoutBut = QHBoxLayout() layoutBut.addWidget(readSigBut) layoutBut.addWidget(verifyFlashBut) layoutBut.addWidget(progFlashBut) layout.addLayout(layoutBut) # Add status stuff self.statusLine = QPlainTextEdit() self.statusLine.setReadOnly(True) # self.statusLine.setFixedHeight(QFontMetrics(self.statusLine.font()).lineSpacing() * 5 + 10) self.statusLine.append = self.statusLine.appendPlainText layout.addWidget(self.statusLine) self.xmega._logging = self.statusLine.append # Set dialog layout self.setLayout(layout)
def __init__(self): super(XMEGAProgrammerDialog, self).__init__(CWMainGUI.getInstance()) # self.setWindowFlags(self.windowFlags() | Qt.WindowStaysOnTopHint) self.xmega = XMEGAProgrammer() self.setWindowTitle("ChipWhisperer-Lite XMEGA Programmer") layout = QVBoxLayout() layoutFW = QHBoxLayout() self.flashLocation = QtFixes.QLineEdit() flashFileButton = QPushButton("Find") flashFileButton.clicked.connect(self.findFlash) layoutFW.addWidget(QLabel("FLASH File")) layoutFW.addWidget(self.flashLocation) layoutFW.addWidget(flashFileButton) layout.addLayout(layoutFW) self.flashLocation.setText(QSettings().value("xmega-flash-location")) # Add buttons readSigBut = QPushButton("Check Signature") readSigBut.clicked.connect(self.readSignature) verifyFlashBut = QPushButton("Verify FLASH") verifyFlashBut.clicked.connect(self.verifyFlash) verifyFlashBut.setEnabled(False) progFlashBut = QPushButton("Erase/Program/Verify FLASH") progFlashBut.clicked.connect(self.writeFlash) layoutBut = QHBoxLayout() layoutBut.addWidget(readSigBut) layoutBut.addWidget(verifyFlashBut) layoutBut.addWidget(progFlashBut) layout.addLayout(layoutBut) # Add status stuff self.statusLine = QPlainTextEdit() self.statusLine.setReadOnly(True) # self.statusLine.setFixedHeight(QFontMetrics(self.statusLine.font()).lineSpacing() * 5 + 10) self.xmega.newTextLog.connect(self.append) layout.addWidget(self.statusLine) # Set dialog layout self.setLayout(layout)
def __init__(self, smartCardAPI): super(SmartCardGUICard, self).__init__(CWMainGUI.getInstance()) self.setWindowTitle("Smartcard Explorer") self.smartCardAPI = smartCardAPI self.mainLayout = QVBoxLayout() self.butLayout = QHBoxLayout() pbAddRow = QPushButton("Add Row") pbAddRow.clicked.connect(self.addRow) self.butLayout.addWidget(pbAddRow) pbSendChecked = QPushButton("Send Checked") pbSendChecked.clicked.connect(self.executeAPDUs) self.butLayout.addWidget(pbSendChecked) pbClearOutput = QPushButton("Clear Output") pbClearOutput.clicked.connect(self.clearOutput) self.butLayout.addWidget(pbClearOutput) pbSaveToClipboard = QPushButton("Copy to Clipboard") pbSaveToClipboard.clicked.connect(self.copyToClipboard) self.butLayout.addWidget(pbSaveToClipboard) pbSaveFromClipboard = QPushButton("Copy from Clipboard") pbSaveFromClipboard.clicked.connect(self.copyFromClipboard) self.butLayout.addWidget(pbSaveFromClipboard) self.butLayout.addStretch() self.table = QTableWidget(0,3) self.table.setSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.MinimumExpanding) self.table.horizontalHeader().setResizeMode(0, QHeaderView.Interactive) self.table.horizontalHeader().setResizeMode(1, QHeaderView.Stretch) self.table.horizontalHeader().setResizeMode(2, QHeaderView.Interactive) self.table.setHorizontalHeaderLabels(["Name", "APDU Transmit", "Response"]) self.mainLayout.addWidget(self.table) self.mainLayout.addLayout(self.butLayout) self.setLayout(self.mainLayout) self._updateInProgress = False self.filtlist = []
def __init__(self, fwLoaderConfig): super(FWLoaderConfigGUI, self).__init__(CWMainGUI.getInstance()) self.fwLoaderConfig = fwLoaderConfig self.setWindowTitle("ChipWhisperer (%s) Firmware Loader Configuration " % self.fwLoaderConfig.loader.name) layout = QVBoxLayout() gbFPGAMode = QGroupBox("FPGA Mode Selection") radioBuiltin = QRadioButton("Builtin") radioRelease = QRadioButton("External (.zip)") radioDebug = QRadioButton("Debug - no partial reconfig (.bit)") layoutGB = QHBoxLayout() layoutGB.addWidget(radioBuiltin) layoutGB.addWidget(radioRelease) layoutGB.addWidget(radioDebug) layoutGB.addStretch(1) gbFPGAMode.setLayout(layoutGB) layout.addWidget(gbFPGAMode) radioBuiltin.clicked.connect(lambda: self.setFPGAMode("builtin")) radioRelease.clicked.connect(lambda: self.setFPGAMode("zipfile")) radioDebug.clicked.connect(lambda: self.setFPGAMode("debug")) layoutFW = QHBoxLayout() self.firmwareLocation = QtFixes.QLineEdit() firmwareButton = QPushButton("Find") firmwareButton.clicked.connect(self.findFirmware) layoutFW.addWidget(QLabel("USB Firmware")) layoutFW.addWidget(self.firmwareLocation) layoutFW.addWidget(firmwareButton) if hasattr(self.fwLoaderConfig.loader, 'loadFirmware'): layout.addLayout(layoutFW) layoutBitZip = QHBoxLayout() self.bitZipLocation = QtFixes.QLineEdit() bitZipButton = QPushButton("Find") bitZipButton.clicked.connect(self.findZipBitstream) layoutBitZip.addWidget(QLabel("FPGA .zip (Release)")) layoutBitZip.addWidget(self.bitZipLocation) layoutBitZip.addWidget(bitZipButton) layout.addLayout(layoutBitZip) layoutBit = QHBoxLayout() self.bitDebugLocation = QtFixes.QLineEdit() bitButton = QPushButton("Find") bitButton.clicked.connect(self.findDebugBitstream) layoutBit.addWidget(QLabel("FPGA .bit file (DEBUG ONLY)")) layoutBit.addWidget(self.bitDebugLocation) layoutBit.addWidget(bitButton) layout.addLayout(layoutBit) layoutProgramNow = QHBoxLayout() self.programNow = QPushButton("Program FPGA (MUST be connected already)") self.programNow.clicked.connect(self.loadFPGA) layoutProgramNow.addWidget(self.programNow) layout.addLayout(layoutProgramNow) gbSAMFW = QGroupBox("SAM3U Firmware") layoutSAMFW = QVBoxLayout() pbSAMFW = QPushButton("Open SAM3U Update Widget") pbSAMFW.clicked.connect(self.upgradeSAM3) self.samfwVersion = QLabel("Detected FW Version: unknown") self.samfwVersionLatest = QLabel("Latest FW Version: unknown") layoutSAMFW.addWidget(self.samfwVersion) layoutSAMFW.addWidget(self.samfwVersionLatest) layoutSAMFW.addWidget(pbSAMFW) gbSAMFW.setLayout(layoutSAMFW) self.readFirmwareVersion() if isinstance(self.fwLoaderConfig.loader, ChipWhispererFWLoader.CWLite_Loader): layout.addWidget(gbSAMFW) self.setFPGAMode(QSettings().value("%s-fpga-bitstream-mode" % self.fwLoaderConfig.loader.name)) self.fwLoaderConfig.loader._bsZipLoc = QSettings().value("%s-zipbitstream-location" % self.fwLoaderConfig.loader.name, self.fwLoaderConfig.loader._bsZipLoc) self.bitZipLocation.setText(self.fwLoaderConfig.loader._bsZipLoc) self.fwLoaderConfig.loader._bsLoc = QSettings().value("%s-debugbitstream-location" % self.fwLoaderConfig.loader.name, self.fwLoaderConfig.loader._bsLoc) self.bitDebugLocation.setText(self.fwLoaderConfig.loader._bsLoc) self.fwLoaderConfig.loader._fwFLoc = QSettings().value("%s-firmware-location" % self.fwLoaderConfig.loader.name, self.fwLoaderConfig.loader._fwFLoc) self.firmwareLocation.setText(self.fwLoaderConfig.loader._fwFLoc) radioBuiltin.setChecked(self.fwLoaderConfig.firmware_mode == "builtin") radioRelease.setChecked(self.fwLoaderConfig.firmware_mode == "zipfile") radioDebug.setChecked(self.fwLoaderConfig.firmware_mode == "debug") self.setLayout(layout)
def __init__(self): super(AVRProgrammerDialog, self).__init__(CWMainGUI.getInstance()) # self.setWindowFlags(self.windowFlags() | Qt.WindowStaysOnTopHint) self.avr = AVRProgrammer() self.setWindowTitle("ChipWhisperer-Lite AVR Programmer") layout = QVBoxLayout() layoutFW = QHBoxLayout() self.flashLocation = QtFixes.QLineEdit() flashFileButton = QPushButton("Find") flashFileButton.clicked.connect(self.findFlash) layoutFW.addWidget(QLabel("FLASH File")) layoutFW.addWidget(self.flashLocation) layoutFW.addWidget(flashFileButton) layout.addLayout(layoutFW) self.flashLocation.setText(QSettings().value("avr-flash-location")) # Add buttons readSigBut = QPushButton("Check Signature") readSigBut.clicked.connect(self.readSignature) verifyFlashBut = QPushButton("Verify FLASH") verifyFlashBut.clicked.connect(self.verifyFlash) verifyFlashBut.setEnabled(False) progFlashBut = QPushButton("Erase/Program/Verify FLASH") progFlashBut.clicked.connect(self.writeFlash) layoutBut = QHBoxLayout() layoutBut.addWidget(readSigBut) layoutBut.addWidget(verifyFlashBut) layoutBut.addWidget(progFlashBut) layout.addLayout(layoutBut) layoutFuse = QHBoxLayout() readFuseBut = QPushButton("Read Fuses") readFuseBut.clicked.connect(self.readFuses) writeFuseBut = QPushButton("Write Fuses") writeFuseBut.clicked.connect(self.writeFuses) self.lowfuseLine = QtFixes.QLineEdit("?") self.lowfuseLine.setMaxLength(2) self.lowfuseLine.setFixedWidth(25) self.highfuseLine = QtFixes.QLineEdit("?") self.highfuseLine.setMaxLength(2) self.highfuseLine.setFixedWidth(25) self.extfuseLine = QtFixes.QLineEdit("?") self.extfuseLine.setMaxLength(2) self.extfuseLine.setFixedWidth(25) # Don't allow use to change these fuses self.highfuseLine.setReadOnly(True) self.extfuseLine.setReadOnly(True) layoutFuse.addWidget(readFuseBut) layoutFuse.addWidget(QLabel("LOW:")) layoutFuse.addWidget(self.lowfuseLine) layoutFuse.addWidget(QLabel("HIGH:")) layoutFuse.addWidget(self.highfuseLine) layoutFuse.addWidget(QLabel("EXT:")) layoutFuse.addWidget(self.extfuseLine) layoutFuse.addWidget(writeFuseBut) layout.addLayout(layoutFuse) layoutExtra = QHBoxLayout() self.clockMode = QPushButton("Enable Slow Clock Mode") self.clockMode.setCheckable(True) self.clockMode.clicked.connect(self.toggleSlowClock) layoutExtra.addWidget(self.clockMode) layoutExtra.addStretch() layout.addLayout(layoutExtra) # Add status stuff self.statusLine = QPlainTextEdit() self.statusLine.setReadOnly(True) # self.statusLine.setFixedHeight(QFontMetrics(self.statusLine.font()).lineSpacing() * 5 + 10) layout.addWidget(self.statusLine) self.avr.newTextLog.connect(self.append) # Set dialog layout self.setLayout(layout)
def __init__(self): super(AVRProgrammerDialog, self).__init__(CWMainGUI.getInstance()) # self.setWindowFlags(self.windowFlags() | Qt.WindowStaysOnTopHint) self.avr = AVRProgrammer() self.setWindowTitle("ChipWhisperer-Lite AVR Programmer") layout = QVBoxLayout() layoutFW = QHBoxLayout() self.flashLocation = QtFixes.QLineEdit() flashFileButton = QPushButton("Find") flashFileButton.clicked.connect(self.findFlash) layoutFW.addWidget(QLabel("FLASH File")) layoutFW.addWidget(self.flashLocation) layoutFW.addWidget(flashFileButton) layout.addLayout(layoutFW) self.flashLocation.setText(QSettings().value("avr-flash-location")) # Add buttons readSigBut = QPushButton("Check Signature") readSigBut.clicked.connect(self.readSignature) verifyFlashBut = QPushButton("Verify FLASH") verifyFlashBut.clicked.connect(self.verifyFlash) verifyFlashBut.setEnabled(False) progFlashBut = QPushButton("Erase/Program/Verify FLASH") progFlashBut.clicked.connect(self.writeFlash) layoutBut = QHBoxLayout() layoutBut.addWidget(readSigBut) layoutBut.addWidget(verifyFlashBut) layoutBut.addWidget(progFlashBut) layout.addLayout(layoutBut) layoutFuse = QHBoxLayout() readFuseBut = QPushButton("Read Fuses") readFuseBut.clicked.connect(self.readFuses) writeFuseBut = QPushButton("Write Fuses") writeFuseBut.clicked.connect(self.writeFuses) self.lowfuseLine = QtFixes.QLineEdit("?") self.lowfuseLine.setMaxLength(2) self.lowfuseLine.setFixedWidth(25) self.highfuseLine = QtFixes.QLineEdit("?") self.highfuseLine.setMaxLength(2) self.highfuseLine.setFixedWidth(25) self.extfuseLine = QtFixes.QLineEdit("?") self.extfuseLine.setMaxLength(2) self.extfuseLine.setFixedWidth(25) # Don't allow use to change these fuses self.highfuseLine.setReadOnly(True) self.extfuseLine.setReadOnly(True) layoutFuse.addWidget(readFuseBut) layoutFuse.addWidget(QLabel("LOW:")) layoutFuse.addWidget(self.lowfuseLine) layoutFuse.addWidget(QLabel("HIGH:")) layoutFuse.addWidget(self.highfuseLine) layoutFuse.addWidget(QLabel("EXT:")) layoutFuse.addWidget(self.extfuseLine) layoutFuse.addWidget(writeFuseBut) layout.addLayout(layoutFuse) layoutExtra = QHBoxLayout() self.clockMode = QPushButton("Enable Slow Clock Mode") self.clockMode.setCheckable(True) self.clockMode.clicked.connect(self.toggleSlowClock) layoutExtra.addWidget(self.clockMode) layoutExtra.addStretch() layout.addLayout(layoutExtra) # Add status stuff self.statusLine = QPlainTextEdit() self.statusLine.setReadOnly(True) # self.statusLine.setFixedHeight(QFontMetrics(self.statusLine.font()).lineSpacing() * 5 + 10) self.statusLine.append = self.statusLine.appendPlainText layout.addWidget(self.statusLine) self.avr._logging = self.statusLine.append # Set dialog layout self.setLayout(layout)