PE

Struct PE 

Source
pub struct PE {
    pub base: *mut c_void,
}
Expand description

Portable Executable (PE) abstraction over a module’s in-memory image.

Fields§

§base: *mut c_void

Base address of the loaded module.

Implementations§

Source§

impl PE

Source

pub fn parse(base: *mut c_void) -> Self

Creates a new PE instance from a module base.

Source

pub fn dos_header(&self) -> *const IMAGE_DOS_HEADER

Returns the DOS header of the module.

Source

pub fn nt_header(&self) -> Option<*const IMAGE_NT_HEADERS>

Returns a pointer to the IMAGE_NT_HEADERS, if valid.

Source

pub fn sections(&self) -> Option<&[IMAGE_SECTION_HEADER]>

Returns all section headers in the PE.

Source

pub fn section_name_by_rva(&self, rva: u32) -> Option<&str>

Finds the name of the section containing a specific RVA.

Source

pub fn section_by_name(&self, name: &str) -> Option<&IMAGE_SECTION_HEADER>

Finds a section by its name.

Source

pub fn exports(&self) -> Exports<'_>

Exports helper

Trait Implementations§

Source§

impl Debug for PE

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for PE

§

impl RefUnwindSafe for PE

§

impl !Send for PE

§

impl !Sync for PE

§

impl Unpin for PE

§

impl UnwindSafe for PE

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.