Cargo Features

libafl_bolts = { version = "0.12.0", default-features = false, features = ["document-features", "std", "alloc", "derive", "rand_trait", "python", "prelude", "cli", "qemu_cli", "frida_cli", "errors_backtrace", "gzip", "xxh3", "unsafe_stable_anymap", "serdeany_autoreg", "llmp_bind_public", "llmp_compression", "llmp_debug", "llmp_small_maps"] }
default = alloc, derive, gzip, llmp_compression, llmp_small_maps, prelude, rand_trait, serdeany_autoreg, std, xxh3

These default features are set whenever libafl_bolts is added without default-features = false somewhere in the dependency tree.


Enables document-features

Document all features of this crate (for cargo doc)

std default llmp_debug? python? = alloc, backtrace, hostname, nix, serde_json, serial_test, uds, uuid

Feature Flags

General Features

Enables features that need rust's std lib to work, like print, env, ... support

Enables std of serde and serde_json


serialization lib

Affects core_affinity::parse_core_bind_arg, fs::InputFile, libafl_bolts::build_id, libafl_bolts::core_affinity, libafl_bolts::fs, libafl_bolts::minibsod, libafl_bolts::staterestore, libafl_bolts::current_time, libafl_bolts::LIBAFL_STDERR_LOGGER, libafl_bolts::LIBAFL_STDOUT_LOGGER, libafl_bolts::SimpleStdoutLogger, libafl_bolts::SimpleStderrLogger, libafl_bolts::SimpleFdLogger, libafl_bolts::dup_and_mute_outputs, libafl_bolts::set_error_print_panic_hook, llmp::Listener, llmp::ListenerStream, llmp::send_tcp_msg, llmp::recv_tcp_msg, llmp::LlmpShutdownSignalHandler

alloc default gzip llmp_bind_public? llmp_compression llmp_debug? llmp_small_maps std = ahash, hashbrown, postcard

Enables all features that allocate in no_std

Enables alloc of erased-serde ^0.3.21 and serde


erased serde

Affects libafl_bolts::anymap, libafl_bolts::llmp, libafl_bolts::ownedref, libafl_bolts::serdeany, libafl_bolts::format_duration_hms, unix_signals::Handler, unix_signals::setup_signal_handler, windows_exceptions::Handler, windows_exceptions::setup_exception_handler, shmem::RcShMem, tuples::IntoVec, libafl_bolts::tuples, libafl_bolts::hasher_std, libafl_bolts::hash_std

derive default = libafl_derive

Provide the #[derive(SerdeAny)] macro.

rand_trait default = rand_core

If set, libafl_bolt's rand implementations will implement rand::Rng

python = pyo3, std

Will build the pyo3 bindings

Affects libafl_bolts::pybind, rands::pybind

prelude default

Expose libafl::prelude for direct access to all types without additional use directives

Affects libafl_bolts::bolts_prelude, libafl_bolts::prelude

cli frida_cli? qemu_cli? = clap

Expose libafl_bolts::cli for easy commandline parsing of common fuzzer settings

qemu_cli = cli

Enables extra commandline flags for qemu-based fuzzers in cli

Affects cli::FuzzerOptions.qemu_args, libafl_bolts::cli

frida_cli = cli

Enables extra commandline flags for frida-based fuzzers in cli

Affects cli::FuzzerOptions.asan_cores, cli::FuzzerOptions.harness_function, cli::FuzzerOptions.libs_to_instrument, cli::FuzzerOptions.cmplog_cores, cli::FuzzerOptions.detect_leaks, cli::FuzzerOptions.continue_on_error, cli::FuzzerOptions.allocation_backtraces, cli::FuzzerOptions.max_allocation, cli::FuzzerOptions.max_total_allocation, cli::FuzzerOptions.max_allocation_panics, cli::FuzzerOptions.disable_coverage, cli::FuzzerOptions.drcov, cli::FuzzerOptions.disable_excludes, cli::FuzzerOptions.dont_instrument, libafl_bolts::cli

errors_backtrace = backtrace

Stores the backtraces of all generated Errors. Good for debugging, but may come with a slight performance hit.

Affects libafl_bolts::ErrorBacktrace

gzip default llmp_compression = alloc, miniz_oxide

Enables gzip compression in certain parts of the lib

Affects libafl_bolts::compress

xxh3 default = xxhash-rust

Replaces ahash with the potentially faster xxh3 in some parts of the lib. This yields a stable and fast hash, but may increase the resulting binary size slightly This also enables certain hashing and rand features in no_std no-alloc.

Affects libafl_bolts::tuples, libafl_bolts::hasher_std, libafl_bolts::hash_std


SerdeAny features

With this feature, the AnyMap uses type_name instead of TypeId::of for deserialization. With this feature, stored state may remain deserializable across multiple compilations of LibAFL. This is unsafe and may lead to type confusions. Only use when you know what you are doing/ you have tests in place. The rust doc specifically states that "multiple types may map to the same type name"!

Affects serdeany::TypeRepr

serdeany_autoreg default = ctor

Automatically register all #[derive(SerdeAny)] types at startup.

llmp_bind_public = alloc

### LLMP features

If set, llmp will bind to, allowing cross-device communication. Binds to localhost by default.

llmp_compression default = alloc, gzip

Enables llmp compression using GZip

llmp_debug = alloc, std

Enables debug output for LLMP (also needs a logger installed)

llmp_small_maps default = alloc

Reduces the initial map size for llmp

Features from optional dependencies

In crates that don't use the dep: syntax, optional dependencies automatically become Cargo features. These features may have been created by mistake, and this functionality may be removed in the future.

libafl_derive derive
hashbrown alloc

Enables hashbrown

A faster hashmap, nostd compatible

xxhash-rust xxh3

Enables xxhash-rust

xxh3 hashing for rust

erased-serde alloc

Enables erased-serde ^0.3.21

postcard alloc

Enables postcard

no_std compatible serde serialization format

ahash alloc

Enables ahash

The hash function already used in hashbrown

backtrace errors_backtrace? std

Enables backtrace

Used to get the stacktrace in StacktraceObserver

ctor serdeany_autoreg
serde_json std
miniz_oxide gzip
hostname std

Enables hostname ^0.3

Is there really no gethostname in the stdlib?

rand_core rand_trait
nix std

Enables nix ^0.27

uuid std
clap cli?

Enables clap

CLI parsing, for libafl_bolts::cli / the cli feature

pyo3 python?

Enables pyo3 ^0.18

serial_test std

Enables serial_test ^2

optional-dev deps (change when target.'cfg(accessible(::std))'.test-dependencies will be stable)

uds unix std