[][src]Struct metagoblin::elf::program_header::ProgramHeader

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: u32p_flags: u32p_offset: u64p_vaddr: u64p_paddr: u64p_filesz: u64p_memsz: u64p_align: u64

Implementations

impl ProgramHeader[src]

pub fn size(ctx: Ctx) -> usize[src]

Return the size of the underlying program header, given a Ctx

pub fn new() -> ProgramHeader[src]

Create a new PT_LOAD ELF program header

pub fn file_range(&self) -> Range<usize>[src]

Returns this program header's file offset range

pub fn vm_range(&self) -> Range<usize>[src]

Returns this program header's virtual memory range

pub fn executable(&mut self)[src]

Sets the executable flag

pub fn write(&mut self)[src]

Sets the write flag

pub fn read(&mut self)[src]

Sets the read flag

pub fn is_executable(&self) -> bool[src]

Whether this program header is executable

pub fn is_read(&self) -> bool[src]

Whether this program header is readable

pub fn is_write(&self) -> bool[src]

Whether this program header is writable

pub fn parse(
    bytes: &[u8],
    offset: usize,
    count: usize,
    ctx: Ctx
) -> Result<Vec<ProgramHeader, Global>, Error>
[src]

Trait Implementations

impl Clone for ProgramHeader[src]

impl Debug for ProgramHeader[src]

impl Default for ProgramHeader[src]

impl<'a> From<&'a ProgramHeader> for MetaData[src]

impl<'a> From<&'a ProgramHeader> for Permissions[src]

impl From<ProgramHeader> for ProgramHeader[src]

impl From<ProgramHeader> for ProgramHeader[src]

impl From<ProgramHeader> for ProgramHeader[src]

impl From<ProgramHeader> for ProgramHeader[src]

impl PartialEq<ProgramHeader> for ProgramHeader[src]

impl SizeWith<Ctx> for ProgramHeader[src]

impl StructuralPartialEq for ProgramHeader[src]

impl<'a> TryFromCtx<'a, Ctx, [u8]> for ProgramHeader[src]

type Error = Error

impl TryIntoCtx<Ctx, [u8]> for ProgramHeader[src]

type Error = Error

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.