Crate auditable_info
source ·Expand description
High-level crate to extract the dependency trees embedded in binaries by cargo auditable
.
Deserializes them to a JSON string or Rust data structures, at your option.
ⓘ
// Uses the default limits: 1GiB input file size, 8MiB audit data size
let info = audit_info_from_file(&PathBuf::from("path/to/file"), Default::default())?;
Functions to load the data from a Read
instance or from &[u8]
are also provided.
The supported formats are ELF, PE, Mach-O and WebAssembly.
If you need an even lower-level interface than the one provided by this crate,
use the auditable-extract
and
auditable-serde
crates.
Structs§
- Protects against denial-of-service attacks via infinite input streams or zip bombs, which would otherwise use up all your memory and crash your machine.
Enums§
Functions§
- Loads audit info from the specified binary compiled with
cargo auditable
. - Loads audit info from the binary loaded from an arbitrary reader, e.g. the standard input.
- The input slice should contain the entire binary. This function is useful if you have already loaded the binary to memory, e.g. via memory-mapping.
- Extracts the audit data from the specified binary and returns the JSON string. This is useful if you want to forward the data somewhere instead of parsing it to Rust data structures.
- Extracts the audit data and returns the JSON string. This is useful if you want to forward the data somewhere instead of parsing it to Rust data structures.
- The input slice should contain the entire binary. This function is useful if you have already loaded the binary to memory, e.g. via memory-mapping.