Trait object::ObjectSegment

source ·
pub trait ObjectSegment<'data> {
    fn address(&self) -> u64;
    fn size(&self) -> u64;
    fn data(&self) -> &'data [u8] ;
    fn name(&self) -> Option<&str>;
}
Expand description

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§

Returns the virtual address of the segment.

Returns the size of the segment in memory.

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.

Returns the name of the segment.

Implementors§