pub struct PeProgram {
pub header: PeHeader,
pub sections: Vec<PeSection>,
pub imports: ImportTable,
pub exports: ExportTable,
}Expand description
PE 程序结构
表示一个完整的 PE(Portable Executable)程序,包含所有头部信息和节数据。 这是 PE 文件的最高级别抽象,包含了文件解析后的完整内容。
Fields§
§header: PeHeaderPE 头部信息,包含 DOS 头、NT 头、COFF 头和可选头
sections: Vec<PeSection>所有节的集合,包含代码、数据、资源等
imports: ImportTable导入表,包含程序依赖的外部函数和库
exports: ExportTable导出表,包含程序向外提供的函数和符号
Implementations§
Source§impl PeProgram
impl PeProgram
Sourcepub fn create_executable(machine_code: Vec<u8>) -> Self
pub fn create_executable(machine_code: Vec<u8>) -> Self
从原始机器码创建简单的可执行 PE 程序
Sourcepub fn with_imports(self, imports: ImportTable) -> Self
pub fn with_imports(self, imports: ImportTable) -> Self
为程序添加导入表并自动创建 .idata 节
Trait Implementations§
Source§impl<'de> Deserialize<'de> for PeProgram
impl<'de> Deserialize<'de> for PeProgram
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
Auto Trait Implementations§
impl Freeze for PeProgram
impl RefUnwindSafe for PeProgram
impl Send for PeProgram
impl Sync for PeProgram
impl Unpin for PeProgram
impl UnwindSafe for PeProgram
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