pub trait OsInner<'a>: Send {
    type ProcessType: Process + MemoryView + 'a;
    type IntoProcessType: Process + MemoryView + Clone + 'static;
Show 21 methods fn process_address_list_callback(
        &mut self,
        callback: AddressCallback<'_>
    ) -> Result<()>;
fn process_info_by_address(
        &mut self,
        address: Address
    ) -> Result<ProcessInfo>;
fn process_by_info(
        &'a mut self,
        info: ProcessInfo
    ) -> Result<Self::ProcessType>;
fn into_process_by_info(
        self,
        info: ProcessInfo
    ) -> Result<Self::IntoProcessType>;
fn module_address_list_callback(
        &mut self,
        callback: AddressCallback<'_>
    ) -> Result<()>;
fn module_by_address(&mut self, address: Address) -> Result<ModuleInfo>;
fn info(&self) -> &OsInfo; fn process_address_list(&mut self) -> Result<Vec<Address>> { ... }
fn process_info_list_callback(
        &mut self,
        callback: ProcessInfoCallback<'_>
    ) -> Result<()> { ... }
fn process_info_list(&mut self) -> Result<Vec<ProcessInfo>> { ... }
fn process_info_by_name(&mut self, name: &str) -> Result<ProcessInfo> { ... }
fn process_info_by_pid(&mut self, pid: Pid) -> Result<ProcessInfo> { ... }
fn process_by_address(
        &'a mut self,
        addr: Address
    ) -> Result<Self::ProcessType> { ... }
fn process_by_name(&'a mut self, name: &str) -> Result<Self::ProcessType> { ... }
fn process_by_pid(&'a mut self, pid: Pid) -> Result<Self::ProcessType> { ... }
fn into_process_by_address(
        self,
        addr: Address
    ) -> Result<Self::IntoProcessType>
    where
        Self: Sized
, { ... }
fn into_process_by_name(self, name: &str) -> Result<Self::IntoProcessType>
    where
        Self: Sized
, { ... }
fn into_process_by_pid(self, pid: Pid) -> Result<Self::IntoProcessType>
    where
        Self: Sized
, { ... }
fn module_list_callback(
        &mut self,
        callback: ModuleInfoCallback<'_>
    ) -> Result<()> { ... }
fn module_list(&mut self) -> Result<Vec<ModuleInfo>> { ... }
fn module_by_name(&mut self, name: &str) -> Result<ModuleInfo> { ... }
}
Expand description

High level OS trait implemented by OS layers.

This trait provides all necessary functions for handling an OS, retrieving processes, and moving resources into processes.

There are also methods for accessing system level modules.

Associated Types

Required methods

Walks a process list and calls a callback for each process structure address

The callback is fully opaque. We need this style so that C FFI can work seamlessly.

Find process information by its internal address

Construct a process by its info, borrowing the OS

It will share the underlying memory resources

Construct a process by its info, consuming the OS

This function will consume the Kernel instance and move its resources into the process

Walks the OS module list and calls the provided callback for each module structure address

Arguments
  • callback - where to pass each matching module to. This is an opaque callback.

Retrieves a module by its structure address

Arguments
  • address - address where module’s information resides in

Retrieves the OS info

Provided methods

Retrieves a process address list

This will be a list of unique internal addresses for underlying process structures

Walks a process list and calls a callback for each process

The callback is fully opaque. We need this style so that C FFI can work seamlessly.

Retrieves a process list

Find process information by its name

Remarks:

This function only returns processes whose state is not ProcessState::Dead.

Find process information by its ID

Creates a process by its internal address, borrowing the OS

It will share the underlying memory resources

If no process with the specified address can be found this function will return an Error.

This function can be useful for quickly accessing a process.

Creates a process by its name, borrowing the OS

It will share the underlying memory resources

If no process with the specified name can be found this function will return an Error.

This function can be useful for quickly accessing a process.

Remarks:

This function only returns processes whose state is not ProcessState::Dead.

Creates a process by its ID, borrowing the OS

It will share the underlying memory resources

If no process with the specified ID can be found this function will return an Error.

This function can be useful for quickly accessing a process.

Creates a process by its internal address, consuming the OS

It will consume the OS and not affect memory usage

If no process with the specified address can be found this function will return an Error.

This function can be useful for quickly accessing a process.

Creates a process by its name, consuming the OS

It will consume the OS and not affect memory usage

If no process with the specified name can be found this function will return an Error.

This function can be useful for quickly accessing a process.

Remarks:

This function only returns processes whose state is not ProcessState::Dead.

Creates a process by its ID, consuming the OS

It will consume the OS and not affect memory usage

If no process with the specified ID can be found this function will return an Error.

This function can be useful for quickly accessing a process.

Walks the OS module list and calls the provided callback for each module

Arguments
  • callback - where to pass each matching module to. This is an opaque callback.

Retrieves a module list for the OS

Finds a OS module by its name

This function can be useful for quickly accessing a specific module

Implementors