pub struct Elf {
pub entry: usize,
pub segments: Vec<ElfSegment>,
}Expand description
A parsed ELF64 executable.
Fields§
§entry: usizeProgram entry point virtual address
segments: Vec<ElfSegment>All PT_LOAD segments
Implementations§
Source§impl Elf
impl Elf
Sourcepub fn parse(data: &[u8]) -> Result<Self, &'static str>
pub fn parse(data: &[u8]) -> Result<Self, &'static str>
Parse an ELF64 executable from raw bytes.
Returns Err if the data is not a valid RISC-V ELF64 executable.
Sourcepub fn segment_data<'a>(&self, seg: &ElfSegment, raw: &'a [u8]) -> &'a [u8] ⓘ
pub fn segment_data<'a>(&self, seg: &ElfSegment, raw: &'a [u8]) -> &'a [u8] ⓘ
Get a reference to the segment data within the raw ELF bytes.
Trait Implementations§
Auto Trait Implementations§
impl Forget for Elf
impl Freeze for Elf
impl RefUnwindSafe for Elf
impl Send for Elf
impl Sync for Elf
impl Unpin for Elf
impl UnsafeUnpin for Elf
impl UnwindSafe for Elf
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