Skip to main content

exec_pe_core/
lib.rs

1//! PE (Portable Executable) binary format parser.
2//!
3//! Medium-agnostic: accepts raw `&[u8]` bytes from any source — disk file,
4//! memory dump page, AFF4 stream, network capture, or carved fragment.
5//!
6//! # Quick start
7//!
8//! ```rust,no_run
9//! use exec_pe_core::{parse_pe, PeFile};
10//!
11//! let bytes = std::fs::read("rbcw.exe").unwrap();
12//! let pe = parse_pe(&bytes).expect("valid PE");
13//! println!("machine: {:#06x}", pe.machine);
14//! println!("imports: {:?}", pe.imports);
15//! ```
16
17#![allow(
18    clippy::doc_markdown,
19    clippy::missing_errors_doc,
20    clippy::missing_panics_doc,
21    clippy::must_use_candidate,
22    clippy::cast_possible_truncation,
23    clippy::cast_sign_loss,
24    clippy::cast_precision_loss
25)]
26#![cfg_attr(test, allow(clippy::unwrap_used, clippy::expect_used))]
27
28pub mod anomalies;
29pub mod error;
30pub mod parser;
31pub mod rich_header;
32pub mod strings;
33
34pub use anomalies::{detect_structural_anomalies, PeAnomaly};
35pub use error::PeError;
36pub use parser::{parse_pe, parse_pe_path, PeFile, PeSection};
37pub use rich_header::{parse_rich_header, RichEntry, RichHeader};