[][src]Enum pelite::Wrap

pub enum Wrap<T32, T64> {
    T32(T32),
    T64(T64),
}

Wraps 32-bit and 64-bit variants.

Variants

T32(T32)
T64(T64)

Methods

impl<'a, Pe32: Pe<'a>, Pe64: Pe<'a>> Wrap<Pe32, Pe64>[src]

pub fn image(&self) -> &'a [u8][src]

pub fn align(&self) -> Align[src]

Important traits for Wrap<Iter32, Iter64>
pub fn as_ref(&self) -> Wrap<&Pe32, &Pe64>[src]

pub fn dos_header(&self) -> &'a IMAGE_DOS_HEADER[src]

pub fn dos_image(&self) -> &'a [u8][src]

Important traits for Wrap<Iter32, Iter64>
pub fn nt_headers(&self) -> Wrap<&'a IMAGE_NT_HEADERS32, &'a IMAGE_NT_HEADERS64>[src]

pub fn file_header(&self) -> &'a IMAGE_FILE_HEADER[src]

Important traits for Wrap<Iter32, Iter64>
pub fn optional_header(
    &self
) -> Wrap<&'a IMAGE_OPTIONAL_HEADER32, &'a IMAGE_OPTIONAL_HEADER64>
[src]

pub fn data_directory(&self) -> &'a [IMAGE_DATA_DIRECTORY][src]

pub fn section_headers(&self) -> &'a [IMAGE_SECTION_HEADER][src]

pub fn get_section_bytes(
    &self,
    section_header: &IMAGE_SECTION_HEADER
) -> Result<&'a [u8]>
[src]

pub fn derva<T>(&self, rva: u32) -> Result<&'a T> where
    T: Pod
[src]

pub fn derva_copy<T>(&self, rva: u32) -> Result<T> where
    T: Copy + Pod
[src]

pub fn derva_into<T: ?Sized>(&self, rva: u32, dest: &mut T) -> Result<()> where
    T: Pod
[src]

pub fn derva_slice<T>(&self, rva: u32, len: usize) -> Result<&'a [T]> where
    T: Pod
[src]

