[−][src]Struct elfy::Elf
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.
Methods
impl Elf
[src]
pub fn load<P: AsRef<Path>>(path: P) -> ParseElfResult<Elf>
[src]
Loads an ELF file from disk and parses it
Errors
Returns 'Err' if the file can not be loaded or if parsing fails, with a description of the failure
Examples
let elf = Elf::load("examples/example-binary").unwrap();
pub fn parse<R: Read + Seek>(reader: &mut R) -> ParseElfResult<Elf>
[src]
Parses an ELF file from a reader source
'reader' can be anything that implements both 'Read' and 'Seek'
Errors
Returns 'Err' if parsing fails, with a description of what caused the failure
Examples
let mut buf = std::io::BufReader::new(file); let elf = Elf::parse(&mut buf).unwrap();
pub fn try_get_section(&self, section_name: &str) -> Option<&Section>
[src]
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);
Trait Implementations
Auto Trait Implementations
impl Send for Elf
impl Sync for Elf
impl Unpin for Elf
impl UnwindSafe for Elf
impl RefUnwindSafe for Elf
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,