Closed J08nY closed 1 year ago
This is a very nice idea. I tried in the past to implement something similar but I stopped when the binary is dynamically linked to a third-party library (for bigint math, for example)
I'd be interested in having other people ideas and hints on how to emulate a binary depending on external .so files
This would be used through pyecsca-codegen which generates statically linked binaries for the ARM target case and I am unsure of what it does for binaries targeting the host (x86_64). But no matter what it does I think it could be made to generate statically linked binaries as its only dependency currently is libtommath for bigints (and that has a static .a version). Of course adding more dependencies with some dynamically linked is a whole another bag of worms.
Nice.
I'll try the codegen module!
Rainbow: https://github.com/Ledger-Donjon/rainbow can be used to simulate execution of a binary target (like ARM-Cortex M4 or some x86). The simulated execution can then be used for leakage simulation by applying a given leakage function (+ noise).
Concretely, get inspired by: https://github.com/Ledger-Donjon/rainbow/blob/master/examples/CortexM_AES/cortexm_aes.py
As the actual chip that ChipWhisperer targets is an STM32F303 (and not an STM32F215 as already in Rainbow), a custom device class for it might be needed. The SVD data for it can be found here and extracted from the XML (.SVD) file. More data on the memory map can be found here or also in the LinkerScript included in the hal directory for the chip.