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]
fn clone(&self) -> SectionHeader
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for SectionHeader
[src]
impl Default for SectionHeader
[src]
fn default() -> SectionHeader
[src]
impl From<SectionHeader> for ElfSectionHeader
[src]
fn from(sh: SectionHeader) -> Self
[src]
impl From<SectionHeader> for SectionHeader
[src]
fn from(sh: ElfSectionHeader) -> Self
[src]
impl From<SectionHeader> for ElfSectionHeader
[src]
fn from(sh: SectionHeader) -> Self
[src]
impl From<SectionHeader> for SectionHeader
[src]
fn from(sh: ElfSectionHeader) -> Self
[src]
impl IntoCtx<Ctx, [u8]> for SectionHeader
[src]
impl PartialEq<SectionHeader> for SectionHeader
[src]
fn eq(&self, other: &SectionHeader) -> bool
[src]
fn ne(&self, other: &SectionHeader) -> bool
[src]
impl SizeWith<Ctx> for SectionHeader
[src]
impl StructuralPartialEq for SectionHeader
[src]
impl<'a> TryFromCtx<'a, Ctx, [u8]> for SectionHeader
[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 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,
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>,