Crate libafl_core

Crate libafl_core 

Source
Expand description

LibAFL_core contains core traits used across all crates, including the Error enum and various traits.

§LibAFL_core: Minimal set of core functions shared between LibAFL crates

LibAFL logo

The libafl_core crate has a range of useful functions shared across the LibAFL codebase.

§The LibAFL Project

The LibAFL project is part of AFLplusplus and maintained by

§Contributing

For bugs, feel free to open issues or contact us directly. Thank you for your support. <3

Even though we will gladly assist you in finishing up your PR, try to

  • keep all the crates compiling with stable rust (hide the eventual non-stable code under cfgs.)
  • run cargo nightly fmt on your code before pushing
  • check the output of cargo clippy --all or ./clippy.sh
  • run cargo build --no-default-features to check for no_std compatibility (and possibly add #[cfg(feature = "std")]) to hide parts of your code.

Some parts in this list may sound hard, but don’t be afraid to open a PR if you cannot fix them by yourself. We will gladly assist.

§License
Licensed under either of Apache License, Version 2.0 or MIT license at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
Dependencies under more restrictive licenses, such as GPL or AGPL, can be enabled using the respective feature in each crate when it is present, such as the 'agpl' feature of the libafl crate.

§Feature Flags

§General Features

  • std — Enables features that need rust’s std lib to work, like print, env, … support
  • alloc — Enables all features that allocate in no_std
  • errors_backtrace — Stores the backtraces of all generated Errors. Good for debugging, but may come with a slight performance hit.
  • python — Enable python error conversion
  • nix — Enables nix error conversion
  • postcard — Enables postcard error conversion
  • serde — Enables Serde support for some types

Macros§

format
Re-export of the “format” macro Creates a String using interpolation of runtime expressions.
nonnull_raw_mut
Get a core::ptr::NonNull to a global static mut (or similar).
nonzero
Zero-cost way to construct core::num::NonZeroUsize at compile-time.

Structs§

ClientId
The client ID for various use cases across LibAFL

Enums§

Cow
Re-export of the “format” macro A clone-on-write smart pointer.
Error
Main error struct for LibAFL

Constants§

IP_LOCALHOST
Localhost addr, this is used, for example, for LLMP Client, which connects to this address

Traits§

AsIter
Create an Iterator from a reference
AsIterMut
Create an Iterator from a mutable reference
AsSizedSlice
Can be converted to a slice
AsSizedSliceMut
Can be converted to a mutable slice
AsSlice
Can be converted to a slice
AsSliceMut
Can be converted to a mutable slice
HasLen
Has a length field
HasRefCnt
Has a ref count
IntoOwned
Trait to convert into an Owned type
Named
We need fixed names for many parts of this lib.
Truncate
Trait to truncate slices and maps to a new size

Functions§

vec_init
Create a Vec of the given type with nb_elts elements, initialized in place. The closure must initialize Vec (of size nb_elts * sizeo_of::<T>()).

Type Aliases§

ErrorBacktrace
Error Backtrace type when errors_backtrace feature is enabled (== Backtrace)