#[repr(C)]pub struct Phdr64 {
pub p_type: Elf64Word,
pub p_flags: Elf64Word,
pub p_offset: Elf64Off,
pub p_vaddr: Elf64Addr,
pub p_paddr: Elf64Addr,
pub p_filesz: Elf64Xword,
pub p_memsz: Elf64Xword,
pub p_align: Elf64Xword,
}
Fields§
§p_type: Elf64Word
Segment type
p_flags: Elf64Word
Segment flags
p_offset: Elf64Off
Segment file offset
p_vaddr: Elf64Addr
Segment virtual address
p_paddr: Elf64Addr
Segment physical address
p_filesz: Elf64Xword
Segment size in file
p_memsz: Elf64Xword
Segment size in memory
p_align: Elf64Xword
Segment alignment
Implementations§
Source§impl Phdr64
impl Phdr64
pub const SIZE: usize = 56usize
pub fn get_type(&self) -> Type
pub fn get_flags(&self) -> HashSet<Flag>
Sourcepub fn set_type(&mut self, ptype: Type)
pub fn set_type(&mut self, ptype: Type)
§Examples
use elf_utilities::segment;
let mut phdr : segment::Phdr64 = Default::default();
phdr.set_type(segment::Type::Load);
assert_eq!(phdr.get_type(), segment::Type::Load);
pub fn set_flags<'a, I>(&mut self, flags: I)
Sourcepub fn to_le_bytes(&self) -> Vec<u8> ⓘ
pub fn to_le_bytes(&self) -> Vec<u8> ⓘ
Create Vec
§Examples
use elf_utilities::segment::Phdr64;
let null_phdr : Phdr64 = Default::default();
assert_eq!([0].repeat(Phdr64::SIZE), null_phdr.to_le_bytes());
pub fn deserialize(buf: &[u8], start: usize) -> Result<Self, Box<dyn Error>>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Phdr64
impl<'de> Deserialize<'de> for Phdr64
Source§fn 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
Source§impl Ord for Phdr64
impl Ord for Phdr64
Source§impl PartialOrd for Phdr64
impl PartialOrd for Phdr64
impl Copy for Phdr64
impl Eq for Phdr64
impl StructuralPartialEq for Phdr64
Auto Trait Implementations§
impl Freeze for Phdr64
impl RefUnwindSafe for Phdr64
impl Send for Phdr64
impl Sync for Phdr64
impl Unpin for Phdr64
impl UnwindSafe for Phdr64
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more