Trait VmiOsModule

Source
pub trait VmiOsModule<'a, Driver>: VmiVa + 'a
where Driver: VmiDriver,
{ type Os: VmiOs<Driver>; // Required methods fn base_address(&self) -> Result<Va, VmiError>; fn size(&self) -> Result<u64, VmiError>; fn name(&self) -> Result<String, VmiError>; }
Expand description

A trait for kernel modules.

This trait provides an abstraction over dynamically loaded modules, such as kernel drivers and shared libraries, within a guest OS.

Required Associated Types§

Source

type Os: VmiOs<Driver>

The VMI OS type.

Required Methods§

Source

fn base_address(&self) -> Result<Va, VmiError>

Returns the base address of the module.

§Platform-specific
  • Windows: KLDR_DATA_TABLE_ENTRY.DllBase
  • Linux:
    • since v6.4-rc1: module::mem[0 /* MOD_TEXT */].base
    • before v6.4-rc1: module::core_layout.base
Source

fn size(&self) -> Result<u64, VmiError>

Returns the size of the module.

§Platform-specific
  • Windows: KLDR_DATA_TABLE_ENTRY.SizeOfImage
  • Linux:
    • since v6.4-rc1: sum of module::mem[MOD_*].size
    • before v6.4-rc1: module::init_layout.size + module::core_layout.size (+ module::data_layout.size)
Source

fn name(&self) -> Result<String, VmiError>

Returns the name of the module.

§Platform-specific
  • Windows: KLDR_DATA_TABLE_ENTRY.BaseDllName
  • Linux: module::name

Implementors§

Source§

impl<Driver> VmiOsModule<'_, Driver> for NoOS
where Driver: VmiDriver,