#[repr(C)]pub enum AnyImage<'a> {
Elf(ElfImage<'a>),
Pe(Box<PeImage>),
}Expand description
A PE or ELF image, as detected by AnyImage::load.
Variants§
Implementations§
Trait Implementations§
Source§impl LoadedImage for AnyImage<'_>
impl LoadedImage for AnyImage<'_>
Source§fn bytes(&self, vaddr: u64, len: usize) -> Option<&[u8]>
fn bytes(&self, vaddr: u64, len: usize) -> Option<&[u8]>
len bytes at virtual address vaddr, or None if unmapped.Source§fn pointer(&self, vaddr: u64) -> Option<u64>
fn pointer(&self, vaddr: u64) -> Option<u64>
A pointer-sized value at
vaddr, after relocation.Source§fn c_str(&self, vaddr: u64) -> Option<String>
fn c_str(&self, vaddr: u64) -> Option<String>
The NUL-terminated string at
vaddr, decoded as lossy UTF-8, or None
if vaddr is unmapped. Reads to a NUL byte or the end of the mapping.Source§fn data_segments(&self) -> Vec<(u64, u64)>
fn data_segments(&self) -> Vec<(u64, u64)>
Virtual-address ranges of the loaded, non-executable segments (where
data such as tables of pointers lives).
Source§fn exports(&self) -> Result<Vec<Export>, PewterError>
fn exports(&self) -> Result<Vec<Export>, PewterError>
The exported symbols: a PE’s export table, or an ELF’s defined dynamic
functions and objects.
Source§fn machine(&self) -> Option<ImageFileMachine>
fn machine(&self) -> Option<ImageFileMachine>
The machine as a PE machine type, or
None if PE has no equivalent.fn pointer_size(&self) -> u64
fn u32(&self, vaddr: u64) -> Option<u32>
fn u8(&self, vaddr: u64) -> Option<u8>
Source§fn pointer_at(&self, base: u64, index: u64) -> Option<u64>
fn pointer_at(&self, base: u64, index: u64) -> Option<u64>
The
indexth pointer of an array at base, i.e. the pointer at
base + index * pointer_size(). Saves spelling out the stride when
walking a table of pointers.Source§fn pointers(&self, vaddr: u64, count: u64) -> Option<Vec<u64>>
fn pointers(&self, vaddr: u64, count: u64) -> Option<Vec<u64>>
count consecutive pointers starting at vaddr, or None if any is
unmapped.Source§fn pointer_slots(&self, segment: (u64, u64)) -> impl Iterator<Item = u64>
fn pointer_slots(&self, segment: (u64, u64)) -> impl Iterator<Item = u64>
The pointer-sized slots of
segment (a data_segments
range), as the virtual addresses start, start + pointer_size(), … that
each still hold a full pointer. Useful for scanning a segment for a structure.Auto Trait Implementations§
impl<'a> Forget for AnyImage<'a>
impl<'a> Freeze for AnyImage<'a>where
*const u8 is !null: Freeze,
PhantomData<ProgramHeader>: Freeze,
PhantomData<Section<'a>>: Freeze,
&'a [u8]: Freeze,
PhantomData<(u64, u64)>: Freeze,
*const PeImage is !null: Freeze,
PhantomData<PeImage>: Freeze,
impl<'a> Move for AnyImage<'a>
impl<'a> RefUnwindSafe for AnyImage<'a>where
InternalBitFlags: RefUnwindSafe,
InternalBitFlags: RefUnwindSafe,
InternalBitFlags: RefUnwindSafe,
u32: RefUnwindSafe,
InternalBitFlags: RefUnwindSafe,
u64: RefUnwindSafe,
InternalBitFlags: RefUnwindSafe,
impl<'a> Send for AnyImage<'a>
impl<'a> Sync for AnyImage<'a>
impl<'a> Unpin for AnyImage<'a>
impl<'a> UnsafeUnpin for AnyImage<'a>where
*const u8 is !null: UnsafeUnpin,
PhantomData<ProgramHeader>: UnsafeUnpin,
PhantomData<Section<'a>>: UnsafeUnpin,
&'a [u8]: UnsafeUnpin,
PhantomData<(u64, u64)>: UnsafeUnpin,
*const PeImage is !null: UnsafeUnpin,
PhantomData<PeImage>: UnsafeUnpin,
impl<'a> UnwindSafe for AnyImage<'a>where
RawVecInner: UnwindSafe,
InternalBitFlags: UnwindSafe,
InternalBitFlags: UnwindSafe,
&'a str: UnwindSafe,
&'a [u8]: UnwindSafe,
BoxRaw<PeImage>: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more