pub struct Elf { /* private fields */ }
Expand description
Represents a parsed ELF (Executable and Linkable Format) file.
The ELF format is a common standard file format for executable files, object code, shared libraries, and core dumps.
Implementations§
Source§impl Elf
impl Elf
Sourcepub fn try_get_section(&self, section_name: &str) -> Option<&Section>
pub fn try_get_section(&self, section_name: &str) -> Option<&Section>
Tries to retrieve a section by name, returns ‘None’ if the section does not exist
§Examples
let elf = Elf::load("examples/example-binary").unwrap();
let text = elf.try_get_section(".text").unwrap();
assert_eq!(SectionFlags::AllocExecute, text.header().flags());
Sourcepub fn sections(&self) -> SectionIter<'_> ⓘ
pub fn sections(&self) -> SectionIter<'_> ⓘ
Returns an Iterator
that iterates over references of sections contained in this Elf
file
Sourcepub fn segments(&self) -> SegmentIter<'_> ⓘ
pub fn segments(&self) -> SegmentIter<'_> ⓘ
Returns an Iterator
that iterates over references of program headers contained in this Elf
file
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Elf
impl RefUnwindSafe for Elf
impl Send for Elf
impl Sync for Elf
impl Unpin 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