pub struct WindowsProcess<'a, Driver>{ /* private fields */ }Expand description
A Windows process.
A process in Windows is represented by the _EPROCESS structure,
which contains metadata about its execution state, memory layout,
and handles.
§Implementation Details
Corresponds to _EPROCESS.
Implementations§
Source§impl<'a, Driver> WindowsProcess<'a, Driver>
impl<'a, Driver> WindowsProcess<'a, Driver>
Sourcepub fn new(vmi: VmiState<'a, WindowsOs<Driver>>, process: ProcessObject) -> Self
pub fn new(vmi: VmiState<'a, WindowsOs<Driver>>, process: ProcessObject) -> Self
Creates a new Windows process.
Sourcepub fn is_wow64(&self) -> Result<bool, VmiError>
pub fn is_wow64(&self) -> Result<bool, VmiError>
Checks if the process is a WoW64 process.
§Implementation Details
Corresponds to _EPROCESS.WoW64Process != NULL.
Sourcepub fn peb(&self) -> Result<Option<WindowsPeb<'a, Driver>>, VmiError>
pub fn peb(&self) -> Result<Option<WindowsPeb<'a, Driver>>, VmiError>
Returns the process environment block (PEB).
§Implementation Details
The function first reads the _EPROCESS.WoW64Process field to determine
if the process is a 32-bit process. If the field is NULL, the process
is 64-bit. Otherwise, the function reads the _EWOW64PROCESS.Peb field
to get the 32-bit PEB.
Sourcepub fn native_peb(&self) -> Result<Option<WindowsPeb<'a, Driver>>, VmiError>
pub fn native_peb(&self) -> Result<Option<WindowsPeb<'a, Driver>>, VmiError>
Returns the native process environment block (PEB).
§Implementation Details
Corresponds to _EPROCESS.Peb.
Sourcepub fn session(&self) -> Result<Option<WindowsSession<'a, Driver>>, VmiError>
pub fn session(&self) -> Result<Option<WindowsSession<'a, Driver>>, VmiError>
Returns the session of the process.
Sourcepub fn handle_table(
&self,
) -> Result<Option<WindowsHandleTable<'a, Driver>>, VmiError>
pub fn handle_table( &self, ) -> Result<Option<WindowsHandleTable<'a, Driver>>, VmiError>
Returns the handle table of the process.
§Implementation Details
Corresponds to _EPROCESS.ObjectTable.
Sourcepub fn lookup_object<T>(&self, handle: u64) -> Result<Option<T>, VmiError>where
T: FromWindowsObject<'a, Driver>,
pub fn lookup_object<T>(&self, handle: u64) -> Result<Option<T>, VmiError>where
T: FromWindowsObject<'a, Driver>,
Looks up the object associated with the given handle and attempts to convert it to the specified type.
Resolves a handle value through the process handle table
and converts the resulting WindowsObject using the
FromWindowsObject trait.
Returns Ok(None) if the handle table is unavailable,
the handle is invalid, the entry has no associated object,
or the object is not of the requested type.
§Examples
// Look up the raw object.
let object = process.lookup_object::<WindowsObject<_>>(handle)?;
// Look up and convert to a specific type.
let process = current_process.lookup_object::<WindowsProcess<_>>(handle)?;
let file = current_process.lookup_object::<WindowsFileObject<_>>(handle)?;Sourcepub fn vad_root(&self) -> Result<Option<WindowsRegion<'a, Driver>>, VmiError>
pub fn vad_root(&self) -> Result<Option<WindowsRegion<'a, Driver>>, VmiError>
Returns the root of the virtual address descriptor (VAD) tree.
§Implementation Details
Corresponds to _EPROCESS.VadRoot->BalancedRoot for Windows 7 and
_EPROCESS.VadRoot->Root for Windows 8.1 and later.
Sourcepub fn vad_hint(&self) -> Result<Option<WindowsRegion<'a, Driver>>, VmiError>
pub fn vad_hint(&self) -> Result<Option<WindowsRegion<'a, Driver>>, VmiError>
Returns the VAD hint node.
The VAD hint is an optimization used by Windows to speed up VAD lookups. This method returns the address of the hint node in the VAD tree.
§Implementation Details
Corresponds to _EPROCESS.VadRoot->NodeHint for Windows 7 and
_EPROCESS.VadRoot->Hint for Windows 8.1 and later.
Trait Implementations§
Source§impl<'a, Driver> From<WindowsProcess<'a, Driver>> for WindowsObject<'a, Driver>
impl<'a, Driver> From<WindowsProcess<'a, Driver>> for WindowsObject<'a, Driver>
Source§fn from(value: WindowsProcess<'a, Driver>) -> Self
fn from(value: WindowsProcess<'a, Driver>) -> Self
Source§impl<'a, Driver> FromWindowsObject<'a, Driver> for WindowsProcess<'a, Driver>
impl<'a, Driver> FromWindowsObject<'a, Driver> for WindowsProcess<'a, Driver>
Source§fn from_object(
object: WindowsObject<'a, Driver>,
) -> Result<Option<Self>, VmiError>
fn from_object( object: WindowsObject<'a, Driver>, ) -> Result<Option<Self>, VmiError>
WindowsObject into a specific object type.Source§impl<'a, Driver> VmiOsProcess<'a, Driver> for WindowsProcess<'a, Driver>
impl<'a, Driver> VmiOsProcess<'a, Driver> for WindowsProcess<'a, Driver>
Source§fn parent_id(&self) -> Result<ProcessId, VmiError>
fn parent_id(&self) -> Result<ProcessId, VmiError>
Returns the parent process ID.
§Implementation Details
Corresponds to _EPROCESS.InheritedFromUniqueProcessId.
Source§fn architecture(&self) -> Result<VmiOsImageArchitecture, VmiError>
fn architecture(&self) -> Result<VmiOsImageArchitecture, VmiError>
Returns the architecture of the process.
§Implementation Details
The function reads the _EPROCESS.WoW64Process field to determine if the
process is a 32-bit process. If the field is NULL, the process is 64-bit.
Otherwise, the process is 32-bit.
Source§fn translation_root(&self) -> Result<Pa, VmiError>
fn translation_root(&self) -> Result<Pa, VmiError>
Returns the process’s page table translation root.
§Implementation Details
Corresponds to _KPROCESS.DirectoryTableBase.
Source§fn user_translation_root(&self) -> Result<Pa, VmiError>
fn user_translation_root(&self) -> Result<Pa, VmiError>
Returns the user-mode page table translation root.
If KPTI is disabled, this function will return the same value as
translation_root.
§Implementation Details
Corresponds to _KPROCESS.UserDirectoryTableBase.
Source§fn image_base(&self) -> Result<Va, VmiError>
fn image_base(&self) -> Result<Va, VmiError>
Returns the base address of the process image.
§Implementation Details
Corresponds to _EPROCESS.SectionBaseAddress.
Source§fn regions(
&self,
) -> Result<impl Iterator<Item = Result<WindowsRegion<'a, Driver>, VmiError>> + use<'a, Driver>, VmiError>
fn regions( &self, ) -> Result<impl Iterator<Item = Result<WindowsRegion<'a, Driver>, VmiError>> + use<'a, Driver>, VmiError>
Returns an iterator over the process’s memory regions (VADs).
§Implementation Details
The function iterates over the VAD tree of the process.
Source§fn find_region(
&self,
address: Va,
) -> Result<Option<WindowsRegion<'a, Driver>>, VmiError>
fn find_region( &self, address: Va, ) -> Result<Option<WindowsRegion<'a, Driver>>, VmiError>
Finds the memory region (VAD) containing the given address.
This method efficiently searches the VAD tree to find the VAD node that corresponds to the given virtual address within the process’s address space.
Returns the matching VAD if found, or None if the address is not
within any VAD.
§Implementation Details
The functionality is similar to the Windows kernel’s internal
MiLocateAddress() function.
Source§fn threads(
&self,
) -> Result<impl Iterator<Item = Result<<Self::Os as VmiOs>::Thread<'a>, VmiError>> + use<'a, Driver>, VmiError>
fn threads( &self, ) -> Result<impl Iterator<Item = Result<<Self::Os as VmiOs>::Thread<'a>, VmiError>> + use<'a, Driver>, VmiError>
Source§impl<Driver> VmiVa for WindowsProcess<'_, Driver>
impl<Driver> VmiVa for WindowsProcess<'_, Driver>
Auto Trait Implementations§
impl<'a, Driver> Freeze for WindowsProcess<'a, Driver>
impl<'a, Driver> !RefUnwindSafe for WindowsProcess<'a, Driver>
impl<'a, Driver> !Send for WindowsProcess<'a, Driver>
impl<'a, Driver> !Sync for WindowsProcess<'a, Driver>
impl<'a, Driver> Unpin for WindowsProcess<'a, Driver>
impl<'a, Driver> UnsafeUnpin for WindowsProcess<'a, Driver>
impl<'a, Driver> !UnwindSafe for WindowsProcess<'a, Driver>
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.