emsec / ChameleonMini

The ChameleonMini is a versatile contactless smartcard emulator compliant to NFC. The ChameleonMini was developed by https://kasper-oswald.de. The device is available at https://shop.kasper.it. For further information see the Getting Started Page https://rawgit.com/emsec/ChameleonMini/master/Doc/Doxygen/html/_page__getting_started.html or the Wiki tab above.
Other
1.73k stars 392 forks source link

Elf sections size check before flashing #284

Closed ceres-c closed 3 years ago

ceres-c commented 3 years ago

Lately some issues have been popping up in both this repo https://github.com/emsec/ChameleonMini/issues/281 and RRG https://github.com/RfidResearchGroup/ChameleonMini/issues/43. I also faced similar "randomic" issues but initially discarded them as unlucky flash. When investigating the issue, @fptrs pointed me in the right direction and all these issues were due to code being written in the FRAM section used to store card configs. @maxieds opened an issue (https://github.com/emsec/ChameleonMini/issues/283) to confront on the best way to properly solve this problem, but I believe checking memory usage might be useful in any case.

I have tested this code on both linux and windows (cygwin basic install)