Simple fuzzer

This commit is contained in:
Toby Jaffey 2025-12-14 12:34:53 +00:00
parent 0736381925
commit 7313047fd1
2 changed files with 32 additions and 0 deletions

23
hosts/fuzz/fuzz.c Normal file
View file

@ -0,0 +1,23 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include "uvm32.h"
#include "../common/uvm32_common_custom.h"
__AFL_FUZZ_INIT();
int main(int argc, char *argv[]) {
__AFL_INIT();
uvm32_state_t vmst;
uvm32_evt_t evt;
uvm32_init(&vmst);
unsigned char *rom = __AFL_FUZZ_TESTCASE_BUF;
while (__AFL_LOOP(10000)) {
uvm32_load(&vmst, rom, __AFL_FUZZ_TESTCASE_LEN);
uvm32_run(&vmst, &evt, 1000);
}
return 0;
}