As of August 2020 the site you are on (wiki.newae.com) is deprecated, and content is now at rtfm.newae.com.

Changes

Jump to: navigation, search

Making Scripts

215 bytes removed, 18:10, 17 June 2016
no edit summary
A basic script would look like this:
import sysfrom chipwhisperer.common.api.CWCoreAPI import CWCoreAPI # Import the ChipWhisperer APIimport chipwhisperer.capture.ui.CWCaptureGUI as cwc # Import the ChipWhispererCapture GUI<pre>
from chipwhisperer.common.scripts.base import UserScriptBase
from chipwhisperer.common.utils.parameter import Parameter
#The environment is already set, lets do our first capture
self.api.capture1()
</pre>
User scripts should inherit from UserScriptBase that specifies the run() method that is called when clicking it in the menu or pressing the attack button (in the analyzer tool).
The section "if __name__ == '__main__':" is not mandatory, but is recommended if you want to run the script from the terminal. In this case, you don't need to use the GUI, the capture can be performed using only the API. Ex.:
<pre>
if __name__ == '__main__':
import sys
api = CWCoreAPI() # Instantiate the API
api.runScriptClass(UserScript) # Run UserScript through the API
</pre>
or if you want the GUI:
<pre>
if __name__ == '__main__':
import sys
Parameter.usePyQtGraph = True
api = CWCoreAPI() # Instantiate the API
gui = cwc.CWAnalyzerGUI(api) # Instantiate the GUI
gui.show()
api.runScriptClass(UserScript) # Run UserScript through the API
sys.exit(app.exec_())
</pre>
New scripts can be added to the tool's menu automatically by saving it in its respective script folder:
218
edits

Navigation menu