mirror of
https://github.com/ringtailsoftware/uvm32.git
synced 2026-06-05 22:43:39 +00:00
Simple fuzzer
This commit is contained in:
parent
0736381925
commit
7313047fd1
2 changed files with 32 additions and 0 deletions
23
hosts/fuzz/fuzz.c
Normal file
23
hosts/fuzz/fuzz.c
Normal 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;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue