object

A unified interface for reading and writing object file formats

Latest version: 0.36.5 registry icon
Maintenance score
100
Safety score
100
Popularity score
53
Check your open source dependency risks. Get immediate insight about security, stability and licensing risks.
Security
  Vulnerabilities
Version Suggest Low Medium High Critical
0.36.5 0 0 0 0 0
0.36.4 0 0 0 0 0
0.36.3 0 0 0 0 0
0.36.2 0 0 0 0 0
0.36.1 0 0 0 0 0
0.36.0 0 0 0 0 0
0.35.0 0 0 0 0 0
0.34.0 0 0 0 0 0
0.33.0 0 0 0 0 0
0.32.2 0 0 0 0 0
0.32.1 0 0 0 0 0
0.32.0 0 0 0 0 0
0.31.1 0 0 0 0 0
0.31.0 0 0 0 0 0
0.30.4 0 0 0 0 0
0.30.3 0 0 0 0 0
0.30.2 0 0 0 0 0
0.30.1 0 0 0 0 0
0.30.0 0 0 0 0 0
0.29.0 0 0 0 0 0
0.28.4 0 0 0 0 0
0.28.3 0 0 0 0 0
0.28.2 0 0 0 0 0
0.28.1 0 0 0 0 0
0.28.0 0 0 0 0 0
0.27.1 0 0 0 0 0
0.27.0 0 0 0 0 0
0.26.2 0 0 0 0 0
0.26.1 0 0 0 0 0
0.26.0 0 0 0 0 0
0.25.3 0 0 0 0 0
0.25.2 0 0 0 0 0
0.25.1 0 0 0 0 0
0.25.0 0 0 0 0 0
0.24.0 0 0 0 0 0
0.23.0 0 0 0 0 0
0.22.0 0 0 0 0 0
0.21.1 0 0 0 0 0
0.21.0 0 0 0 0 0
0.20.0 0 0 0 0 0
0.19.0 0 0 0 0 0
0.18.0 0 0 0 0 0
0.17.0 0 0 0 0 0
0.16.0 0 0 0 0 0
0.15.0 0 0 0 0 0
0.14.1 0 0 0 0 0
0.14.0 0 0 0 0 0
0.13.0 0 0 0 0 0
0.12.0 0 0 0 0 0
0.11.0 0 0 0 0 0
0.10.0 0 0 0 0 0
0.9.0 0 0 0 0 0
0.8.0 0 0 0 0 0
0.7.0 0 0 0 0 0
0.6.0 0 0 0 0 0
0.5.0 0 0 0 0 0
0.4.1 0 0 0 0 0
0.4.0 0 0 0 0 0
0.3.0 0 0 0 0 0
0.1.0 0 0 0 0 0
0.0.2 0 0 0 0 0
0.0.1 0 0 0 0 0

Stability
Latest release:

0.36.5 - This version is safe to use because it has no known security vulnerabilities at this time. Find out if your coding project uses this component and get notified of any reported security vulnerabilities with Meterian-X Open Source Security Platform

Licensing

Maintain your licence declarations and avoid unwanted licences to protect your IP the way you intended.

Apache-2.0   -   Apache License 2.0

Not a wildcard

Not proprietary

OSI Compliant


MIT   -   MIT License

Not a wildcard

Not proprietary

OSI Compliant



object

The object crate provides a unified interface to working with object files across platforms. It supports reading relocatable object files and executable files, and writing COFF/ELF/Mach-O/XCOFF relocatable object files and ELF/PE executable files.

For reading files, it provides multiple levels of support:

  • raw struct definitions suitable for zero copy access
  • low level APIs for accessing the raw structs (example)
  • a higher level unified API for accessing common features of object files, such as sections and symbols (example)

Supported file formats for reading: ELF, Mach-O, Windows PE/COFF, Wasm, XCOFF, and Unix archive.

For writing files, it provides:

  • low level writers for ELF, PE, and COFF
  • higher level builder for ELF (example)
  • a unified API for writing relocatable object files (ELF, Mach-O, COFF, XCOFF) (example)

Example for unified read API

use object::{Object, ObjectSection};
use std::error::Error;
use std::fs;

/// Reads a file and displays the name of each section.
fn main() -> Result<(), Box<dyn Error>> {
    let binary_data = fs::read("path/to/binary")?;
    let file = object::File::parse(&*binary_data)?;
    for section in file.sections() {
        println!("{}", section.name()?);
    }
    Ok(())
}

See crates/examples for more examples.

Minimum Supported Rust Version (MSRV)

Changes to MSRV are considered breaking changes. We are conservative about changing the MSRV, but sometimes are required to due to dependencies. The MSRV is 1.65.0.

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.