Struct goblin::elf::section_header::SectionHeader
[−]
[src]
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
Methods
impl SectionHeader
[src]
pub fn size(ctx: &Ctx) -> usize
[src]
Return the size of the underlying program header, given a container
pub fn new() -> Self
[src]
ⓘImportant traits for Range<A>pub fn file_range(&self) -> Range<usize>
[src]
Returns this section header's file offset range
ⓘImportant traits for Range<A>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>>
[src]
bytes: &[u8],
offset: usize,
count: usize,
ctx: Ctx
) -> Result<Vec<SectionHeader>>
Parse count
section headers from bytes
at offset
, using the given ctx
pub fn check_size(&self, size: usize) -> Result<()>
[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 From<SectionHeader> for ElfSectionHeader
[src]
fn from(sh: SectionHeader) -> Self
[src]
Performs the conversion.
impl From<ElfSectionHeader> for SectionHeader
[src]
fn from(sh: ElfSectionHeader) -> Self
[src]
Performs the conversion.
impl From<SectionHeader> for ElfSectionHeader
[src]
fn from(sh: SectionHeader) -> Self
[src]
Performs the conversion.
impl From<ElfSectionHeader> for SectionHeader
[src]
fn from(sh: ElfSectionHeader) -> Self
[src]
Performs the conversion.
impl Default for SectionHeader
[src]
fn default() -> SectionHeader
[src]
Returns the "default value" for a type. Read more
impl PartialEq for SectionHeader
[src]
fn eq(&self, __arg_0: &SectionHeader) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &SectionHeader) -> bool
[src]
This method tests for !=
.
impl Clone for SectionHeader
[src]
fn clone(&self) -> SectionHeader
[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 SectionHeader
[src]
fn fmt(&self, f: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl SizeWith<Ctx> for SectionHeader
[src]
impl<'a> TryFromCtx<'a, Ctx> for SectionHeader
[src]
type Error = Error
type Size = usize
fn try_from_ctx(
bytes: &'a [u8],
Ctx { container: container, le: le }: Ctx
) -> Result<(Self, Self::Size), Self::Error>
[src]
bytes: &'a [u8],
Ctx { container: container, le: le }: Ctx
) -> Result<(Self, Self::Size), Self::Error>
impl TryIntoCtx<Ctx> for SectionHeader
[src]
type Error = Error
type Size = usize
fn try_into_ctx(
self,
bytes: &mut [u8],
Ctx { container: container, le: le }: Ctx
) -> Result<Self::Size, Self::Error>
[src]
self,
bytes: &mut [u8],
Ctx { container: container, le: le }: Ctx
) -> Result<Self::Size, Self::Error>