Trait object::ObjectSegment
[−]
[src]
pub trait ObjectSegment<'a> { fn address(&self) -> u64; fn size(&self) -> u64; fn data(&self) -> &'a [u8]; fn name(&self) -> Option<&str>; }
A loadable segment defined in an object file.
For ELF, this is a program header with type PT_LOAD
.
For Mach-O, this is a load command with type LC_SEGMENT
or LC_SEGMENT_64
.
Required Methods
fn address(&self) -> u64
Returns the virtual address of the segment.
fn size(&self) -> u64
Returns the size of the segment in memory.
fn data(&self) -> &'a [u8]
Returns a reference to the file contents of the segment. The length of this data may be different from the size of the segment in memory.
fn name(&self) -> Option<&str>
Returns the name of the segment.
Implementors
impl<'a> ObjectSegment<'a> for ElfSegment<'a>
impl<'a> ObjectSegment<'a> for MachOSegment<'a>
impl<'a> ObjectSegment<'a> for PeSegment<'a>
impl<'a> ObjectSegment<'a> for Segment<'a>