ref: fec097a955f38b89aee5228c7cf4a900144b80fd
parent: 26963af9da103c17f68ae03b615bdd642ca156c3
author: seh <seh@localhost>
date: Mon Nov 26 12:00:02 EST 2018
add -s flag
--- a/main.c
+++ b/main.c
@@ -9,7 +9,7 @@
void
usage(void)
{
- fprint(2, "usage: %s [-n rounds] calls\n", argv0);
+ fprint(2, "usage: %s [-s seed] [-n rounds] calls\n", argv0);
exits("usage");
}
@@ -66,6 +66,7 @@
int nrounds = -1, i;
List tofuzz = mklist() ; // List of syscall table ID's to fuzz
char* arg;
+ long fuzz_seed = truerand();
ARGBEGIN{
case 'n':
@@ -75,6 +76,13 @@
usage();
nrounds = atoi(arg);
break;
+ case 's':
+ // Seed to fuzz from
+ arg = ARGF();
+ if(arg == nil)
+ usage();
+ fuzz_seed = atol(arg);
+ break;
default:
usage();
}ARGEND
@@ -115,7 +123,6 @@
exits("log file create fail");
}
- int fuzz_seed = truerand();
srand(fuzz_seed);
dolog("== Seed Value: %d ==\n", fuzz_seed);