[−][src]Struct pelite::pe64::PeView
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 one_lfanew
,SizeOfHeaders
orNumberOfSections
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]
fn image(&self) -> &'a [u8]
[src]
fn align(&self) -> Align
[src]
fn serde_name(&self) -> &'static str
[src]
impl<'a> Pe<'a> for PeView<'a>
[src]
fn dos_header(self) -> &'a IMAGE_DOS_HEADER
[src]
fn dos_image(self) -> &'a [u8]
[src]
fn nt_headers(self) -> &'a IMAGE_NT_HEADERS
[src]
fn file_header(self) -> &'a IMAGE_FILE_HEADER
[src]
fn optional_header(self) -> &'a IMAGE_OPTIONAL_HEADER
[src]
fn data_directory(self) -> &'a [IMAGE_DATA_DIRECTORY]
[src]
fn section_headers(self) -> &'a [IMAGE_SECTION_HEADER]
[src]
fn headers(self) -> Headers<Self>
[src]
fn rva_to_file_offset(self, rva: Rva) -> Result<usize>
[src]
fn file_offset_to_rva(self, file_offset: usize) -> Result<Rva>
[src]
fn rva_to_va(self, rva: Rva) -> Result<Va>
[src]
fn va_to_rva(self, va: Va) -> Result<Rva>
[src]
fn slice(&self, rva: Rva, min_size_of: usize, align: usize) -> Result<&'a [u8]>
[src]
fn slice_bytes(self, rva: Rva) -> Result<&'a [u8]> where
Self: Sized,
[src]
Self: Sized,
fn get_section_bytes(
self,
section_header: &IMAGE_SECTION_HEADER
) -> Result<&'a [u8]>
[src]
self,
section_header: &IMAGE_SECTION_HEADER
) -> Result<&'a [u8]>
fn read(&self, va: Va, min_size_of: usize, align: usize) -> Result<&'a [u8]>
[src]
fn read_bytes(self, va: Va) -> Result<&'a [u8]> where
Self: Sized,
[src]
Self: Sized,
fn derva<T>(self, rva: Rva) -> Result<&'a T> where
T: Pod,
[src]
T: Pod,
fn derva_copy<T>(self, rva: Rva) -> Result<T> where
T: Copy + Pod,
[src]
T: Copy + Pod,
fn derva_into<T: ?Sized>(self, rva: Rva, dest: &mut T) -> Result<()> where
T: Pod,
[src]
T: Pod,
fn derva_slice<T>(self, rva: Rva, len: usize) -> Result<&'a [T]> where
T: Pod,
[src]
T: Pod,
fn derva_slice_f<T, F>(self, rva: Rva, f: F) -> Result<&'a [T]> where
T: Pod,
F: FnMut(&'a T) -> bool,
[src]
T: Pod,
F: FnMut(&'a T) -> bool,
fn derva_slice_s<T>(self, rva: Rva, sentinel: T) -> Result<&'a [T]> where
T: PartialEq + Pod,
[src]
T: PartialEq + Pod,
fn derva_c_str(self, rva: Rva) -> Result<&'a CStr>
[src]
fn derva_string<T: ?Sized>(self, rva: Rva) -> Result<&'a T> where
T: FromBytes,
[src]
T: FromBytes,
fn deref<T>(self, ptr: Ptr<T>) -> Result<&'a T> where
T: Pod,
[src]
T: Pod,
fn deref_copy<T>(self, ptr: Ptr<T>) -> Result<T> where
T: Copy + Pod,
[src]
T: Copy + Pod,
fn deref_into<T: ?Sized>(self, ptr: Ptr<T>, dest: &mut T) -> Result<()> where
T: Pod,
[src]
T: Pod,
fn deref_slice<T>(self, ptr: Ptr<[T]>, len: usize) -> Result<&'a [T]> where
T: Pod,
[src]
T: Pod,
fn deref_slice_f<T, F>(self, ptr: Ptr<[T]>, f: F) -> Result<&'a [T]> where
T: Pod,
F: FnMut(&'a T) -> bool,
[src]
T: Pod,
F: FnMut(&'a T) -> bool,
fn deref_slice_s<T>(self, ptr: Ptr<[T]>, sentinel: T) -> Result<&'a [T]> where
T: PartialEq + Pod,
[src]
T: PartialEq + Pod,
fn deref_c_str(self, ptr: Ptr<CStr>) -> Result<&'a CStr>
[src]
fn deref_string<T: ?Sized>(self, ptr: Ptr<T>) -> Result<&'a T> where
T: FromBytes,
[src]
T: FromBytes,
fn rich_structure(self) -> Result<RichStructure<'a>>
[src]
fn exports(self) -> Result<Exports<'a, Self>>
[src]
fn imports(self) -> Result<Imports<'a, Self>>
[src]
fn iat(self) -> Result<IAT<'a, Self>>
[src]
fn base_relocs(self) -> Result<BaseRelocs<'a>>
[src]
fn load_config(self) -> Result<LoadConfig<'a, Self>>
[src]
fn tls(self) -> Result<Tls<'a, Self>>
[src]
fn security(self) -> Result<Security<'a>>
[src]
fn exception(self) -> Result<Exception<'a, Self>>
[src]
fn debug(self) -> Result<Debug<'a, Self>>
[src]
fn resources(self) -> Result<Resources<'a>> where
Self: Copy,
[src]
Self: Copy,
fn scanner(self) -> Scanner<Self>
[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]
P: Pe<'a>,
fn get_export(Self, u16) -> Result<Export<'a>, Error>
[src]
fn get_proc_address(self, name: T) -> Result<Va>
[src]
impl<'b, 'a, P> GetProcAddress<'a, Import<'b>> for P where
P: Pe<'a>,
[src]
P: Pe<'a>,
fn get_export(Self, Import<'b>) -> Result<Export<'a>, Error>
[src]
fn get_proc_address(self, name: T) -> Result<Va>
[src]
impl<'b, 'a, P, S> GetProcAddress<'a, &'b S> for P where
P: Pe<'a>,
S: AsRef<[u8]> + ?Sized,
[src]
P: Pe<'a>,
S: AsRef<[u8]> + ?Sized,
fn get_export(Self, &'b S) -> Result<Export<'a>, Error>
[src]
fn get_proc_address(self, name: T) -> Result<Va>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,