[][src]Struct pelite::pe64::PeView

pub struct PeView<'a> { /* fields omitted */ }

View into a mapped PE image.

Methods

impl PeView<'static>[src]

pub unsafe fn new() -> PeView<'static>[src]

Constructs a view of the module this code is executing in.

impl<'a> PeView<'a>[src]

pub fn from_bytes<T: AsRef<[u8]> + ?Sized>(image: &'a T) -> Result<PeView<'a>>[src]

Constructs a view from a byte slice.

Errors

  • Bounds: The byte slice is too small to fit the PE headers.

  • Misaligned: The minimum alignment of 4 is not satisfied.

  • BadMagic: This is not a PE file.

  • PeMagic: Trying to parse a PE32 file with the PE32+ parser and vice versa.

  • Insanity: Reasonable limits on e_lfanew, SizeOfHeaders or NumberOfSections are exceeded.

pub unsafe fn module(base: *const u8) -> PeView<'a>[src]

Constructs a new view from module handle.

Safety

The underlying memory is borrowed and an unbounded lifetime is returned. Ensure the lifetime outlives this view instance!

No sanity or safety checks are done to make sure this is really PE32(+) image. When using this with a HMODULE from the system the caller must be sure this is a PE32(+) image.

pub fn to_file(self) -> Vec<u8>[src]

Converts the view to file alignment.

Trait Implementations

impl<'a> PeObject<'a> for PeView<'a>[src]

impl<'a> Pe<'a> for PeView<'a>[src]

impl<'a> Clone for PeView<'a>[src]

impl<'a> Copy for PeView<'a>[src]

impl<'a> Serialize for PeView<'a>[src]

Auto Trait Implementations

impl<'a> Sync for PeView<'a>

impl<'a> Send for PeView<'a>

impl<'a> Unpin for PeView<'a>

impl<'a> UnwindSafe for PeView<'a>

impl<'a> RefUnwindSafe for PeView<'a>

Blanket Implementations

impl<'a, P> GetProcAddress<'a, u16> for P where
    P: Pe<'a>, 
[src]

impl<'b, 'a, P> GetProcAddress<'a, Import<'b>> for P where
    P: Pe<'a>, 
[src]

impl<'b, 'a, P, S> GetProcAddress<'a, &'b S> for P where
    P: Pe<'a>,
    S: AsRef<[u8]> + ?Sized
[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]