diff options
author | van Hauser <vh@thc.org> | 2020-06-11 19:30:28 +0200 |
---|---|---|
committer | van Hauser <vh@thc.org> | 2020-06-11 19:30:28 +0200 |
commit | e8da5f9e2894a89e36f899719e442a897a189f1f (patch) | |
tree | f9125658bf6908c9341399cc161cedd606eb3d14 /examples | |
parent | b3fee6cab21a99d6ead890df7422f63af4a4f2ad (diff) | |
download | afl++-e8da5f9e2894a89e36f899719e442a897a189f1f.tar.gz |
code format and debug
Diffstat (limited to 'examples')
-rw-r--r-- | examples/aflpp_driver/GNUmakefile | 2 | ||||
-rw-r--r-- | examples/aflpp_driver/aflpp_driver.cpp | 6 |
2 files changed, 6 insertions, 2 deletions
diff --git a/examples/aflpp_driver/GNUmakefile b/examples/aflpp_driver/GNUmakefile index 7ddfc485..90844a4a 100644 --- a/examples/aflpp_driver/GNUmakefile +++ b/examples/aflpp_driver/GNUmakefile @@ -18,7 +18,7 @@ libAFLDriver.a: aflpp_driver.o ar ru libAFLDriver.a aflpp_driver.o debug: - $(LLVM_BINDIR)clang++ -D_DEBUG=\"1\" $(FLAGS) -stdlib=libc++ -funroll-loops -std=c++11 -c aflpp_driver.cpp + $(LLVM_BINDIR)clang++ -I../../include -D_DEBUG=\"1\" $(FLAGS) -stdlib=libc++ -funroll-loops -std=c++11 -c aflpp_driver.cpp ar ru libAFLDriver.a aflpp_driver.o diff --git a/examples/aflpp_driver/aflpp_driver.cpp b/examples/aflpp_driver/aflpp_driver.cpp index a60eb264..88354912 100644 --- a/examples/aflpp_driver/aflpp_driver.cpp +++ b/examples/aflpp_driver/aflpp_driver.cpp @@ -54,6 +54,10 @@ If 1, close stdout at startup. If 2 close stderr; if 3 close both. #include <iostream> #include <vector> +#ifdef _DEBUG +#include "hash.h" +#endif + // Platform detection. Copied from FuzzerInternal.h #ifdef __linux__ #define LIBFUZZER_LINUX 1 @@ -273,7 +277,7 @@ int main(int argc, char **argv) { int num_runs = 0; while (__afl_persistent_loop(N)) { #ifdef _DEBUG - fprintf(stderr, "len: %u\n", *__afl_fuzz_len); + fprintf(stderr, "CLIENT crc: %08x len: %u\n", hash32(__afl_fuzz_ptr, *__afl_fuzz_len, 0xa5b35705), *__afl_fuzz_len); #endif if (*__afl_fuzz_len) { num_runs++; |