pub fn derva_slice_f<T, F>(&self, rva: u32, f: F) -> Result<&'a [T]> where
    T: Pod,
    F: FnMut(&'a T) -> bool
[src]

pub fn derva_slice_s<T>(&self, rva: u32, sentinel: T) -> Result<&'a [T]> where
    T: PartialEq + Pod
[src]

pub fn derva_c_str(&self, rva: u32) -> Result<&'a CStr>[src]

pub fn derva_string<T: ?Sized>(&self, rva: u32) -> Result<&'a T> where
    T: FromBytes
[src]

Important traits for Wrap<Iter32, Iter64>
pub fn headers(&self) -> Wrap<Headers<Pe32>, Headers<Pe64>>[src]

pub fn rich_structure(&self) -> Result<RichStructure<'a>>[src]

pub fn exports(&self) -> Result<Wrap<Exports<'a, Pe32>, Exports<'a, Pe64>>>[src]

pub fn imports(&self) -> Result<Wrap<Imports<'a, Pe32>, Imports<'a, Pe64>>>[src]

pub fn iat(&self) -> Result<Wrap<IAT<'a, Pe32>, IAT<'a, Pe64>>>[src]

pub fn base_relocs(&self) -> Result<BaseRelocs<'a>>[src]

pub fn load_config(
    &self
) -> Result<Wrap<LoadConfig<'a, Pe32>, LoadConfig<'a, Pe64>>>
[src]

pub fn tls(&self) -> Result<Wrap<Tls<'a, Pe32>, Tls<'a, Pe64>>>[src]

pub fn security(&self) -> Result<Security<'a>>[src]

pub fn exception(
    &self
) -> Result<Wrap<Exception<'a, Pe32>, Exception<'a, Pe64>>>
[src]

pub fn debug(&self) -> Result<Wrap<Debug<'a, Pe32>, Debug<'a, Pe64>>>[src]

pub fn resources(&self) -> Result<Resources<'a>>[src]

Important traits for Wrap<Iter32, Iter64>
pub fn scanner(&self) -> Wrap<Scanner<Pe32>, Scanner<Pe64>>[src]

impl<'a, Pe32: Pe<'a>, Pe64: Pe<'a>> Wrap<Headers<Pe32>, Headers<Pe64>>[src]

Describes the PE headers.

Important traits for Wrap<Iter32, Iter64>
pub fn pe(&self) -> Wrap<Pe32, Pe64>[src]

Gets the PE instance.

pub fn image(&self) -> &'a [u8][src]

Gets the PE headers as a byte slice.

pub fn check_sum(&self) -> u32[src]

Calculates the optional header's CheckSum.

pub fn code_range(&self) -> Range<u32>[src]

Gets the code range from the optional header.

pub fn image_range(&self) -> Range<u32>[src]

Gets the full image range excluding the PE headers.

impl<'a, Pe32: Pe<'a>, Pe64: Pe<'a>> Wrap<Exports<'a, Pe32>, Exports<'a, Pe64>>[src]

Export directory.

Important traits for Wrap<Iter32, Iter64>
pub fn pe(&self) -> Wrap<Pe32, Pe64>[src]

Gets the PE instance.

pub fn image(&self) -> &'a IMAGE_EXPORT_DIRECTORY[src]

Returns the underlying export directory image.

pub fn dll_name(&self) -> Result<&'a CStr>[src]

Gets the export directory's name for this library.

pub fn ordinal_base(&self) -> u16[src]

Gets the ordinal base for the exported functions.

pub fn functions(&self) -> Result<&'a [u32]>[src]

Gets the export address table.

pub fn names(&self) -> Result<&'a [u32]>[src]

Gets the name address table.

pub fn name_indices(&self) -> Result<&'a [u16]>[src]

Gets the name index table.

pub fn by(&self) -> Result<Wrap<By<'a, Pe32>, By<'a, Pe64>>>[src]

Query the exports.

impl<'a, Pe32: Pe<'a>, Pe64: Pe<'a>> Wrap<By<'a, Pe32>, By<'a, Pe64>>[src]

Export directory symbol lookup.

Important traits for Wrap<Iter32, Iter64>
pub fn pe(&self) -> Wrap<Pe32, Pe64>[src]

Gets the PE instance.

pub fn image(&self) -> &'a IMAGE_EXPORT_DIRECTORY[src]

Returns the underlying export directory image.

pub fn dll_name(&self) -> Result<&'a CStr>[src]

Gets the export directory's name for this library.

pub fn ordinal_base(&self) -> u16[src]

Gets the ordinal base for the exported functions.

pub fn functions(&self) -> &'a [u32][src]

Gets the export address table.

pub fn names(&self) -> &'a [u32][src]

Gets the name address table.

pub fn name_indices(&self) -> &'a [u16][src]

Gets the name index table.

pub fn check_sorted(&self) -> Result<bool>[src]

Validates and checks if the name table is sorted.

pub fn ordinal(&self, ordinal: u16) -> Result<Export<'a>>[src]

Looks up an Export by its ordinal.

pub fn name_linear<S: AsRef<[u8]> + ?Sized>(
    &self,
    name: &S
) -> Result<Export<'a>>
[src]

Looks up an Export by its name.

pub fn name<S: AsRef<[u8]> + ?Sized>(&self, name: &S) -> Result<Export<'a>>[src]

Looks up an Export by its name.

pub fn import(&self, import: Import) -> Result<Export<'a>>[src]

Looks up an Export by its import.

pub fn index(&self, index: usize) -> Result<Export<'a>>[src]

Looks up an export by its index.

pub fn hint(&self, hint: usize) -> Result<Export<'a>>[src]

Looks up an export by its hint.

pub fn hint_name<S: AsRef<[u8]> + ?Sized>(
    &self,
    hint: usize,
    name: &S
) -> Result<Export<'a>>
[src]

Looks up an export by its hint and falls back to the name if the hint is incorrect.

pub fn name_of_hint(&self, hint: usize) -> Result<&'a CStr>[src]

Looks up the name for a hint.

pub fn name_lookup(&self, index: usize) -> Result<Import<'a>>[src]

Given an index in the functions array, gets the named export.

pub fn iter<'s>(
    &'s self
) -> impl 's + Clone + Iterator<Item = Result<Export<'a>>>
[src]

