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, }
Expand description

A 64-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

Implementations

impl ProgramHeader[src]

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

pub fn from_bytes(bytes: &[u8], phnum: usize) -> Vec<ProgramHeader>

Notable traits for Vec<u8, A>

impl<A> Write for Vec<u8, A> where
    A: Allocator
[src]

pub unsafe fn from_raw_parts<'a>(
    phdrp: *const ProgramHeader,
    phnum: usize
) -> &'a [ProgramHeader]

Notable traits for &'_ [u8]

impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
[src]

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>>
[src]

Trait Implementations

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 Debug for ProgramHeader[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl Default for ProgramHeader[src]

fn default() -> ProgramHeader[src]

Returns the “default value” for a type. Read more

impl From<ProgramHeader> for ElfProgramHeader[src]

fn from(ph: ProgramHeader) -> Self[src]

Performs the conversion.

impl From<ProgramHeader> for ProgramHeader[src]

fn from(ph: ElfProgramHeader) -> Self[src]

Performs the conversion.

impl PartialEq<ProgramHeader> for ProgramHeader[src]

fn eq(&self, other: &ProgramHeader) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, other: &ProgramHeader) -> bool[src]

This method tests for !=.

impl Plain for ProgramHeader[src]

impl SizeWith<Endian> for ProgramHeader[src]

impl<'a> TryFromCtx<'a, Endian, [u8]> for ProgramHeader where
    ProgramHeader: 'a, 
[src]

type Error = Error

fn try_from_ctx(
    src: &'a [u8],
    ctx: Endian
) -> Result<(Self, usize), Self::Error>
[src]

impl<'a> TryIntoCtx<Endian, [u8]> for &'a ProgramHeader[src]

type Error = Error

fn try_into_ctx(self, dst: &mut [u8], ctx: Endian) -> Result<usize, Self::Error>[src]

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

type Error = Error

fn try_into_ctx(self, dst: &mut [u8], ctx: Endian) -> Result<usize, Self::Error>[src]

impl Copy for ProgramHeader[src]

impl StructuralPartialEq for ProgramHeader[src]

Auto Trait Implementations

Blanket Implementations

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

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

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

pub fn from(t: T) -> T[src]

Performs the conversion.

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

pub fn into(self) -> U[src]

Performs the conversion.

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

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

Creates owned data from borrowed data, usually by cloning. Read more

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

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.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

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.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.