当前位置: 首页>>代码示例>>Python>>正文


Python CWCoreAPI.runScriptClass方法代码示例

本文整理汇总了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
开发者ID:FrankMuenzner,项目名称:chipwhisperer,代码行数:33,代码来源:cwlite-simpleserialnotduino.py

示例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
开发者ID:phonchi,项目名称:chipwhisperer,代码行数:32,代码来源:cwlite-timingattack.py

示例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
开发者ID:FrankMuenzner,项目名称:chipwhisperer,代码行数:33,代码来源:templateattackscript.py


注:本文中的chipwhisperer.common.api.CWCoreAPI.CWCoreAPI.runScriptClass方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。