#json #extract #input #tree #binaries #auditable #cargo

auditable-info

High-level crate to extract the dependency trees embedded in binaries by cargo auditable

10 releases

0.7.2 May 8, 2024
0.7.1 May 3, 2024
0.7.0 Apr 27, 2023
0.6.3-alpha.1 Oct 24, 2022
0.5.0-alpha.4 Sep 18, 2022

#590 in Encoding

Download history 8237/week @ 2024-03-30 7793/week @ 2024-04-06 7620/week @ 2024-04-13 8020/week @ 2024-04-20 8332/week @ 2024-04-27 8497/week @ 2024-05-04 9376/week @ 2024-05-11 8268/week @ 2024-05-18 7494/week @ 2024-05-25 8270/week @ 2024-06-01 9385/week @ 2024-06-08 8232/week @ 2024-06-15 8328/week @ 2024-06-22 8257/week @ 2024-06-29 8875/week @ 2024-07-06 7210/week @ 2024-07-13

34,090 downloads per month
Used in 3 crates

MIT/Apache

32KB
410 lines

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.

Features

  • Binary parsing designed from the ground up for resilience to malicious inputs.
  • 100% memory-safe Rust, including all dependencies. (There is some unsafe in serde_json and its dependencies, but only in serialization, which isn't used here).
  • Cross-platform, portable, easy to cross-compile. Runs on any Rust target with std.
  • Parses binaries from any supported platform, not just the platform it's running on.
  • Supports setting size limits for both input and output, to protect against OOMs and zip bombs.

Usage

// 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, see the documentation.

Alternatives

rust-audit-info is a command-line interface to this crate.

If you need a lower-level interface than the one provided by this crate, use the auditable-extract and auditable-serde crates.

Dependencies

~325–780KB
~17K SLoC