Trait object::ObjectSegment
[−]
[src]
pub trait ObjectSegment<'data> { fn address(&self) -> u64; fn size(&self) -> u64; fn data(&self) -> &'data [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) -> &'data [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<'data, 'file> ObjectSegment<'data> for ElfSegment<'data, 'file>
impl<'data, 'file> ObjectSegment<'data> for MachOSegment<'data, 'file>
impl<'data, 'file> ObjectSegment<'data> for PeSegment<'data, 'file>
impl<'data, 'file> ObjectSegment<'data> for Segment<'data, 'file>