about summary refs log tree commit diff
path: root/utils/aflpp_driver/README.md
diff options
context:
space:
mode:
authorvan Hauser <vh@thc.org>2021-04-16 13:53:08 +0200
committerGitHub <noreply@github.com>2021-04-16 13:53:08 +0200
commit400ab10cfdfdb25235bf0483bc0fa0332ae11461 (patch)
treec5f5c705b502109917f722ed79549e281f5a02c3 /utils/aflpp_driver/README.md
parent98989f1088d04dd4c0d21834c38b7683f1cfb42d (diff)
parent5dad04867461e93cefd1ecee6d336fa4d9ef632d (diff)
downloadafl++-400ab10cfdfdb25235bf0483bc0fa0332ae11461.tar.gz
Merge branch 'dev' into dev
Diffstat (limited to 'utils/aflpp_driver/README.md')
-rw-r--r--utils/aflpp_driver/README.md30
1 files changed, 30 insertions, 0 deletions
diff --git a/utils/aflpp_driver/README.md b/utils/aflpp_driver/README.md
new file mode 100644
index 00000000..01bd10c0
--- /dev/null
+++ b/utils/aflpp_driver/README.md
@@ -0,0 +1,30 @@
+# afl++ drivers
+
+## aflpp_driver
+
+aflpp_driver is used to compile directly libfuzzer `LLVMFuzzerTestOneInput()`
+targets.
+
+Just do `afl-clang-fast++ -o fuzz fuzzer_harness.cc libAFLDriver.a [plus required linking]`.
+
+You can also sneakily do this little trick: 
+If this is the clang compile command to build for libfuzzer:
+  `clang++ -o fuzz -fsanitize=fuzzer fuzzer_harness.cc -lfoo`
+then just switch `clang++` with `afl-clang-fast++` and our compiler will
+magically insert libAFLDriver.a :)
+
+
+## aflpp_qemu_driver
+
+aflpp_qemu_driver is used for libfuzzer `LLVMFuzzerTestOneInput()` targets that
+are to be fuzzed in qemu_mode. So we compile them with clang/clang++, without
+-fsantize=fuzzer or afl-clang-fast, and link in libAFLQemuDriver.a:
+
+`clang++ -o fuzz fuzzer_harness.cc libAFLQemuDriver.a [plus required linking]`.
+
+
+Then just do (where the name of the binary is `fuzz`):
+```
+AFL_QEMU_PERSISTENT_ADDR=0x$(nm fuzz | grep "T LLVMFuzzerTestOneInput" | awk '{print $1}')
+AFL_QEMU_PERSISTENT_HOOK=/path/to/aflpp_qemu_driver_hook.so afl-fuzz -Q ... -- ./fuzz`
+```