summaryrefslogtreecommitdiff
path: root/honggfuzz.c
diff options
context:
space:
mode:
authorrobert.swiecki@gmail.com <robert.swiecki@gmail.com@f4334a76-505f-ddcd-06be-78435f765c3c>2015-04-21 17:12:22 +0000
committerrobert.swiecki@gmail.com <robert.swiecki@gmail.com@f4334a76-505f-ddcd-06be-78435f765c3c>2015-04-21 17:12:22 +0000
commit4f1124fb655c0dab2e18a130199e5f15ab013585 (patch)
tree2e20c6eb5b31c38c737a278c44debd338c94a3e1 /honggfuzz.c
parent394d95e618681fb2356074f9dc499f8f44a25b22 (diff)
downloadhonggfuzz-4f1124fb655c0dab2e18a130199e5f15ab013585.tar.gz
Support for word dictionaries
Diffstat (limited to 'honggfuzz.c')
-rw-r--r--honggfuzz.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/honggfuzz.c b/honggfuzz.c
index 971d3308..63f9e39d 100644
--- a/honggfuzz.c
+++ b/honggfuzz.c
@@ -68,6 +68,7 @@ static void usage(bool exit_success)
"' [INFO])\n"
" [" AB "-e val" AC "] : file extension (e.g. 'swf'), (default: '" AB "fuzz" AC "')\n"
" [" AB "-r val" AC "] : flip rate, (default: '" AB "0.001" AC "')\n"
+ " [" AB "-w val" AC "] : wordlist, (default: empty) [tokens delimited by NUL-bytes]\n"
" [" AB "-c val" AC "] : external command modifying the input corpus of files,\n"
" instead of -r/-m (default: " AB "none" AC ")\n"
" [" AB "-t val" AC "] : timeout (in secs), (default: '" AB "3" AC "' [0 - no timeout])\n"
@@ -134,6 +135,9 @@ int main(int argc, char **argv)
.fileExtn = "fuzz",
.flipRate = 0.001f,
.externalCommand = NULL,
+ .dictionaryFile = NULL,
+ .dictionary = NULL,
+ .dictionaryCnt = 0,
.maxFileSz = (1024 * 1024),
.tmOut = 3,
.mutationsMax = 0,
@@ -160,7 +164,7 @@ int main(int argc, char **argv)
}
for (;;) {
- c = getopt(argc, argv, "-?hqsuf:d:e:r:c:F:D:t:a:R:n:N:l:p:g:o:E:");
+ c = getopt(argc, argv, "-?hqsuf:d:e:r:c:F:D:t:a:R:n:N:l:p:g:o:E:w:");
if (c < 0)
break;
@@ -254,6 +258,9 @@ int main(int argc, char **argv)
}
}
break;
+ case 'w':
+ hfuzz.dictionaryFile = optarg;
+ break;
default:
break;
}
@@ -309,6 +316,10 @@ int main(int argc, char **argv)
exit(EXIT_FAILURE);
}
+ if (hfuzz.dictionaryFile && (files_parseDictionary(&hfuzz) == false)) {
+ LOGMSG(l_FATAL, "Couldn't parse dictionary file ('%s')", hfuzz.dictionaryFile);
+ }
+
/*
* So far so good
*/