Struct goblin::elf::program_header::ProgramHeader
[−]
[src]
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 unified ProgramHeader - convertable to and from 32-bit and 64-bit variants
Fields
p_type: u32
p_flags: u32
p_offset: u64
p_vaddr: u64
p_paddr: u64
p_filesz: u64
p_memsz: u64
p_align: u64
Methods
impl ProgramHeader
[src]
fn size(ctx: &Ctx) -> usize
Return the size of the underlying program header, given a Ctx
fn new() -> Self
Create a new PT_LOAD
ELF program header
fn executable(&mut self)
Sets the executable flag
fn write(&mut self)
Sets the write flag
fn read(&mut self)
Sets the read flag
fn parse(
bytes: &[u8],
offset: usize,
count: usize,
ctx: Ctx
) -> Result<Vec<ProgramHeader>>
bytes: &[u8],
offset: usize,
count: usize,
ctx: Ctx
) -> Result<Vec<ProgramHeader>>
Trait Implementations
impl Default for ProgramHeader
[src]
fn default() -> ProgramHeader
Returns the "default value" for a type. Read more
impl PartialEq for ProgramHeader
[src]
fn eq(&self, __arg_0: &ProgramHeader) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &ProgramHeader) -> bool
This method tests for !=
.
impl Clone for ProgramHeader
[src]
fn clone(&self) -> ProgramHeader
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl Debug for ProgramHeader
[src]
impl SizeWith<Ctx> for ProgramHeader
[src]
impl<'a> TryFromCtx<'a, (usize, Ctx)> for ProgramHeader
[src]
type Error = Error
fn try_from_ctx(
bytes: &'a [u8],
(offset, Ctx { container: container, le: le }): (usize, Ctx)
) -> Result<Self, Self::Error>
bytes: &'a [u8],
(offset, Ctx { container: container, le: le }): (usize, Ctx)
) -> Result<Self, Self::Error>
impl TryIntoCtx<(usize, Ctx)> for ProgramHeader
[src]
type Error = Error
fn try_into_ctx(
self,
bytes: &mut [u8],
(offset, Ctx { container: container, le: le }): (usize, Ctx)
) -> Result<(), Self::Error>
self,
bytes: &mut [u8],
(offset, Ctx { container: container, le: le }): (usize, Ctx)
) -> Result<(), Self::Error>
impl From<ProgramHeader> for ElfProgramHeader
[src]
fn from(ph: ProgramHeader) -> Self
Performs the conversion.
impl From<ProgramHeader> for ElfProgramHeader
[src]
fn from(ph: ProgramHeader) -> Self
Performs the conversion.