pe-assembler 0.1.1

PE/COFF assembler for Windows instruction sets - strongly typed, object-oriented, zero-dependency core
Documentation
#![doc = include_str!("readme.md")]

use crate::{formats::exe::writer::ExeWriter, helpers::PeWriter, types::PeProgram};
use gaia_types::{
    helpers::{create_file, Url},
    GaiaError,
};
use std::path::Path;

/// PE EXE reader module.
pub mod reader;
/// PE EXE writer module.
pub mod writer;

/// Writes a PE program to the specified file path.
pub fn exe_write_path(pe: &PeProgram, path: &Path) -> Result<Url, GaiaError> {
    let (file, url) = create_file(path)?;
    let mut exe = ExeWriter::new(file);
    exe.write_program(pe)?;
    Ok(url)
}