[][src]Struct metagoblin::elf::section_header::SectionHeader

pub struct SectionHeader {
    pub sh_name: usize,
    pub sh_type: u32,
    pub sh_flags: u64,
    pub sh_addr: u64,
    pub sh_offset: u64,
    pub sh_size: u64,
    pub sh_link: u32,
    pub sh_info: u32,
    pub sh_addralign: u64,
    pub sh_entsize: u64,
}

A unified SectionHeader - convertable to and from 32-bit and 64-bit variants

Fields

sh_name: usize

Section name (string tbl index)

sh_type: u32

Section type

sh_flags: u64

Section flags

sh_addr: u64

Section virtual addr at execution

sh_offset: u64

Section file offset

sh_size: u64

Section size in bytes

sh_link: u32

Link to another section

sh_info: u32

Additional section information

sh_addralign: u64

Section alignment

sh_entsize: u64

Entry size if section holds table

Implementations

impl SectionHeader[src]

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

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

pub fn new() -> SectionHeader[src]

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

Returns this section header's file offset range

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

Returns this section header's virtual memory range

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

Parse count section headers from bytes at offset, using the given ctx

pub fn check_size(&self, size: usize) -> Result<(), Error>[src]

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

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

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

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

Trait Implementations

impl Clone for SectionHeader[src]

impl Debug for SectionHeader[src]

impl Default for SectionHeader[src]

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

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

impl From<SectionHeader> for SectionHeader[src]

impl From<SectionHeader> for SectionHeader[src]

impl From<SectionHeader> for SectionHeader[src]

impl From<SectionHeader> for SectionHeader[src]

impl IntoCtx<Ctx, [u8]> for SectionHeader[src]

impl PartialEq<SectionHeader> for SectionHeader[src]

impl SizeWith<Ctx> for SectionHeader[src]

impl StructuralPartialEq for SectionHeader[src]

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

type Error = Error

impl TryIntoCtx<Ctx, [u8]> for SectionHeader[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.