本文整理汇总了Python中chipwhisperer.common.api.CWCoreAPI.CWCoreAPI.runScriptClass方法的典型用法代码示例。如果您正苦于以下问题:Python CWCoreAPI.runScriptClass方法的具体用法?Python CWCoreAPI.runScriptClass怎么用?Python CWCoreAPI.runScriptClass使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类chipwhisperer.common.api.CWCoreAPI.CWCoreAPI
的用法示例。
在下文中一共展示了CWCoreAPI.runScriptClass方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: CWCoreAPI
# 需要导入模块: from chipwhisperer.common.api.CWCoreAPI import CWCoreAPI [as 别名]
# 或者: from chipwhisperer.common.api.CWCoreAPI.CWCoreAPI import runScriptClass [as 别名]
['OpenADC', 'Gain Setting', 'Setting', 45],
['OpenADC', 'Trigger Setup', 'Mode', 'rising edge'],
#Final step: make DCMs relock in case they are lost
['OpenADC', 'Clock Setup', 'ADC Clock', 'Reset ADC DCM', None],
]
#Download all hardware setup parameters
for cmd in lstexample: self.api.setParameter(cmd)
#Let's only do a few traces
self.api.setParameter(['Generic Settings', 'Acquisition Settings', 'Number of Traces', 50])
#Throw away first few
self.api.capture1()
self.api.capture1()
#Capture a set of traces and save the project
# self.api.captureM()
# self.api.saveProject("../../../projects/test.cwp")
if __name__ == '__main__':
app = cwc.makeApplication() # Comment this line if you don't want to use the GUI
Parameter.usePyQtGraph = True # Comment this line if you don't want to use the GUI
api = CWCoreAPI() # Instantiate the API
# app.setApplicationName("Capture Scripted") # If you DO NOT want to overwrite settings from the GUI
gui = cwc.CWCaptureGUI(api) # Comment this line if you don't want to use the GUI
gui.show() # Comment this line if you don't want to use the GUI
api.runScriptClass(UserScript) # Run the User Script
sys.exit(app.exec_()) # Comment this line if you don't want to use the GUI
示例2: range
# 需要导入模块: from chipwhisperer.common.api.CWCoreAPI import CWCoreAPI [as 别名]
# 或者: from chipwhisperer.common.api.CWCoreAPI.CWCoreAPI import runScriptClass [as 别名]
for i in range(5):
for c in trylist:
# Get a power trace using our next attempt
nextPass = password + '{}'.format(c)
self.api.setParameter(['Simple Serial', 'Go Command', '{}\n'.format(nextPass)])
self.api.capture1()
# Grab the trace
nextTrace = self.api.getScope().datapoints
# Check location 153, 225, etc. If it's too low, we've failed
if nextTrace[153 + 72*i] < -0.2:
continue
# If we got here, we've found the right letter
password += c
print '{} characters: {}'.format(i+1, password)
break
if __name__ == '__main__':
import chipwhisperer.capture.ui.CWCaptureGUI as cwc # Import the ChipWhispererCapture GUI
from chipwhisperer.common.utils.parameter import Parameter # Comment this line if you don't want to use the GUI
Parameter.usePyQtGraph = True # Comment this line if you don't want to use the GUI
api = CWCoreAPI() # Instantiate the API
app = cwc.makeApplication("Capture") # Change the name if you want a different settings scope
gui = cwc.CWCaptureGUI(api) # Comment this line if you don't want to use the GUI
gui.show() # Comment this line if you don't want to use the GUI
api.runScriptClass(UserScript) # Run the User Script (executes "run()" by default)
app.exec_() # Comment this line if you don't want to use the GUI
示例3: TraceExplorerDialog_PartitionDisplay_findPOI
# 需要导入模块: from chipwhisperer.common.api.CWCoreAPI import CWCoreAPI [as 别名]
# 或者: from chipwhisperer.common.api.CWCoreAPI.CWCoreAPI import runScriptClass [as 别名]
partDiffs = ted.generatePartitionDiffs(DifferenceModeSAD, statsInfo={"partclass":PartitionHWIntermediate, "stats":partStats}, saveFile=True, loadFile=False, progressBar=progressBar)
ted.displayPartitions(differences={"partclass":PartitionHWIntermediate, "diffs":partDiffs})
ted.poi.setDifferences(partDiffs)
def TraceExplorerDialog_PartitionDisplay_findPOI(self):
self.cwagui = CWAnalyzerGUI.getInstance()
ted = self.cwagui.attackScriptGen.utilList[0].exampleScripts[0]
return ted.poi.calcPOI(numMax=3, pointRange=(0, 3000), minSpace=5)['poi']
def generateTemplates(self):
self.TraceExplorerDialog_PartitionDisplay_displayPartitionStats()
tRange = (0, 1499)
poiList = self.TraceExplorerDialog_PartitionDisplay_findPOI()
partMethod = PartitionHWIntermediate()
templatedata = self.attack.attack.profiling.generate(tRange, poiList, partMethod)
tfname = self.attack.attack.saveTemplatesToProject(tRange, templatedata)
if __name__ == '__main__':
import sys
from chipwhisperer.common.api.CWCoreAPI import CWCoreAPI
import chipwhisperer.analyzer.ui.CWAnalyzerGUI as cwa
from chipwhisperer.common.utils.parameter import Parameter
app = cwa.makeApplication() # Comment if you don't need the GUI
Parameter.usePyQtGraph = True # Comment if you don't need the GUI
api = CWCoreAPI() # Instantiate the API
api.runScriptClass(Capture)
gui = cwa.CWAnalyzerGUI(api) # Comment if you don't need the GUI
gui.show() # Comment if you don't need the GUI
api.runScriptClass(Attack)
sys.exit(app.exec_()) # Comment if you don't need the GUI