pub struct ElfFile {
pub header: ElfHeader64,
pub program_headers: Vec<ProgramHeader64>,
pub section_headers: Vec<SectionHeader64>,
pub data: Vec<u8>,
}Expand description
ELF 文件构建器
用于构建完整的 ELF 文件结构
Fields§
§header: ElfHeader64ELF 头
program_headers: Vec<ProgramHeader64>程序头表
section_headers: Vec<SectionHeader64>节头表
data: Vec<u8>文件数据
Implementations§
Source§impl ElfFile
impl ElfFile
Sourcepub fn add_program_header(&mut self, header: ProgramHeader64)
pub fn add_program_header(&mut self, header: ProgramHeader64)
添加程序头
Sourcepub fn set_entry_point(&mut self, entry: u64)
pub fn set_entry_point(&mut self, entry: u64)
设置入口点
Sourcepub fn create_executable(machine_code: Vec<u8>) -> Self
pub fn create_executable(machine_code: Vec<u8>) -> Self
从原始机器码创建简单的可执行 ELF 文件
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ElfFile
impl RefUnwindSafe for ElfFile
impl Send for ElfFile
impl Sync for ElfFile
impl Unpin for ElfFile
impl UnsafeUnpin for ElfFile
impl UnwindSafe for ElfFile
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