Makefile: allow using BUILD_DIR for outputs The Makefile now supports an optional `BUILD_DIR` variable for out-of-tree builds. When not set, it builds in-tree exactly as before. Key mechanisms: `SRCDIR` — automatically derived from the Makefile's own location using `$(abspath $(lastword $(MAKEFILE_LIST)))`, so it always points to the source tree regardless of where `make` is invoked from. `BUILD_DIR` — user-supplied, optional. When set, all build artifacts (`.o`, `.a`, `.so`, binaries) go there instead of the source tree. `_OBJDIR` — internal variable that equals `BUILD_DIR` when set, or `SRCDIR` when not (backward compat). `VPATH := $(SRCDIR)` — lets Make find `.c` source files in the source tree when building from a different directory. `-I$(SRCDIR)` — replaces the old `-I.` so header includes always resolve against the source tree. `.SECONDEXPANSION:` with `| $$(dir $$@)` order-only prerequisites — ensures build subdirectories (`linux/`, `libhfcommon/`, etc.) are created in `BUILD_DIR` before compilation. All output paths (`OBJS`, `BIN`, `HFUZZ_CC_BIN`, `LHFUZZ_ARCH`, `LCOMMON_ARCH`, `LNETDRIVER_ARCH`, etc.) are prefixed with `$(_OBJDIR)/`.
A security-oriented, feedback-driven, evolutionary fuzzer.
Honggfuzz is a general-purpose fuzzer that uses code coverage (software and hardware-based) to find bugs. It is multi-process, multi-threaded, and supports persistent fuzzing for extreme speed.
ptrace) to detect hijacked signals and hidden crashes.Linux (Ubuntu/Debian)
sudo apt-get install binutils-dev libunwind-dev libblocksruntime-dev clang
macOS Requires Xcode (10.8+) and libblocksruntime.
make # Compilation wrappers are created in hfuzz_cc/
Use the provided compiler wrappers to automatically add instrumentation:
# C code ./hfuzz_cc/hfuzz-clang -o my_target my_target.c # C++ code ./hfuzz_cc/hfuzz-clang++ -o my_target my_target.cpp
Point it to an input corpus directory (can be empty) and your binary:
# Basic run ./honggfuzz -i input_dir/ -- ./my_target ___FILE___ # Persistent mode (faster) ./honggfuzz -P -i input_dir/ -- ./my_target
Note: ___FILE___ is a placeholder for the input filename generated by honggfuzz.
For advanced examples (Apache, OpenSSL, BIND, etc.), check the examples/ directory.
See USAGE.md for detailed options.
Honggfuzz has discovered major security vulnerabilities in critical software.
regex, h2, sleep-parser, lewton(See OSS-Fuzz for hundreds more)
honggfuzz-rs crate for fuzzing Rust code.Apache License 2.0.
This is NOT an official Google product