Struct goblin::elf::program_header::program_header32::ProgramHeader
source · #[repr(C)]pub struct ProgramHeader {
pub p_type: u32,
pub p_offset: u32,
pub p_vaddr: u32,
pub p_paddr: u32,
pub p_filesz: u32,
pub p_memsz: u32,
pub p_flags: u32,
pub p_align: u32,
}
Expand description
A 32-bit ProgramHeader typically specifies how to map executable and data segments into memory
Fields§
§p_type: u32
Segment type
p_offset: u32
Segment file offset
p_vaddr: u32
Segment virtual address
p_paddr: u32
Segment physical address
p_filesz: u32
Segment size in file
p_memsz: u32
Segment size in memory
p_flags: u32
Segment flags
p_align: u32
Segment alignment
Implementations§
source§impl ProgramHeader
impl ProgramHeader
pub fn parse( bytes: &[u8], offset: usize, count: usize, ctx: Endian ) -> Result<Vec<ProgramHeader>>
pub fn from_bytes(bytes: &[u8], phnum: usize) -> Vec<ProgramHeader>
sourcepub unsafe fn from_raw_parts<'a>(
phdrp: *const ProgramHeader,
phnum: usize
) -> &'a [ProgramHeader]
pub unsafe fn from_raw_parts<'a>( phdrp: *const ProgramHeader, phnum: usize ) -> &'a [ProgramHeader]
Safety
This function creates a ProgramHeader
directly from a raw pointer
pub fn from_fd( fd: &mut File, offset: u64, count: usize ) -> Result<Vec<ProgramHeader>>
Trait Implementations§
source§impl Clone for ProgramHeader
impl Clone for ProgramHeader
source§fn clone(&self) -> ProgramHeader
fn clone(&self) -> ProgramHeader
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for ProgramHeader
impl Debug for ProgramHeader
source§impl Default for ProgramHeader
impl Default for ProgramHeader
source§fn default() -> ProgramHeader
fn default() -> ProgramHeader
Returns the “default value” for a type. Read more
source§impl From<ProgramHeader> for ProgramHeader
impl From<ProgramHeader> for ProgramHeader
source§fn from(ph: ElfProgramHeader) -> Self
fn from(ph: ElfProgramHeader) -> Self
Converts to this type from the input type.
source§impl From<ProgramHeader> for ElfProgramHeader
impl From<ProgramHeader> for ElfProgramHeader
source§fn from(ph: ProgramHeader) -> Self
fn from(ph: ProgramHeader) -> Self
Converts to this type from the input type.
source§impl PartialEq for ProgramHeader
impl PartialEq for ProgramHeader
source§fn eq(&self, other: &ProgramHeader) -> bool
fn eq(&self, other: &ProgramHeader) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Plain for ProgramHeader
impl Plain for ProgramHeader
fn from_bytes(bytes: &[u8]) -> Result<&Self, Error>where Self: Sized,
fn slice_from_bytes(bytes: &[u8]) -> Result<&[Self], Error>where Self: Sized,
fn slice_from_bytes_len(bytes: &[u8], len: usize) -> Result<&[Self], Error>where Self: Sized,
fn from_mut_bytes(bytes: &mut [u8]) -> Result<&mut Self, Error>where Self: Sized,
fn slice_from_mut_bytes(bytes: &mut [u8]) -> Result<&mut [Self], Error>where Self: Sized,
fn slice_from_mut_bytes_len( bytes: &mut [u8], len: usize ) -> Result<&mut [Self], Error>where Self: Sized,
fn copy_from_bytes(&mut self, bytes: &[u8]) -> Result<(), Error>
source§impl<'a> TryFromCtx<'a, Endian> for ProgramHeaderwhere
ProgramHeader: 'a,
impl<'a> TryFromCtx<'a, Endian> for ProgramHeaderwhere ProgramHeader: 'a,
source§impl<'a> TryIntoCtx<Endian> for &'a ProgramHeader
impl<'a> TryIntoCtx<Endian> for &'a ProgramHeader
source§impl TryIntoCtx<Endian> for ProgramHeader
impl TryIntoCtx<Endian> for ProgramHeader
impl Copy for ProgramHeader
impl StructuralPartialEq for ProgramHeader
Auto Trait Implementations§
impl RefUnwindSafe for ProgramHeader
impl Send for ProgramHeader
impl Sync for ProgramHeader
impl Unpin for ProgramHeader
impl UnwindSafe for ProgramHeader
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more