Struct goblin::elf::section_header::SectionHeader [−][src]
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() -> Self
[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>>
[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 Clone for SectionHeader
[src][+]
impl Debug for SectionHeader
[src][+]
impl Default for SectionHeader
[src][+]
impl From<SectionHeader> for ElfSectionHeader
[src][+]
impl From<SectionHeader> for SectionHeader
[src][+]
impl From<SectionHeader> for ElfSectionHeader
[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][+]
impl TryIntoCtx<Ctx, [u8]> for SectionHeader
[src][+]
Auto Trait Implementations
impl RefUnwindSafe for SectionHeader
impl Send for SectionHeader
impl Sync for SectionHeader
impl Unpin for SectionHeader
impl UnwindSafe for SectionHeader
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,
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,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src][+]
U: Into<T>,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src][+]
U: TryFrom<T>,