pe_assembler/types/tables/
mod.rs

1use serde::{Deserialize, Serialize};
2
3/// 导入表条目
4#[derive(Debug, Clone, Serialize, Deserialize)]
5pub struct ImportEntry {
6    /// DLL 名称
7    pub dll_name: String,
8    /// 导入的函数列表
9    pub functions: Vec<String>,
10}
11
12/// 导入表结构
13///
14/// 描述 PE 文件从外部 DLL 导入的函数信息
15#[derive(Debug, Clone, Serialize, Deserialize)]
16pub struct ImportTable {
17    /// 导入条目列表
18    pub entries: Vec<ImportEntry>,
19}
20
21impl ImportTable {
22    pub fn new() -> Self {
23        Self { entries: Vec::new() }
24    }
25}
26
27impl Default for ImportTable {
28    fn default() -> Self {
29        Self::new()
30    }
31}
32
33/// 导出表结构
34///
35/// 描述 PE 文件向外部导出的函数信息
36#[derive(Debug, Clone, Serialize, Deserialize)]
37pub struct ExportTable {
38    /// 模块名称
39    pub name: String,
40    /// 导出的函数列表
41    pub functions: Vec<String>,
42}
43
44impl ExportTable {
45    pub fn new() -> Self {
46        Self { name: String::new(), functions: Vec::new() }
47    }
48}
49
50impl Default for ExportTable {
51    fn default() -> Self {
52        Self::new()
53    }
54}