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§
- Decompress
Error - A copy of miniz_oxide::inflate::DecompressError.
- Limits
- 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§
- audit_
info_ from_ file - Loads audit info from the specified binary compiled with
cargo auditable
. - audit_
info_ from_ reader - Loads audit info from the binary loaded from an arbitrary reader, e.g. the standard input.
- audit_
info_ from_ slice - 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.
- json_
from_ file - 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.
- json_
from_ reader - 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.
- json_
from_ slice - 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.