Skip to main content

StructLayout

Trait StructLayout 

Source
pub trait StructLayout {
    const ADDRESS_WIDTH: u64;

    // Required methods
    fn read_va<Driver>(
        vmi: VmiState<'_, WindowsOs<Driver>>,
        ctx: impl Into<AccessContext>,
    ) -> Result<Va, VmiError>
       where Driver: VmiRead,
             Driver::Architecture: ArchAdapter<Driver>;
    fn read_unicode_string<Driver>(
        vmi: VmiState<'_, WindowsOs<Driver>>,
        ctx: impl Into<AccessContext>,
    ) -> Result<String, VmiError>
       where Driver: VmiRead,
             Driver::Architecture: ArchAdapter<Driver>;
}
Expand description

Pointer-width-dependent operations for reading Windows structures.

Windows structures contain pointer-sized fields (PVOID, UNICODE_STRING, LIST_ENTRY, …) whose layout differs between 32-bit and 64-bit processes. This trait abstracts over the pointer width so that structure accessors can be generic over both layouts.

Required Associated Constants§

Source

const ADDRESS_WIDTH: u64

The address width (i.e. pointer size) in bytes.

Required Methods§

Source

fn read_va<Driver>( vmi: VmiState<'_, WindowsOs<Driver>>, ctx: impl Into<AccessContext>, ) -> Result<Va, VmiError>
where Driver: VmiRead, Driver::Architecture: ArchAdapter<Driver>,

Reads a pointer-sized virtual address from guest memory.

Source

fn read_unicode_string<Driver>( vmi: VmiState<'_, WindowsOs<Driver>>, ctx: impl Into<AccessContext>, ) -> Result<String, VmiError>
where Driver: VmiRead, Driver::Architecture: ArchAdapter<Driver>,

Reads a UNICODE_STRING from guest memory.

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.

Implementors§