pub struct DllReader<'config, R> { /* private fields */ }Implementations§
Source§impl<'config, R> DllReader<'config, R>
impl<'config, R> DllReader<'config, R>
Sourcepub fn new(reader: R, options: &'config DllReadConfig) -> Self
pub fn new(reader: R, options: &'config DllReadConfig) -> Self
Constructs a .NET reader (DLL) using a generic PE reader.
Note: This is a lazy constructor and will not immediately execute the parsing workflow.
Source§impl<'config, R> DllReader<'config, R>
impl<'config, R> DllReader<'config, R>
Sourcepub fn get_assembly_info(&mut self) -> Result<DotNetAssemblyInfo, GaiaError>
pub fn get_assembly_info(&mut self) -> Result<DotNetAssemblyInfo, GaiaError>
Lazily reads basic assembly information.
Only reads basic identification information of the assembly without parsing the full type system. Suitable for scenarios where you need to quickly get assembly name, version, etc.
§Returns
Ok(DotNetAssemblyInfo)- Basic assembly information.Err(GaiaError)- Error during the reading process.
Sourcepub fn to_clr_program(&mut self) -> Result<ClrProgram, GaiaError>
pub fn to_clr_program(&mut self) -> Result<ClrProgram, GaiaError>
Parses as a full CLR program.
Parses the entire .NET assembly, including all types, methods, fields, and other information. This is a heavyweight operation that consumes significant memory and time.
§Returns
Ok(ClrProgram)- Full representation of the CLR program.Err(GaiaError)- Error during the parsing process.
Sourcepub fn validate_assembly(&mut self) -> Result<Vec<String>, GaiaError>
pub fn validate_assembly(&mut self) -> Result<Vec<String>, GaiaError>
Validates the integrity of the assembly.
Checks if the parsed .NET assembly contains all required components:
- CLR Header: Contains runtime information.
- Metadata Header: Describes the type system.
- Metadata Streams: Contains the actual metadata.
§Returns
Ok(Vec<String>)- List of warning messages; an empty list indicates validation success.Err(GaiaError)- Error during the validation process.
Sourcepub fn get_assembly_summary(&mut self) -> String
pub fn get_assembly_summary(&mut self) -> String
Gets a summary of the assembly information.
Returns the basic information of the assembly in a friendly format, suitable for display or logging. If the assembly information is unavailable, it returns a corresponding error message.
§Returns
String- Formatted assembly information containing name, version, culture, public key token, and runtime version.