Sha256: f0c70bf86680e7afdfdffbf4f3118efc9801516c6898663f574b115b62b1fbcd

Contents?: true

Size: 1.79 KB

Versions: 24

Compression:

Stored size: 1.79 KB

Contents

//! Support for reading PE files.
//!
//! Traits are used to abstract over the difference between PE32 and PE32+.
//! The primary trait for this is [`ImageNtHeaders`].
//!
//! ## High level API
//!
//! [`PeFile`] implements the [`Object`](crate::read::Object) trait for
//! PE files. [`PeFile`] is parameterised by [`ImageNtHeaders`] to allow
//! reading both PE32 and PE32+. There are type aliases for these parameters
//! ([`PeFile32`] and [`PeFile64`]).
//!
//! ## Low level API
//!
//! The [`ImageNtHeaders`] trait can be directly used to parse both
//! [`pe::ImageNtHeaders32`] and [`pe::ImageNtHeaders64`].
//!
//! ### Example for low level API
//!  ```no_run
//! use object::pe;
//! use object::read::pe::ImageNtHeaders;
//! use std::error::Error;
//! use std::fs;
//!
//! /// Reads a file and displays the name of each section.
//! fn main() -> Result<(), Box<dyn Error>> {
//! #   #[cfg(feature = "std")] {
//!     let data = fs::read("path/to/binary")?;
//!     let dos_header = pe::ImageDosHeader::parse(&*data)?;
//!     let mut offset = dos_header.nt_headers_offset().into();
//!     let (nt_headers, data_directories) = pe::ImageNtHeaders64::parse(&*data, &mut offset)?;
//!     let sections = nt_headers.sections(&*data, offset)?;
//!     let symbols = nt_headers.symbols(&*data)?;
//!     for section in sections.iter() {
//!         println!("{}", String::from_utf8_lossy(section.name(symbols.strings())?));
//!     }
//! #   }
//!     Ok(())
//! }
//! ```
#[cfg(doc)]
use crate::pe;

mod file;
pub use file::*;

mod section;
pub use section::*;

mod data_directory;
pub use data_directory::*;

mod export;
pub use export::*;

mod import;
pub use import::*;

mod relocation;
pub use relocation::*;

mod resource;
pub use resource::*;

mod rich;
pub use rich::*;

pub use super::coff::{SectionTable, SymbolTable};

Version data entries

24 entries across 19 versions & 1 rubygems

Version Path
wasmtime-29.0.0 ./ext/cargo-vendor/object-0.36.7/src/read/pe/mod.rs
wasmtime-28.0.0 ./ext/cargo-vendor/object-0.36.7/src/read/pe/mod.rs
wasmtime-27.0.0 ./ext/cargo-vendor/object-0.36.5/src/read/pe/mod.rs
wasmtime-26.0.0 ./ext/cargo-vendor/object-0.36.5/src/read/pe/mod.rs
wasmtime-25.0.2 ./ext/cargo-vendor/object-0.36.3/src/read/pe/mod.rs
wasmtime-25.0.1 ./ext/cargo-vendor/object-0.36.3/src/read/pe/mod.rs
wasmtime-25.0.0 ./ext/cargo-vendor/object-0.36.3/src/read/pe/mod.rs
wasmtime-24.0.0 ./ext/cargo-vendor/object-0.36.3/src/read/pe/mod.rs
wasmtime-23.0.2 ./ext/cargo-vendor/object-0.36.3/src/read/pe/mod.rs
wasmtime-23.0.2 ./ext/cargo-vendor/object-0.32.2/src/read/pe/mod.rs
wasmtime-22.0.0 ./ext/cargo-vendor/object-0.32.2/src/read/pe/mod.rs
wasmtime-22.0.0 ./ext/cargo-vendor/object-0.36.3/src/read/pe/mod.rs
wasmtime-21.0.1 ./ext/cargo-vendor/object-0.32.2/src/read/pe/mod.rs
wasmtime-21.0.1 ./ext/cargo-vendor/object-0.33.0/src/read/pe/mod.rs
wasmtime-20.0.2 ./ext/cargo-vendor/object-0.33.0/src/read/pe/mod.rs
wasmtime-20.0.2 ./ext/cargo-vendor/object-0.32.2/src/read/pe/mod.rs
wasmtime-20.0.0 ./ext/cargo-vendor/object-0.32.2/src/read/pe/mod.rs
wasmtime-20.0.0 ./ext/cargo-vendor/object-0.33.0/src/read/pe/mod.rs
wasmtime-18.0.3 ./ext/cargo-vendor/object-0.32.2/src/read/pe/mod.rs
wasmtime-17.0.1 ./ext/cargo-vendor/object-0.32.2/src/read/pe/mod.rs