Struct elf_utilities::header::Ehdr64
source · [−]#[repr(C)]pub struct Ehdr64 {Show 14 fields
pub e_ident: [u8; 16],
pub e_type: Elf64Half,
pub e_machine: Elf64Half,
pub e_version: Elf64Word,
pub e_entry: Elf64Addr,
pub e_phoff: Elf64Off,
pub e_shoff: Elf64Off,
pub e_flags: Elf64Word,
pub e_ehsize: Elf64Half,
pub e_phentsize: Elf64Half,
pub e_phnum: Elf64Half,
pub e_shentsize: Elf64Half,
pub e_shnum: Elf64Half,
pub e_shstrndx: Elf64Half,
}Fields
e_ident: [u8; 16]e_type: Elf64Halfe_machine: Elf64Halfe_version: Elf64Worde_entry: Elf64Addre_phoff: Elf64Offe_shoff: Elf64Offe_flags: Elf64Worde_ehsize: Elf64Halfe_phentsize: Elf64Halfe_phnum: Elf64Halfe_shentsize: Elf64Halfe_shnum: Elf64Halfe_shstrndx: Elf64HalfImplementations
sourceimpl Ehdr64
impl Ehdr64
pub fn size() -> Elf64Half
pub fn get_class(&self) -> ELFCLASS
pub fn get_data(&self) -> ELFDATA
pub fn get_file_version(&self) -> ELFVERSION
pub fn get_object_version(&self) -> ELFVERSION
pub fn get_type(&self) -> ELFTYPE
pub fn get_machine(&self) -> ELFMACHINE
pub fn get_osabi(&self) -> ELFOSABI
pub fn set_class(&mut self, c: ELFCLASS)
pub fn set_data(&mut self, d: ELFDATA)
pub fn set_file_version(&mut self, v: ELFVERSION)
pub fn set_object_version(&mut self, v: ELFVERSION)
pub fn set_osabi(&mut self, o: ELFOSABI)
pub fn set_elf_type(&mut self, e_type: ELFTYPE)
pub fn set_machine(&mut self, e_machine: ELFMACHINE)
sourcepub fn to_le_bytes(&self) -> Vec<u8>
pub fn to_le_bytes(&self) -> Vec<u8>
Create Vec
Examples
use elf_utilities::header::Ehdr64;
let null_ehdr : Ehdr64 = Default::default();
assert_eq!(
vec![
0x7f, 0x45, 0x4c, 0x46, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
],
null_ehdr.to_le_bytes()
);pub fn deserialize(buf: &[u8], start: usize) -> Result<Self, Box<dyn Error>>
Trait Implementations
sourceimpl<'de> Deserialize<'de> for Ehdr64
impl<'de> Deserialize<'de> for Ehdr64
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl Ord for Ehdr64
impl Ord for Ehdr64
sourceimpl PartialOrd<Ehdr64> for Ehdr64
impl PartialOrd<Ehdr64> for Ehdr64
sourcefn partial_cmp(&self, other: &Ehdr64) -> Option<Ordering>
fn partial_cmp(&self, other: &Ehdr64) -> Option<Ordering>
This method returns an ordering between self and other values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
impl Copy for Ehdr64
impl Eq for Ehdr64
impl StructuralEq for Ehdr64
impl StructuralPartialEq for Ehdr64
Auto Trait Implementations
impl RefUnwindSafe for Ehdr64
impl Send for Ehdr64
impl Sync for Ehdr64
impl Unpin for Ehdr64
impl UnwindSafe for Ehdr64
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)
🔬 This is a nightly-only experimental API. (
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more