fuzzware-fuzzer / fuzzware

Fuzzware's main repository. Start here to install.
Apache License 2.0
302 stars 51 forks source link

How to extend Unicorn Engine with implementation NVIC and SysTick? #18

Closed LittleNewton closed 1 year ago

LittleNewton commented 1 year ago

Fuzzware's code is excellent and clean! I have read the Usenix Paper. In chapter 5, the author said the following:

to achieve precisely reproducible timing behavior, we measure elapsed time by the number of emulated basic blocks. We also extended the Unicorn Engine with an implementation of the interrupt controller (NVIC) and the system tick timer (SysTick), which are defined in the Cortex-M standard.

I am very new to Unicorn Engine. Is that mean the original Unicorn Engine did not implement NVIC and SysTick? Or just for the purpose of the work's reproducibility, you choose to reimplement the two components.

Scepticz commented 1 year ago

Hi LittleNewton,

you are right in your assumption. While Unicorn does contain some source code fragments around interrupt handling, these are not complete and are not exposed outside. This also makes sense from the Unicorn Engine perspective, as Unicorn Engine does not attempt to emulate device/peripheral behavior outside instruction set architecture (ISA) emulation. This is why the NVIC/SysTick logic was needed.

Tobi

Scepticz commented 1 year ago

I am closing this issue