[][src]Struct pelite::pe32::PeFile

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

View into an unmapped PE file.

Methods

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

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

Constructs a file 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 fn to_view(self) -> Vec<u8>[src]

Converts the file to section alignment.

Trait Implementations

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

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

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

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

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

Auto Trait Implementations

impl<'a> Sync for PeFile<'a>

impl<'a> Send for PeFile<'a>

impl<'a> Unpin for PeFile<'a>

impl<'a> UnwindSafe for PeFile<'a>

impl<'a> RefUnwindSafe for PeFile<'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]