pe-assembler 0.1.1

PE/COFF assembler for Windows instruction sets - strongly typed, object-oriented, zero-dependency core
Documentation
use serde::{Deserialize, Serialize};

/// Import table entry
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ImportEntry {
    /// DLL name
    pub dll_name: String,
    /// List of imported functions
    pub functions: Vec<String>,
}

/// Import table structure
///
/// Describes the functions imported by the PE file from external DLLs
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ImportTable {
    /// List of import entries
    pub entries: Vec<ImportEntry>,
}

impl ImportTable {
    pub fn new() -> Self {
        Self { entries: Vec::new() }
    }
}

impl Default for ImportTable {
    fn default() -> Self {
        Self::new()
    }
}

/// Export table structure
///
/// Describes the functions exported by the PE file to external modules
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ExportTable {
    /// Module name
    pub name: String,
    /// List of exported functions
    pub functions: Vec<String>,
}

impl ExportTable {
    pub fn new() -> Self {
        Self { name: String::new(), functions: Vec::new() }
    }
}

impl Default for ExportTable {
    fn default() -> Self {
        Self::new()
    }
}