Cargo Features

[dependencies]
libafl_bolts = { version = "0.14.0", default-features = false, features = ["document-features", "std", "alloc", "derive", "rand_trait", "python", "prelude", "cli", "qemu_cli", "frida_cli", "errors_backtrace", "gzip", "xxh3", "stable_anymap", "serdeany_autoreg", "llmp_bind_public", "llmp_compression", "llmp_debug", "llmp_small_maps"] }
default = alloc, derive, gzip, llmp_compression, llmp_small_maps, 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.

document-features

Enables document-features

Document all features of this crate (for cargo doc)

std default llmp_debug? python? = alloc, backtrace, hostname, nix, 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

serialization lib

Affects fs::InputFile, fs::find_new_files_rec, 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::Brokers

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 and serde

erased-serde:

erased serde

Affects libafl_bolts::anymap, libafl_bolts::llmp, libafl_bolts::ownedref, libafl_bolts::serdeany, libafl_bolts::subrange, libafl_bolts::Named, libafl_bolts::format_duration_hms, os::pipes, unix_signals::SignalHandler, unix_signals::setup_signal_handler, windows_exceptions::ExceptionHandler, windows_exceptions::setup_exception_handler, rands::loaded_dice, shmem::NopShMemProvider, shmem::NopShMem, shmem::RcShMem, tuples::IntoVec, tuples::NamedTuple, tuples::MatchName, tuples::Handled

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

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::FridaScriptBackend, 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, cli::FuzzerOptions.backend, 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

stable_anymap

SerdeAny features

With this feature, the AnyMap uses type_name instead of TypeId::of for deserialization. With this feature, stored state remains deserializable across multiple compilations of LibAFL. The rust doc specifically states that "multiple types may map to the same type name", so it could potentially lead to bugs. However, we make sure that no two types with the same name ever exist.

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 0.0.0.0, 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 ^0.14.5

A faster hashmap, nostd compatible

xxhash-rust xxh3

Enables xxhash-rust

xxh3 hashing for rust

erased-serde alloc
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
miniz_oxide gzip
hostname std

Enables hostname

Is there really no gethostname in the stdlib?

rand_core rand_trait
nix std
uuid std
clap cli?

Enables clap

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

pyo3 python?

Enables pyo3 ^0.22.3

serial_test std

Enables serial_test

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

uds unix std