pub struct ELFParser<'a> { /* private fields */ }
Expand description
A wrapper for the ELF file data with some useful methods.
Implementations§
Source§impl<'a> ELFParser<'a>
impl<'a> ELFParser<'a>
Sourcepub fn new(
elf: &'a ElfFile<'_>,
interp_base: usize,
bias: Option<isize>,
uspace_base: usize,
) -> Result<Self, &'static str>
pub fn new( elf: &'a ElfFile<'_>, interp_base: usize, bias: Option<isize>, uspace_base: usize, ) -> Result<Self, &'static str>
Create a new ELFInfo
instance.
§Arguments
elf
- The ELF file datainterp_base
- Address of the interpreter if the ELF file is a dynamic executablebias
- Bias for the base address of the PIE executable.uspace_base
- The lowest address of the user space
§Note
If the ELF file is a dynamic executable, the interp_base
should be the address of the interpreter, and the address of the ELF file will be elf.base_addr() + bias
.
Sourcepub fn auxv_vector(&self, pagesz: usize) -> [AuxvEntry; 17]
pub fn auxv_vector(&self, pagesz: usize) -> [AuxvEntry; 17]
Part of auxiliary vectors from the ELF file.
§Arguments
pagesz
- The page size of the system
Details about auxiliary vectors are described in https://articles.manugarg.com/aboutelfauxiliaryvectors.html
Sourcepub fn ph_load(&self) -> Vec<ELFPH>
pub fn ph_load(&self) -> Vec<ELFPH>
Read all self::ELFPH
with LOAD
type of the elf file.
Auto Trait Implementations§
impl<'a> Freeze for ELFParser<'a>
impl<'a> RefUnwindSafe for ELFParser<'a>
impl<'a> Send for ELFParser<'a>
impl<'a> Sync for ELFParser<'a>
impl<'a> Unpin for ELFParser<'a>
impl<'a> UnwindSafe for ELFParser<'a>
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