Struct goblin::elf::section_header::section_header32::SectionHeader
[−]
[src]
#[repr(C)]pub struct SectionHeader { pub sh_name: u32, pub sh_type: u32, pub sh_flags: u32, pub sh_addr: u32, pub sh_offset: u32, pub sh_size: u32, pub sh_link: u32, pub sh_info: u32, pub sh_addralign: u32, pub sh_entsize: u32, }
Section Headers are typically used by humans and static linkers for additional information or how to relocate the object
NOTE section headers are strippable from a binary without any loss of portability/executability; do not rely on them being there!
Fields
sh_name: u32
Section name (string tbl index)
sh_type: u32
Section type
sh_flags: u32
Section flags
sh_addr: u32
Section virtual addr at execution
sh_offset: u32
Section file offset
sh_size: u32
Section size in bytes
sh_link: u32
Link to another section
sh_info: u32
Additional section information
sh_addralign: u32
Section alignment
sh_entsize: u32
Entry size if section holds table
Methods
impl SectionHeader
[src]
fn from_bytes(bytes: &[u8], shnum: usize) -> Vec<SectionHeader>
unsafe fn from_raw_parts<'a>(shdrp: *const SectionHeader,
shnum: usize)
-> &'a [SectionHeader]
shnum: usize)
-> &'a [SectionHeader]
fn from_fd(fd: &mut File,
offset: u64,
count: usize)
-> Result<Vec<SectionHeader>>
offset: u64,
count: usize)
-> Result<Vec<SectionHeader>>
Trait Implementations
impl From<ElfSectionHeader> for SectionHeader
[src]
fn from(sh: ElfSectionHeader) -> Self
Performs the conversion.
impl Copy for SectionHeader
[src]
impl Clone for SectionHeader
[src]
fn clone(&self) -> SectionHeader
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl Eq for SectionHeader
[src]
impl PartialEq for SectionHeader
[src]
fn eq(&self, __arg_0: &SectionHeader) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &SectionHeader) -> bool
This method tests for !=
.
impl Default for SectionHeader
[src]
fn default() -> SectionHeader
Returns the "default value" for a type. Read more
impl<'a> TryFromCtx<'a> for SectionHeader where SectionHeader: 'a
[src]
type Error = Error
fn try_from_ctx(src: &'a [u8],
(offset, ctx): (usize, Endian))
-> Result<Self, Self::Error>
(offset, ctx): (usize, Endian))
-> Result<Self, Self::Error>
impl TryIntoCtx for SectionHeader
[src]
type Error = Error
fn try_into_ctx(self,
dst: &mut [u8],
(offset, ctx): (usize, Endian))
-> Result<(), Self::Error>
dst: &mut [u8],
(offset, ctx): (usize, Endian))
-> Result<(), Self::Error>