Struct object::pe::ImageSectionHeader
source · [−]#[repr(C)]pub struct ImageSectionHeader {
pub name: [u8; 8],
pub virtual_size: U32<LE>,
pub virtual_address: U32<LE>,
pub size_of_raw_data: U32<LE>,
pub pointer_to_raw_data: U32<LE>,
pub pointer_to_relocations: U32<LE>,
pub pointer_to_linenumbers: U32<LE>,
pub number_of_relocations: U16<LE>,
pub number_of_linenumbers: U16<LE>,
pub characteristics: U32<LE>,
}
Fields
name: [u8; 8]
virtual_size: U32<LE>
virtual_address: U32<LE>
size_of_raw_data: U32<LE>
pointer_to_raw_data: U32<LE>
pointer_to_relocations: U32<LE>
pointer_to_linenumbers: U32<LE>
number_of_relocations: U16<LE>
number_of_linenumbers: U16<LE>
characteristics: U32<LE>
Implementations
sourceimpl ImageSectionHeader
impl ImageSectionHeader
sourcepub fn name<'data, R: ReadRef<'data>>(
&'data self,
strings: StringTable<'data, R>
) -> Result<&'data [u8]>
pub fn name<'data, R: ReadRef<'data>>(
&'data self,
strings: StringTable<'data, R>
) -> Result<&'data [u8]>
Return the section name.
This handles decoding names that are offsets into the symbol string table.
sourcepub fn raw_name(&self) -> &[u8]ⓘNotable traits for &'_ [u8]impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
pub fn raw_name(&self) -> &[u8]ⓘNotable traits for &'_ [u8]impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
Return the raw section name.
sourcepub fn coff_file_range(&self) -> Option<(u32, u32)>
pub fn coff_file_range(&self) -> Option<(u32, u32)>
Return the offset and size of the section in a COFF file.
Returns None
for sections that have no data in the file.
sourcepub fn coff_data<'data, R: ReadRef<'data>>(
&self,
data: R
) -> Result<&'data [u8], ()>
pub fn coff_data<'data, R: ReadRef<'data>>(
&self,
data: R
) -> Result<&'data [u8], ()>
Return the section data in a COFF file.
Returns Ok(&[])
if the section has no data.
Returns Err
for invalid values.
sourcepub fn coff_alignment(&self) -> u64
pub fn coff_alignment(&self) -> u64
Return the section alignment in bytes.
This is only valid for sections in a COFF file.
sourcepub fn coff_relocations<'data, R: ReadRef<'data>>(
&self,
data: R
) -> Result<&'data [ImageRelocation]>
pub fn coff_relocations<'data, R: ReadRef<'data>>(
&self,
data: R
) -> Result<&'data [ImageRelocation]>
Read the relocations in a COFF file.
data
must be the entire file data.
sourceimpl ImageSectionHeader
impl ImageSectionHeader
Trait Implementations
sourceimpl Clone for ImageSectionHeader
impl Clone for ImageSectionHeader
sourcefn clone(&self) -> ImageSectionHeader
fn clone(&self) -> ImageSectionHeader
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for ImageSectionHeader
impl Debug for ImageSectionHeader
impl Copy for ImageSectionHeader
impl Pod for ImageSectionHeader
Auto Trait Implementations
impl RefUnwindSafe for ImageSectionHeader
impl Send for ImageSectionHeader
impl Sync for ImageSectionHeader
impl Unpin for ImageSectionHeader
impl UnwindSafe for ImageSectionHeader
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more