Iterate over exported functions.

pub fn iter_names<'s>(
    &'s self
) -> impl 's + Clone + Iterator<Item = (Result<&'a CStr>, Result<Export<'a>>)>
[src]

Iterate over functions exported by name.

pub fn iter_name_indices<'s>(
    &'s self
) -> impl 's + Clone + Iterator<Item = (Result<&'a CStr>, usize)>
[src]

Iterate over functions exported by name, returning their name and index in the functions table.

impl<'a, Pe32: Pe<'a>, Pe64: Pe<'a>> Wrap<Pe32, Pe64>[src]

Convenient way to get an exported address.

pub fn get_export_by_ordinal(&self, ordinal: u16) -> Result<Export<'a>>[src]

Convenient method to get an exported function by ordinal.

pub fn get_export_by_import(&self, import: Import<'a>) -> Result<Export<'a>>[src]

Convenient method to get an exported function by import.

pub fn get_export_by_name<S: ?Sized + AsRef<[u8]>>(
    &self,
    name: &S
) -> Result<Export<'a>>
[src]

Convenient method to get an exported function by name.

impl<'a, Pe32: Pe<'a>, Pe64: Pe<'a>> Wrap<Imports<'a, Pe32>, Imports<'a, Pe64>>[src]

Import directory.

Important traits for Wrap<Iter32, Iter64>
pub fn pe(&self) -> Wrap<Pe32, Pe64>[src]

Gets the PE instance.

pub fn image(&self) -> &'a [IMAGE_IMPORT_DESCRIPTOR][src]

Returns the underlying import directory image array.

Important traits for Wrap<Iter32, Iter64>
pub fn iter(&self) -> Wrap<Iter<'a, Pe32>, Iter<'a, Pe64>>[src]

Iterator over the import descriptors.

impl<'a, Pe32: Pe<'a>, Pe64: Pe<'a>> Wrap<IAT<'a, Pe32>, IAT<'a, Pe64>>[src]

Import Address Table.

Important traits for Wrap<Iter32, Iter64>
pub fn pe(&self) -> Wrap<Pe32, Pe64>[src]

Gets the PE instance.

Important traits for Wrap<Iter32, Iter64>
pub fn image(&self) -> Wrap<&'a [u32], &'a [u64]>[src]

Returns the underlying iat array.

Important traits for Wrap<Iter32, Iter64>
pub fn iter(
    &self
) -> Wrap<impl Clone + Iterator<Item = (&'a u32, Result<Import<'a>>)>, impl Clone + Iterator<Item = (&'a u64, Result<Import<'a>>)>>
[src]

Iterate over the IAT.

impl<'a, Pe32: Pe<'a>, Pe64: Pe<'a>> Wrap<Desc<'a, Pe32>, Desc<'a, Pe64>>[src]

Import library descriptor.

Important traits for Wrap<Iter32, Iter64>
pub fn pe(&self) -> Wrap<Pe32, Pe64>[src]

Gets the PE instance.

pub fn image(&self) -> &'a IMAGE_IMPORT_DESCRIPTOR[src]

Returns the underlying import descriptor image.

pub fn dll_name(&self) -> Result<&'a CStr>[src]

Gets the name of the DLL imported from.

pub fn iat(&self) -> Result<Wrap<Iter<'a, u32>, Iter<'a, u64>>>[src]

Gets the import address table.

pub fn int(&self) -> Result<impl Clone + Iterator<Item = Result<Import<'a>>>>[src]

Gets the import name table.

impl<'a, Pe32: Pe<'a>, Pe64: Pe<'a>> Wrap<LoadConfig<'a, Pe32>, LoadConfig<'a, Pe64>>[src]

Load Config Directory.

Important traits for Wrap<Iter32, Iter64>
pub fn pe(&self) -> Wrap<Pe32, Pe64>[src]

Gets the PE instance.

Important traits for Wrap<Iter32, Iter64>
pub fn image(
    &self
) -> Wrap<&'a IMAGE_LOAD_CONFIG_DIRECTORY32, &'a IMAGE_LOAD_CONFIG_DIRECTORY64>
[src]

Returns the underlying load config directory image.

Gets the default security cookie for the image.

pub fn se_handler_table(&self) -> Result<Wrap<&'a [u32], &'a [u64]>>[src]

Gets the structured exception handler table.

impl<'a, Pe32: Pe<'a>, Pe64: Pe<'a>> Wrap<Tls<'a, Pe32>, Tls<'a, Pe64>>[src]

TLS Directory.

Important traits for Wrap<Iter32, Iter64>
pub fn pe(&self) -> Wrap<Pe32, Pe64>[src]

Gets the PE instance.

Important traits for Wrap<Iter32, Iter64>
pub fn image(
    &self
) -> Wrap<&'a IMAGE_TLS_DIRECTORY32, &'a IMAGE_TLS_DIRECTORY64>
[src]

Returns the underlying TLS directory image.

pub fn raw_data(&self) -> Result<&'a [u8]>[src]

Gets the raw TLS initialization data.

pub fn slot(&self) -> Result<&'a u32>[src]

Gets the TLS slot location.

pub fn callbacks(&self) -> Result<Wrap<&'a [u32], &'a [u64]>>[src]

Gets the TLS initialization callbacks.

impl<'a, Pe32: Pe<'a>, Pe64: Pe<'a>> Wrap<Debug<'a, Pe32>, Debug<'a, Pe64>>[src]

Debug directory.

Important traits for Wrap<Iter32, Iter64>
pub fn pe(&self) -> Wrap<Pe32, Pe64>[src]

Gets the PE instance.

pub fn image(&self) -> &'a [IMAGE_DEBUG_DIRECTORY][src]

Returns the underlying debug directories image.

pub fn pdb_file_name(&self) -> Option<&'a CStr>[src]

Gets the CodeView PDB file name.

Important traits for Wrap<Iter32, Iter64>
pub fn iter(&self) -> Wrap<Iter<'a, Pe32>, Iter<'a, Pe64>>[src]

Iterator over the debug directories.

impl<'a, Pe32: Pe<'a>, Pe64: Pe<'a>> Wrap<Dir<'a, Pe32>, Dir<'a, Pe64>>[src]

Debug directory entry.

Important traits for Wrap<Iter32, Iter64>
pub fn pe(&self) -> Wrap<Pe32, Pe64>[src]

Gets the PE instance.

pub fn image(&self) -> &'a IMAGE_DEBUG_DIRECTORY[src]

Gets the underlying debug directory image.

pub fn data(&self) -> Option<&'a [u8]>[src]

Gets the raw data of this debug directory entry.

pub fn entry(&self) -> Result<Entry<'a>>[src]

Interprets the directory entry.

impl<'a, Pe32: Pe<'a>, Pe64: Pe<'a>> Wrap<Scanner<Pe32>, Scanner<Pe64>>[src]

Pattern scanner.

pub fn finds(&self, pat: &[Atom], range: Range<u32>, save: &mut [u32]) -> bool[src]

Finds the unique match for the pattern in the given range.

pub fn finds_code(&self, pat: &[Atom], save: &mut [u32]) -> bool[src]

Finds the unique code match for the pattern.

Important traits for Wrap<Iter32, Iter64>
pub fn matches<'pat>(
    &self,
    pat: &'pat [Atom],
    range: Range<u32>
) -> Wrap<Matches<'pat, Pe32>, Matches<'pat, Pe64>>
[src]

