Module pe
Expand description
Module for the PE file format support in LIEF.
The Binary structure exposes the main API to inspect a PE file. It can be instantiated,
using either: crate::pe::parse, crate::pe::Binary::parse or crate::Binary::parse
let pe = lief::pe::parse("demo.exe").unwrap();
for section in pe.sections() {
println!("section: {}", section.name());
}Modules§
- binary
- builder
- chpe_
metadata_ arm64 - chpe_
metadata_ x86 - code_
integrity - data_
directory - PE Data Directory module
- debug
- Module that wraps the different debug information structure we can find in a PE binary.
- delay_
import - PE Delayed import module
- dynamic_
fixups - dynamic_
relocation - Module related to dynamic relocations (DVRT)
- enclave_
configuration - PE enclave configuration
- exception
- Module for the PE exception support
- exception_
aarch64 - This module contains structures related to the ARM64 exception support in PE files
- exception_
x64 - Module related to the x86_64 exception unwinding support
- export
- PE export module
- factory
- PE Factory module for creating PE binaries from scratch
- headers
- This module exposes the different headers that we can find in a PE binary. It includes:
- import
- This module represents PE’s Imports
- load_
configuration - parser_
config - relocation
- This module includes the different structures related to the relocation process in a PE binary
- resources
- This module contains the different structures involved in the PE’s resource tree
- rich_
header - PE Rich Header module
- section
- PE section module
- signature
- This module wraps the PKCS #7 PE authenticode signature
- tls
- This module represents the PE’s Thread Local Storage (TLS)
- volatile_
metadata - PE volatile memory metadata
Structs§
- Binary
- This is the main interface to read and write PE binary attributes.
- Data
Directory - Delay
Import - DosHeader
- Structure which represents the DosHeader, the first structure presents at the beginning of a PE file.
- Enclave
Configuration - Defines an entry in the array of images that an enclave can import.
- Enclave
Import - This structure represents an entry in the array of images that an enclave can import.
- Export
- Factory
- Factory for creating PE binaries from scratch
- Header
- Structure that represents the PE header (which follows the
DosHeader) - Import
- Load
Configuration - This structure represents the load configuration data associated with the
IMAGE_LOAD_CONFIG_DIRECTORY. - Optional
Header - Structure which represents the PE OptionalHeader (after
Header). - Parser
Config - This structure is used to configure the behavior of the PE Parser:
crate::pe::Binary::parse_with_config - Relocation
- Class which represents the Base Relocation Block
We usually find this structure in the
.relocsection - Resource
Accelerator - Represents a PE accelerator resource entry
- Resource
Icon - Represents a PE icon resource
- Resource
String Entry - Represents a string table entry from the ResourcesManager
- Resource
Version - Represents a PE version resource
- Resources
Manager - This manager abstracts the tree representation to provide a comprehensive API over the information wrapped by the resources tree.
- Rich
Entry - Rich
Header - Structure which represents the not-so-documented rich header
- Section
- This structure defines a regular PE section.
- Signature
- TLS
- Volatile
Metadata - This class represents volatile metadata which can be enabled at link time
with
/volatileMetadata.
Enums§
- Algorithms
- CHPE
Metadata - Dynamic
Fixup - This enum wraps the different fixups that can be associated with a
crate::pe::DynamicRelocation - Dynamic
Relocation - This enum wraps the different versions of dynamic relocations:
- Imphash
Mode - Mode used for computing the import hash
- PE_TYPE
- PE type: 32-bit or 64-bit
- Resource
Node - This enum represents a node in the resource tree which can be either: a directory node or a data (leaf) node.
- Runtime
Exception Function - Enum that wraps the different kinds of runtime functions associated with exceptions
Traits§
- Exception
Info - Trait shared by all runtime functions
Functions§
- check_
layout - Check that the layout of the given binary is correct from the Windows loader perspective
- get_
imphash - Compute the import hash of the given binary
- get_
type - Determine the PE type (PE32 or PE32+) of the given file
- oid_
to_ string - Convert an OID string to a human-readable string
- parse
- Parse a PE file from the given file path
- parse_
from_ dump - Parse the PE binary from a memory dump located at
paththat was mapped at the virtual addressaddr - parse_
from_ dump_ with_ config - Same as
parse_from_dumpbut with a provided configuration - parse_
from_ memory - Parse the PE binary at the given memory address
- parse_
from_ memory_ with_ config - Parse the PE binary at the given memory address
- parse_
with_ config - Parse a PE file from the given file path and configuration
- resolve_
ordinals - Try to resolve import ordinals using the well-known ordinal lookup table