newaetech / chipwhisperer

ChipWhisperer - the complete open-source toolchain for side-channel power analysis and glitching attacks
http://chipwhisperer.com
Other
1.12k stars 285 forks source link

Python code in scripts folder gets run automatically #51

Closed gregdeon closed 7 years ago

gregdeon commented 7 years ago

Any .py files in chipwhisperer/software/chipwhisperer/capture/scripts will get automatically run (ie: any code outside of functions or classes will be run automatically). This can cause ChipWhisperer to break pretty badly (can't connect to CW hardware, etc).

One way to reproduce is to put the code from Tutorial B11 into the scripts folder.

gregdeon commented 7 years ago

There is no perfect workaround for this - Python code has to be run when it's imported. I'm going to add a README with a warning in this folder. We should encourage people to use if __name__ == "__main__": so this doesn't happen.

gregdeon commented 7 years ago

Warning added in https://github.com/newaetech/chipwhisperer/commit/d4be5a8be0dca19afc99f2c58eb7ab8cb29e7057