Returns an iterator over the matches of a pattern within the given range.

Important traits for Wrap<Iter32, Iter64>
pub fn matches_code<'pat>(
    &self,
    pat: &'pat [Atom]
) -> Wrap<Matches<'pat, Pe32>, Matches<'pat, Pe64>>
[src]

Returns an iterator over the code matches of a pattern.

pub fn exec(&self, cursor: u32, pat: &[Atom], save: &mut [u32]) -> bool[src]

Pattern interpreter, returns if the pattern matches the binary image at the given rva.

impl<'a, 'pat, Pe32: Pe<'a>, Pe64: Pe<'a>> Wrap<Matches<'pat, Pe32>, Matches<'pat, Pe64>>[src]

Important traits for Wrap<Iter32, Iter64>
pub fn scanner(&self) -> Wrap<Scanner<Pe32>, Scanner<Pe64>>[src]

Gets the scanner instance.

pub fn pattern(&self) -> &'pat [Atom][src]

Gets the pattern.

pub fn range(&self) -> Range<u32>[src]

Gets the remaining range to scan.

pub fn hits(&self) -> u32[src]

Performance counter.

pub fn next(&mut self, save: &mut [u32]) -> bool[src]

Finds the next match with the given save array.

impl<T32, T64> Wrap<Result<T32>, Result<T64>>[src]

