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
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
- Andrea Fioraldi andrea@aflplus.plus
- Dominik Maier dominik@aflplus.plus
- s1341 github@shmarya.net
- Dongjia Zhang toka@aflplus.plus
- Addison Crump me@addisoncrump.info
§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 fmton your code before pushing - check the output of
cargo clippy --allor./clippy.sh - run
cargo build --no-default-featuresto check forno_stdcompatibility (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’sstdlib to work, like print, env, … supportalloc— Enables all features that allocate inno_stderrors_backtrace— Stores the backtraces of all generatedErrors. Good for debugging, but may come with a slight performance hit.python— Enable python error conversionnix— Enables nix error conversionpostcard— Enables postcard error conversionserde— Enables Serde support for some types
Macros§
- format
- Re-export of the “format” macro
Creates a
Stringusing interpolation of runtime expressions. - nonnull_
raw_ mut - Get a
core::ptr::NonNullto a global static mut (or similar). - nonzero
- Zero-cost way to construct
core::num::NonZeroUsizeat compile-time.
Structs§
- Client
Id - The client ID for various use cases across
LibAFL
Enums§
Constants§
- IP_
LOCALHOST - Localhost addr, this is used, for example, for LLMP Client, which connects to this address
Traits§
- AsIter
- Create an
Iteratorfrom a reference - AsIter
Mut - Create an
Iteratorfrom a mutable reference - AsSized
Slice - Can be converted to a slice
- AsSized
Slice Mut - Can be converted to a mutable slice
- AsSlice
- Can be converted to a slice
- AsSlice
Mut - Can be converted to a mutable slice
- HasLen
- Has a length field
- HasRef
Cnt - Has a ref count
- Into
Owned - 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
Vecof the given type withnb_eltselements, initialized in place. The closure must initializeVec(of sizenb_elts*sizeo_of::<T>()).
Type Aliases§
- Error
Backtrace - Error Backtrace type when
errors_backtracefeature is enabled (==Backtrace)