Struct goblin::elf::program_header::ProgramHeader [−][src]
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
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() -> Self
[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>>
[src]
bytes: &[u8],
offset: usize,
count: usize,
ctx: Ctx
) -> Result<Vec<ProgramHeader>>
Trait Implementations
impl Clone for ProgramHeader
[src]
fn clone(&self) -> ProgramHeader
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for ProgramHeader
[src]
impl Default for ProgramHeader
[src]
fn default() -> ProgramHeader
[src]
impl From<ProgramHeader> for ElfProgramHeader
[src]
fn from(ph: ProgramHeader) -> Self
[src]
impl From<ProgramHeader> for ProgramHeader
[src]
fn from(ph: ElfProgramHeader) -> Self
[src]
impl From<ProgramHeader> for ElfProgramHeader
[src]
fn from(ph: ProgramHeader) -> Self
[src]
impl From<ProgramHeader> for ProgramHeader
[src]
fn from(ph: ElfProgramHeader) -> Self
[src]
impl PartialEq<ProgramHeader> for ProgramHeader
[src]
fn eq(&self, other: &ProgramHeader) -> bool
[src]
fn ne(&self, other: &ProgramHeader) -> bool
[src]
impl SizeWith<Ctx> for ProgramHeader
[src]
impl StructuralPartialEq for ProgramHeader
[src]
impl<'a> TryFromCtx<'a, Ctx, [u8]> for ProgramHeader
[src]
type Error = Error
fn try_from_ctx(
bytes: &'a [u8],
Ctx { container: container, le: le }: Ctx
) -> Result<(Self, usize), Self::Error>
[src]
bytes: &'a [u8],
Ctx { container: container, le: le }: Ctx
) -> Result<(Self, usize), Self::Error>
impl TryIntoCtx<Ctx, [u8]> for ProgramHeader
[src]
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
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
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]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,