pub fn transpose(self) -> Result<Wrap<T32, T64>>[src]

Transposes a wrap of results in a result of a wrap.

impl<T32, T64> Wrap<Option<T32>, Option<T64>>[src]

pub fn transpose(self) -> Option<Wrap<T32, T64>>[src]

Transposes a wrap of options in an option of a wrap.

impl<T> Wrap<T, T>[src]

pub fn into(self) -> T[src]

Unwraps the wrapped value of equal types.

Trait Implementations

impl<T32: Eq, T64: Eq> Eq for Wrap<T32, T64>[src]

impl<T32: Clone, T64: Clone> Clone for Wrap<T32, T64>[src]

impl<T32: PartialEq, T64: PartialEq> PartialEq<Wrap<T32, T64>> for Wrap<T32, T64>[src]

impl<'a, Pe32: Pe<'a>, Pe64: Pe<'a>> IntoIterator for Wrap<Imports<'a, Pe32>, Imports<'a, Pe64>>[src]

type Item = Wrap<Desc<'a, Pe32>, Desc<'a, Pe64>>

The type of the elements being iterated over.

type IntoIter = Wrap<Iter<'a, Pe32>, Iter<'a, Pe64>>

Which kind of iterator are we turning this into?

impl<'a, Pe32: Pe<'a>, Pe64: Pe<'a>> IntoIterator for Wrap<Debug<'a, Pe32>, Debug<'a, Pe64>>[src]

type Item = Wrap<Dir<'a, Pe32>, Dir<'a, Pe64>>

The type of the elements being iterated over.

type IntoIter = Wrap<Iter<'a, Pe32>, Iter<'a, Pe64>>

Which kind of iterator are we turning this into?

impl<T32: Copy, T64: Copy> Copy for Wrap<T32, T64>[src]

impl<Iter32: Iterator, Iter64: Iterator> Iterator for Wrap<Iter32, Iter64>[src]

type Item = Wrap<Iter32::Item, Iter64::Item>

The type of the elements being iterated over.

impl<T32: Debug, T64: Debug> Debug for Wrap<T32, T64>[src]

impl<T32, T64> Serialize for Wrap<T32, T64> where
    T32: Serialize,
    T64: Serialize
[src]

Auto Trait Implementations

impl<T32, T64> Sync for Wrap<T32, T64> where
    T32: Sync,
    T64: Sync

impl<T32, T64> Send for Wrap<T32, T64> where
    T32: Send,
    T64: Send

impl<T32, T64> Unpin for Wrap<T32, T64> where
    T32: Unpin,
    T64: Unpin

impl<T32, T64> UnwindSafe for Wrap<T32, T64> where
    T32: UnwindSafe,
    T64: UnwindSafe

impl<T32, T64> RefUnwindSafe for Wrap<T32, T64> where
    T32: RefUnwindSafe,
    T64: RefUnwindSafe

Blanket Implementations

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

impl<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

type IntoIter = I

Which kind of iterator are we turning this into?

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]