Skip to main content

PeWriter

Trait PeWriter 

Source
pub trait PeWriter<W: Write + Seek> {
Show 13 methods // Required method fn get_writer(&mut self) -> &mut W; // Provided methods fn stream_position(&mut self) -> Result<u64, GaiaError> { ... } fn write_program(&mut self, program: &PeProgram) -> Result<(), GaiaError> { ... } fn write_import_table( &mut self, program: &PeProgram, ) -> Result<(), GaiaError> { ... } fn write_dos_header( &mut self, dos_header: &DosHeader, ) -> Result<(), GaiaError> { ... } fn write_dos_stub(&mut self) -> Result<(), GaiaError> { ... } fn write_nt_header(&mut self, nt_header: &NtHeader) -> Result<(), GaiaError> { ... } fn write_coff_header( &mut self, coff_header: &CoffHeader, ) -> Result<(), GaiaError> { ... } fn write_optional_header( &mut self, optional_header: &OptionalHeader, ) -> Result<(), GaiaError> { ... } fn write_data_directory( &mut self, data_dir: &DataDirectory, ) -> Result<(), GaiaError> { ... } fn write_section_header( &mut self, section: &PeSection, ) -> Result<(), GaiaError> { ... } fn pad_to_offset(&mut self, target_offset: u64) -> Result<(), GaiaError> { ... } fn align_to_boundary(&mut self, alignment: u32) -> Result<(), GaiaError> { ... }
}
Expand description

Common trait for PE file writers

Required Methods§

Source

fn get_writer(&mut self) -> &mut W

Get a mutable reference to the writer

Provided Methods§

Source

fn stream_position(&mut self) -> Result<u64, GaiaError>

Get the current stream position

Source

fn write_program(&mut self, program: &PeProgram) -> Result<(), GaiaError>

Write the PE program to the stream (common implementation)

Source

fn write_import_table(&mut self, program: &PeProgram) -> Result<(), GaiaError>

Write the import table (common implementation)

Source

fn write_dos_header(&mut self, dos_header: &DosHeader) -> Result<(), GaiaError>

Write DOS header (common implementation)

Source

fn write_dos_stub(&mut self) -> Result<(), GaiaError>

Write DOS stub (common implementation)

Source

fn write_nt_header(&mut self, nt_header: &NtHeader) -> Result<(), GaiaError>

Write NT header (common implementation)

Source

fn write_coff_header( &mut self, coff_header: &CoffHeader, ) -> Result<(), GaiaError>

Write COFF header (common implementation)

Source

fn write_optional_header( &mut self, optional_header: &OptionalHeader, ) -> Result<(), GaiaError>

Write optional header (common implementation)

Source

fn write_data_directory( &mut self, data_dir: &DataDirectory, ) -> Result<(), GaiaError>

Write data directory (common implementation)

Source

fn write_section_header(&mut self, section: &PeSection) -> Result<(), GaiaError>

Write section header (common implementation)

Source

fn pad_to_offset(&mut self, target_offset: u64) -> Result<(), GaiaError>

Pad to specified offset (common implementation)

Source

fn align_to_boundary(&mut self, alignment: u32) -> Result<(), GaiaError>

Align to boundary (common implementation)

Implementors§

Source§

impl<W: Write + Seek> PeWriter<W> for DllWriter<W>

Source§

impl<W: Write + Seek> PeWriter<W> for ExeWriter<W>