diff options
author | pommicket <pommicket@gmail.com> | 2022-11-04 15:26:44 -0400 |
---|---|---|
committer | pommicket <pommicket@gmail.com> | 2022-11-04 15:26:44 -0400 |
commit | 273f02cd789c18346fb74021773c681405995c33 (patch) | |
tree | 44159a7de5628007983827e154a2a0e4ac2c6e9b /src/elf.rs | |
parent | 05de0fe271024ba67aa265974bc4d456dbfa3eba (diff) |
nice Executable struct (not working yet)
Diffstat (limited to 'src/elf.rs')
-rw-r--r-- | src/elf.rs | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -112,8 +112,8 @@ impl Default for Ehdr32 { } impl Ehdr32 { - pub fn offsetof_entry(&self) -> usize { - 0x18 + pub fn size_of() -> usize { + mem::size_of::<Self>() } pub fn section_offset(&self, ndx: u16) -> u64 { @@ -172,6 +172,10 @@ impl Default for Phdr32 { } impl Phdr32 { + pub fn size_of() -> usize { + mem::size_of::<Self>() + } + pub fn to_bytes(self) -> [u8; 0x20] { unsafe { mem::transmute(self) } } |