From 55e9297202d646cfe7da8d6c5eb6937952812569 Mon Sep 17 00:00:00 2001 From: Andrea Fioraldi Date: Fri, 17 Jan 2020 16:39:05 +0100 Subject: first experiment cmplog --- src/afl-fuzz.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/afl-fuzz.c') diff --git a/src/afl-fuzz.c b/src/afl-fuzz.c index 0af8b35f..436e71a5 100644 --- a/src/afl-fuzz.c +++ b/src/afl-fuzz.c @@ -100,6 +100,7 @@ static void usage(u8* argv0) { " -f file - location read by the fuzzed program (stdin)\n" " -t msec - timeout for each run (auto-scaled, 50-%d ms)\n" " -m megs - memory limit for child process (%d MB)\n" + " -c program - enable CmpLog specifying a binary compiled for it\n" " -Q - use binary-only instrumentation (QEMU mode)\n" " -U - use unicorn-based instrumentation (Unicorn mode)\n" " -W - use qemu-based instrumentation with Wine (Wine " @@ -193,12 +194,21 @@ int main(int argc, char** argv) { init_seed = tv.tv_sec ^ tv.tv_usec ^ getpid(); while ((opt = getopt(argc, argv, - "+i:I:o:f:m:t:T:dnCB:S:M:x:QNUWe:p:s:V:E:L:hR")) > 0) + "+i:I:o:f:m:t:T:dnCB:S:M:x:QNUWe:p:s:V:E:L:hRP:")) > 0) switch (opt) { case 'I': infoexec = optarg; break; + case 'c': { + + cmplog_mode = 1; + cmplog_binary = ck_strdup(optarg); + // TODO check cmplog_binary validity + break; + + } + case 's': { init_seed = strtoul(optarg, 0L, 10); -- cgit 1.4.1 From b8bad5a2273b0cddd0244a7f37c20150a08af475 Mon Sep 17 00:00:00 2001 From: van Hauser Date: Sun, 19 Jan 2020 22:29:40 +0100 Subject: fix for getopt --- llvm_mode/Makefile | 2 ++ src/afl-fuzz.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'src/afl-fuzz.c') diff --git a/llvm_mode/Makefile b/llvm_mode/Makefile index ebe6b9de..a455dc8a 100644 --- a/llvm_mode/Makefile +++ b/llvm_mode/Makefile @@ -19,6 +19,8 @@ # For Heiko: #TEST_MMAP=1 +AFL_TRACE_PC=1 + PREFIX ?= /usr/local HELPER_PATH = $(PREFIX)/lib/afl BIN_PATH = $(PREFIX)/bin diff --git a/src/afl-fuzz.c b/src/afl-fuzz.c index 436e71a5..e0542648 100644 --- a/src/afl-fuzz.c +++ b/src/afl-fuzz.c @@ -194,7 +194,7 @@ int main(int argc, char** argv) { init_seed = tv.tv_sec ^ tv.tv_usec ^ getpid(); while ((opt = getopt(argc, argv, - "+i:I:o:f:m:t:T:dnCB:S:M:x:QNUWe:p:s:V:E:L:hRP:")) > 0) + "+c:i:I:o:f:m:t:T:dnCB:S:M:x:QNUWe:p:s:V:E:L:hRP:")) > 0) switch (opt) { -- cgit 1.4.1 From b15cd4a82a7e89c3fe604a2bb36b810ab2e62478 Mon Sep 17 00:00:00 2001 From: Andrea Fioraldi Date: Thu, 30 Jan 2020 22:43:04 +0100 Subject: cmplog check_binary --- src/afl-fuzz.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/afl-fuzz.c') diff --git a/src/afl-fuzz.c b/src/afl-fuzz.c index e0542648..50356315 100644 --- a/src/afl-fuzz.c +++ b/src/afl-fuzz.c @@ -204,7 +204,6 @@ int main(int argc, char** argv) { cmplog_mode = 1; cmplog_binary = ck_strdup(optarg); - // TODO check cmplog_binary validity break; } @@ -868,6 +867,8 @@ int main(int argc, char** argv) { if (!out_file) setup_stdio_file(); + if (cmplog_binary) + check_binary(cmplog_binary); check_binary(argv[optind]); start_time = get_cur_time(); -- cgit 1.4.1