pub trait ElfFormat {
// Required methods
fn header(&self) -> &dyn ElfHeader;
fn segments(&self) -> Vec<&dyn ElfSegment>;
fn sections(&self) -> Vec<&dyn ElfSection>;
// Provided method
fn section(&self, name: &str) -> Option<&dyn ElfSection> { ... }
}
Expand description
A trait representing the supported methods for a parsed ELF format.
This is used as universal interface for Elf file format, some methods are useful when using
those ignoring the 32 or 64 part. The information provided by ELF
header can be extracted
from the ElfHeader
trait object which can be gained from header()
method.
Required Methods§
Sourcefn segments(&self) -> Vec<&dyn ElfSegment>
fn segments(&self) -> Vec<&dyn ElfSegment>
all segments trait objects
Sourcefn sections(&self) -> Vec<&dyn ElfSection>
fn sections(&self) -> Vec<&dyn ElfSection>
all sections trait objects
Provided Methods§
Sourcefn section(&self, name: &str) -> Option<&dyn ElfSection>
fn section(&self, name: &str) -> Option<&dyn ElfSection>
get some specific section with a given name
Trait Implementations§
Source§impl<'a> TryFrom<&'a Executable<'a>> for &'a dyn ElfFormat
impl<'a> TryFrom<&'a Executable<'a>> for &'a dyn ElfFormat
Source§fn try_from(value: &'a Executable<'_>) -> Result<&'a dyn ElfFormat, Error>
fn try_from(value: &'a Executable<'_>) -> Result<&'a dyn ElfFormat, Error>
Tries to convert an Executable
reference to an
ElfFormat
trait object