pub struct PeFile {
pub path: PathBuf,
pub architecture: Architecture,
pub is_dll: bool,
pub image_base: u64,
pub entry_point_rva: u32,
pub export_directory: Option<ExportDirectory>,
pub exports: Vec<ExportInfo>,
}Expand description
Parsed PE file information.
Fields§
§path: PathBufFile path.
architecture: ArchitectureCPU architecture.
is_dll: boolWhether this is a DLL (vs EXE).
image_base: u64Image base address.
entry_point_rva: u32Entry point RVA.
export_directory: Option<ExportDirectory>Export directory (if present).
exports: Vec<ExportInfo>All exports.
Implementations§
Source§impl PeFile
impl PeFile
Sourcepub fn parse(path: impl AsRef<Path>) -> Result<Self>
pub fn parse(path: impl AsRef<Path>) -> Result<Self>
Parse a PE file from the given path.
use xll_utils::PeFile;
let pe = PeFile::parse("my_xll.xll").unwrap();
assert!(pe.is_dll());Sourcepub fn from_bytes(data: &[u8]) -> Result<Self>
pub fn from_bytes(data: &[u8]) -> Result<Self>
Parse a PE file from an in-memory byte slice.
Sourcepub fn export_directory(&self) -> Option<&ExportDirectory>
pub fn export_directory(&self) -> Option<&ExportDirectory>
Get the export directory, if present.
Sourcepub fn exports(&self) -> &[ExportInfo]
pub fn exports(&self) -> &[ExportInfo]
Get all exports.
Sourcepub fn architecture(&self) -> Architecture
pub fn architecture(&self) -> Architecture
Get the CPU architecture.
Sourcepub fn find_export(&self, name: &str) -> Option<&ExportInfo>
pub fn find_export(&self, name: &str) -> Option<&ExportInfo>
Find an export by name.
Sourcepub fn find_export_by_ordinal(&self, ordinal: u32) -> Option<&ExportInfo>
pub fn find_export_by_ordinal(&self, ordinal: u32) -> Option<&ExportInfo>
Find an export by ordinal.
Sourcepub fn export_names(&self) -> Vec<String>
pub fn export_names(&self) -> Vec<String>
Get export names as a sorted vector.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PeFile
impl RefUnwindSafe for PeFile
impl Send for PeFile
impl Sync for PeFile
impl Unpin for PeFile
impl UnsafeUnpin for PeFile
impl UnwindSafe for PeFile
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more