about summary refs log tree commit diff
path: root/examples/aflpp_driver/aflpp_driver.cpp
diff options
context:
space:
mode:
authorvan Hauser <vh@thc.org>2020-06-29 18:19:35 +0200
committerGitHub <noreply@github.com>2020-06-29 18:19:35 +0200
commit8f1b78f49e8efef8ec089230d732cdee7b37fa9a (patch)
tree4cb5e6e59f24f488e58fbb1aced2dbc0e6550c15 /examples/aflpp_driver/aflpp_driver.cpp
parent12bdefe00e38cdc3dd8cb028eeac325ab2e94e16 (diff)
parent3a0c91b86205bfebb8ec7e62a2e7b0bfcec2e407 (diff)
downloadafl++-8f1b78f49e8efef8ec089230d732cdee7b37fa9a.tar.gz
Merge pull request #426 from AFLplusplus/dev
Dev
Diffstat (limited to 'examples/aflpp_driver/aflpp_driver.cpp')
-rw-r--r--examples/aflpp_driver/aflpp_driver.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/examples/aflpp_driver/aflpp_driver.cpp b/examples/aflpp_driver/aflpp_driver.cpp
index a60eb264..d6163bdf 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,11 @@ 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: %016llx len: %u\n", hash64(__afl_fuzz_ptr, *__afl_fuzz_len, 0xa5b35705), *__afl_fuzz_len);
+    fprintf(stderr, "RECV:");
+    for (int i = 0; i < *__afl_fuzz_len; i++)
+      fprintf(stderr, "%02x", __afl_fuzz_ptr[i]);
+    fprintf(stderr,"\n");
 #endif
     if (*__afl_fuzz_len) {
       num_runs++;