Struct goblin::elf::program_header::program_header64::ProgramHeader
[−]
[src]
#[repr(C)]pub struct ProgramHeader { pub p_type: u32, pub p_flags: u32, pub p_offset: u64, pub p_vaddr: u64, pub p_paddr: u64, pub p_filesz: u64, pub p_memsz: u64, pub p_align: u64, }
A 32-bit ProgramHeader typically specifies how to map executable and data segments into memory
Fields
p_type: u32
Segment type
p_flags: u32
Segment flags
p_offset: u64
Segment file offset
p_vaddr: u64
Segment virtual address
p_paddr: u64
Segment physical address
p_filesz: u64
Segment size in file
p_memsz: u64
Segment size in memory
p_align: u64
Segment alignment
Methods
impl ProgramHeader
[src]
fn parse(
bytes: &[u8],
offset: usize,
count: usize,
ctx: Endian
) -> Result<Vec<ProgramHeader>>
[src]
bytes: &[u8],
offset: usize,
count: usize,
ctx: Endian
) -> Result<Vec<ProgramHeader>>
fn from_bytes(bytes: &[u8], phnum: usize) -> Vec<ProgramHeader>
[src]
unsafe fn from_raw_parts<'a>(
phdrp: *const ProgramHeader,
phnum: usize
) -> &'a [ProgramHeader]
[src]
phdrp: *const ProgramHeader,
phnum: usize
) -> &'a [ProgramHeader]
fn from_fd(
fd: &mut File,
offset: u64,
count: usize
) -> Result<Vec<ProgramHeader>>
[src]
fd: &mut File,
offset: u64,
count: usize
) -> Result<Vec<ProgramHeader>>
Trait Implementations
impl Copy for ProgramHeader
[src]
impl Clone for ProgramHeader
[src]
fn clone(&self) -> ProgramHeader
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl PartialEq for ProgramHeader
[src]
fn eq(&self, __arg_0: &ProgramHeader) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &ProgramHeader) -> bool
[src]
This method tests for !=
.
impl Default for ProgramHeader
[src]
fn default() -> ProgramHeader
[src]
Returns the "default value" for a type. Read more
impl<'a> TryFromCtx<'a, Endian> for ProgramHeader where
ProgramHeader: 'a,
[src]
ProgramHeader: 'a,
type Error = Error
type Size = usize
fn try_from_ctx(
src: &'a [u8],
ctx: Endian
) -> Result<(Self, Self::Size), Self::Error>
[src]
src: &'a [u8],
ctx: Endian
) -> Result<(Self, Self::Size), Self::Error>
impl TryIntoCtx<Endian> for ProgramHeader
[src]
type Error = Error
type Size = usize
fn try_into_ctx(
self,
dst: &mut [u8],
ctx: Endian
) -> Result<Self::Size, Self::Error>
[src]
self,
dst: &mut [u8],
ctx: Endian
) -> Result<Self::Size, Self::Error>
impl SizeWith<Endian> for ProgramHeader
[src]
impl Plain for ProgramHeader
[src]
fn from_bytes(bytes: &[u8]) -> Result<&Self, Error>
[src]
fn slice_from_bytes(bytes: &[u8]) -> Result<&[Self], Error>
[src]
fn slice_from_bytes_len(bytes: &[u8], len: usize) -> Result<&[Self], Error>
[src]
fn from_mut_bytes(bytes: &mut [u8]) -> Result<&mut Self, Error>
[src]
fn slice_from_mut_bytes(bytes: &mut [u8]) -> Result<&mut [Self], Error>
[src]
fn slice_from_mut_bytes_len(
bytes: &mut [u8],
len: usize
) -> Result<&mut [Self], Error>
[src]
bytes: &mut [u8],
len: usize
) -> Result<&mut [Self], Error>
fn copy_from_bytes(&mut self, bytes: &[u8]) -> Result<(), Error>
[src]
impl From<ElfProgramHeader> for ProgramHeader
[src]
fn from(ph: ElfProgramHeader) -> Self
[src]
Performs the conversion.