fuzzware-fuzzer / fuzzware-emulator

Fuzzware's emulation component. Belongs to fuzzware main repo.
Apache License 2.0
4 stars 15 forks source link

Is there a way to disable fuzz and performed like a normal Unicorn with NVIC support? #5

Open LittleNewton opened 1 year ago

LittleNewton commented 1 year ago

Hi, teams,

Fuzzware's emulate module implementation is so gorgeous. I have learned it for two weeks. Now I need a Unicorn Engine with a well-implemented NVIC module. Compared with coding from scratch, using fuzzware's module directly will be a better choice. After extracting the code, I found it was coupled with fuzzer tightly. Is there a way to disable fuzzing functionality and make it perform like an extended Unicorn Engine? I have tried to disable a few fuzzing-related functions, but I am very afraid it would do damage to the emulator itself.

I will be appreciated to get your response and help.

Scepticz commented 1 year ago

Hi LittleNewton,

you would have to find a way to respond to MMIO accesses in another way than fuzzing input. You could just mark all memory regions as RAM, not MMIO (by removing the mmio prefix from the region names). Then, however, you would make sure that the MMIO values represent something meaningful, or you will get firmware execution stuck trying to read from MMIO status registers.

If you want to fully remove the MMIO behavior (and emulate non-firmware code), then removing the MMIO access handler and removing the interrupt raising logic would be the base start. Apart from that, I am unsure how much additional code needs to get changed.

Tobi