pubstructProgramHeader { /// Program segment type pub p_type: u32, /// Offset into the ELF file where this segment begins pub p_offset: u64, /// Virtual adress where this segment should be loaded pub p_vaddr: u64, /// Physical address where this segment should be loaded pub p_paddr: u64, /// Size of this segment in the file pub p_filesz: u64, /// Size of this segment in memory pub p_memsz: u64, /// Flags for this segment pub p_flags: u32, /// file and memory alignment pub p_align: u64, }
pubstructSectionHeader { /// Section Name,对应字符串在string table段中的偏移 pub sh_name: u32, /// Section Type pub sh_type: u32, /// Section Flags pub sh_flags: u64, /// in-memory address where this section is loaded pub sh_addr: u64, /// Byte-offset into the file where this section starts pub sh_offset: u64, /// Section size in bytes pub sh_size: u64, /// Defined by section type pub sh_link: u32, /// Defined by section type pub sh_info: u32, /// address alignment pub sh_addralign: u64, /// size of an entry if section data is an array of entries pub sh_entsize: u64, }