pub trait PeReader<R: Read + Seek> {
// Required methods
fn get_viewer(&mut self) -> &mut R;
fn add_diagnostics(&mut self, error: impl Into<GaiaError>);
fn get_section_headers(&mut self) -> Result<&[SectionHeader], GaiaError>;
fn get_pe_header(&mut self) -> Result<&PeHeader, GaiaError>;
fn get_program(&mut self) -> Result<&PeProgram, GaiaError>;
// Provided methods
fn get_position(&mut self) -> Result<u64, GaiaError>
where R: Seek { ... }
fn set_position(&mut self, offset: u64) -> Result<u64, GaiaError>
where R: Seek { ... }
fn rva_to_file_offset(
&self,
rva: u32,
sections: &[PeSection],
) -> Result<u32, GaiaError> { ... }
fn parse_import_table(
&mut self,
header: &PeHeader,
sections: &[PeSection],
) -> Result<ImportTable, GaiaError> { ... }
fn parse_export_table(
&mut self,
header: &PeHeader,
sections: &[PeSection],
) -> Result<ExportTable, GaiaError> { ... }
fn create_pe_info(&mut self) -> Result<PeInfo, GaiaError> { ... }
}Expand description
Common trait for PE file readers
Required Methods§
Sourcefn get_viewer(&mut self) -> &mut R
fn get_viewer(&mut self) -> &mut R
Get a mutable reference to the binary reader
Sourcefn add_diagnostics(&mut self, error: impl Into<GaiaError>)
fn add_diagnostics(&mut self, error: impl Into<GaiaError>)
Get a mutable reference to diagnostics information
Sourcefn get_section_headers(&mut self) -> Result<&[SectionHeader], GaiaError>
fn get_section_headers(&mut self) -> Result<&[SectionHeader], GaiaError>
Get cached section headers
Sourcefn get_pe_header(&mut self) -> Result<&PeHeader, GaiaError>
fn get_pe_header(&mut self) -> Result<&PeHeader, GaiaError>
Read PE header information (generic implementation)
Provided Methods§
fn get_position(&mut self) -> Result<u64, GaiaError>where
R: Seek,
fn set_position(&mut self, offset: u64) -> Result<u64, GaiaError>where
R: Seek,
Sourcefn rva_to_file_offset(
&self,
rva: u32,
sections: &[PeSection],
) -> Result<u32, GaiaError>
fn rva_to_file_offset( &self, rva: u32, sections: &[PeSection], ) -> Result<u32, GaiaError>
Convert RVA to file offset (generic implementation)
Sourcefn parse_import_table(
&mut self,
header: &PeHeader,
sections: &[PeSection],
) -> Result<ImportTable, GaiaError>
fn parse_import_table( &mut self, header: &PeHeader, sections: &[PeSection], ) -> Result<ImportTable, GaiaError>
Parse import table (generic implementation)
Sourcefn parse_export_table(
&mut self,
header: &PeHeader,
sections: &[PeSection],
) -> Result<ExportTable, GaiaError>
fn parse_export_table( &mut self, header: &PeHeader, sections: &[PeSection], ) -> Result<ExportTable, GaiaError>
Parse export table (generic implementation)
Sourcefn create_pe_info(&mut self) -> Result<PeInfo, GaiaError>
fn create_pe_info(&mut self) -> Result<PeInfo, GaiaError>
Create PE info view (generic implementation)
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.