diff options
author | van Hauser <vh@thc.org> | 2020-08-03 13:39:55 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-03 13:39:55 +0200 |
commit | d5d8d664d0d4b95792aaccd16264f3a3cff48cc8 (patch) | |
tree | fa82a04acca16ea3e088b0d7d3aaec4b01ddf8f9 /llvm_mode/README.persistent_mode.md | |
parent | 4a51cb71fb8785325dedac693cdea4648f6e5279 (diff) | |
parent | 409e4ae945ab5aeb31b1e3a1497ce5fc65226f07 (diff) | |
download | afl++-d5d8d664d0d4b95792aaccd16264f3a3cff48cc8.tar.gz |
Merge pull request #477 from AFLplusplus/dev
Push to stable
Diffstat (limited to 'llvm_mode/README.persistent_mode.md')
-rw-r--r-- | llvm_mode/README.persistent_mode.md | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/llvm_mode/README.persistent_mode.md b/llvm_mode/README.persistent_mode.md index 83cc7f4d..4f0bcb2e 100644 --- a/llvm_mode/README.persistent_mode.md +++ b/llvm_mode/README.persistent_mode.md @@ -52,6 +52,21 @@ afl-clang-fast -o fuzz_target fuzz_target.c -lwhat_you_need_for_your_target And that is it! The speed increase is usually x10 to x20. +If you want to be able to compile the target without afl-clang-fast/lto then +add this just after the includes: + +``` +#ifndef __AFL_FUZZ_TESTCASE_LEN + ssize_t fuzz_len; + #define __AFL_FUZZ_TESTCASE_LEN fuzz_len + unsigned char fuzz_buf[1024000]; + #define __AFL_FUZZ_TESTCASE_BUF fuzz_buf + #define __AFL_FUZZ_INIT() void sync(void); + #define __AFL_LOOP(x) ((fuzz_len = read(0, fuzz_buf, sizeof(fuzz_buf))) > 0 ? + #define __AFL_INIT() sync() +#endif +``` + ## 3) deferred initialization AFL tries to optimize performance by executing the targeted binary just once, |