ExeReader

Struct ExeReader 

Source
pub struct ExeReader<R> { /* private fields */ }
Expand description

EXE 结构,惰性读取器

Implementations§

Source§

impl<R> ExeReader<R>

Source

pub fn new(reader: R) -> Self

Source§

impl<W: Read + Seek> ExeReader<W>

Source

pub fn read_program(self) -> GaiaDiagnostics<PeProgram>

读取完整的 PE 程序(惰性读取,会缓存结果)

Source

pub fn view(&mut self) -> Result<PeInfo, GaiaError>

查看 EXE 文件信息

Trait Implementations§

Source§

impl<R: Debug> Debug for ExeReader<R>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<W: Read + Seek> PeReader<W> for ExeReader<W>

Source§

fn get_viewer(&mut self) -> &mut BinaryReader<W, LittleEndian>

获取二进制读取器的可变引用
Source§

fn add_diagnostics(&mut self, _error: impl Into<GaiaError>)

获取诊断信息的可变引用
Source§

fn get_cached_section_headers(&self) -> Option<&Vec<SectionHeader>>

获取缓存的节头信息
Source§

fn set_cached_section_headers(&mut self, headers: Vec<SectionHeader>)

设置缓存的节头信息
Source§

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

读取 PE 头部信息(通用实现)
Source§

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

强制读取完整的 PeProgram,并缓存结果
Source§

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

解析 PE 头部(通用实现)
Source§

fn read_section_headers(&mut self) -> Result<Vec<SectionHeader>, GaiaError>

读取节头信息(通用实现)
Source§

fn rva_to_file_offset( &self, rva: u32, sections: &[PeSection], ) -> Result<u32, GaiaError>

将 RVA 转换为文件偏移(通用实现)
Source§

fn read_section_from_header( &mut self, header: &SectionHeader, ) -> Result<PeSection, GaiaError>

从节头读取节数据(通用实现)
Source§

fn parse_import_table( &mut self, header: &PeHeader, sections: &[PeSection], ) -> Result<ImportTable, GaiaError>

解析导入表(通用实现)
Source§

fn parse_export_table( &mut self, header: &PeHeader, sections: &[PeSection], ) -> Result<ExportTable, GaiaError>

解析导出表(通用实现)
Source§

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

创建 PE 信息视图(通用实现)
Source§

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

Auto Trait Implementations§

§

impl<R> Freeze for ExeReader<R>
where R: Freeze,

§

impl<R> !RefUnwindSafe for ExeReader<R>

§

impl<R> Send for ExeReader<R>
where R: Send,

§

impl<R> Sync for ExeReader<R>
where R: Sync,

§

impl<R> Unpin for ExeReader<R>
where R: Unpin,

§

impl<R> !UnwindSafe for ExeReader<R>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,