Bitdefender Hypervisor Memory Introspection
|
#include "introtypes.h"
Go to the source code of this file.
Data Structures | |
struct | _WIN_PFN_LOCK |
A PFN lock. More... | |
Macros | |
#define | WIN_PFN_INC_VALUE 0xbd |
The value used to increment the reference counter of a PFN database entry. More... | |
#define | WIN_PFN_REF_MAX 0xffff |
The maximum value we allow a PFN reference counter to reach. More... | |
#define | WIN_PFN_GET_STRUCT_VA(MmPfn, Gpa) |
Get the address of a guest _MMPFN structure. More... | |
Typedefs | |
typedef struct _WIN_PFN_LOCK | WIN_PFN_LOCK |
A PFN lock. More... | |
typedef struct _WIN_PFN_LOCK * | PWIN_PFN_LOCK |
Enumerations | |
enum | WIN_PFN_PAGE_LOCATION { WinPfnZeroPage = 0, WinPfnFreePage, WinPfnStandbyPage, WinPfnModifiedPage, WinPfnModifiedNowritePage, WinPfnBadPage, WinPfnActivePage, WinPfnTransitionPage } |
Page location value, as defined by the _MMLISTS kernel enum. More... | |
Functions | |
INTSTATUS | IntWinPfnIsMmPfnDatabase (QWORD MmPfnDatabase) |
Checks if a a guest virtual address points to MmPfnDatabase. More... | |
INTSTATUS | IntWinPfnLockGva (QWORD Gva, WIN_PFN_LOCK **PfnLock) |
Locks a guest virtual address. More... | |
INTSTATUS | IntWinPfnLockGpa (QWORD Gpa, WIN_PFN_LOCK **PfnLock) |
Locks a guest physical address. More... | |
INTSTATUS | IntWinPfnRemoveLock (WIN_PFN_LOCK *PfnLock, BOOLEAN Force) |
Removes a PFN lock. More... | |
void | IntWinPfnDump (void) |
Prints all the PFN locks. More... | |
void | IntWinPfnUnInit (void) |
Uninits the PFN locks. More... | |
#define WIN_PFN_GET_STRUCT_VA | ( | MmPfn, | |
Gpa | |||
) |
Get the address of a guest _MMPFN structure.
[in] | MmPfn | The guest virtual address of the MMPFN database. |
[in] | Gpa | The guest physical address for which to return the _MMPFN address. |
Definition at line 60 of file winpfn.h.
Referenced by DbgDumpPfn(), IntWinPfnIsMmPfnDatabase(), and IntWinPfnModifyRefCount().
#define WIN_PFN_INC_VALUE 0xbd |
The value used to increment the reference counter of a PFN database entry.
Definition at line 11 of file winpfn.h.
Referenced by IntWinPfnModifyRefCount().
#define WIN_PFN_REF_MAX 0xffff |
The maximum value we allow a PFN reference counter to reach.
Definition at line 14 of file winpfn.h.
Referenced by IntWinPfnModifyRefCount().
typedef struct _WIN_PFN_LOCK * PWIN_PFN_LOCK |
typedef struct _WIN_PFN_LOCK WIN_PFN_LOCK |
A PFN lock.
Page location value, as defined by the _MMLISTS kernel enum.
While this is an enum, it is important to note that the Windows kernel uses only 4 bits to store this information.
Checks if a a guest virtual address points to MmPfnDatabase.
[in] | MmPfnDatabase | Guest virtual address to check. |
INT_STATUS_SUCCESS | if the provided address is indeed the MmPfnDataBase. |
INT_STATUS_INVALID_OBJECT_TYPE | if it is not. |
Definition at line 24 of file winpfn.c.
Referenced by IntWinGuestFindKernelObjectsInternal().
INTSTATUS IntWinPfnLockGpa | ( | QWORD | Gpa, |
WIN_PFN_LOCK ** | PfnLock | ||
) |
Locks a guest physical address.
[in] | Gpa | Guest physical address to lock. |
[out] | PfnLock | On success, will contain a pointer to the lock. May be NULL. |
Definition at line 820 of file winpfn.c.
Referenced by IntWinProcLockCr3().
INTSTATUS IntWinPfnLockGva | ( | QWORD | Gva, |
WIN_PFN_LOCK ** | PfnLock | ||
) |
Locks a guest virtual address.
This will actually lock the guest physical address to which Gva translates to, and place a swap hook on Gva page tables. If the page is not currently present, it will be locked when it will be made present.
[in] | Gva | Guest virtual address to lock. |
[out] | PfnLock | On success, will contain a pointer to the lock. May be NULL. |
INTSTATUS IntWinPfnRemoveLock | ( | WIN_PFN_LOCK * | PfnLock, |
BOOLEAN | Force | ||
) |
Removes a PFN lock.
This will decrement the Introcore reference counter and only remove the lock when it reaches 0, unless a forced removal is requested.
[in,out] | PfnLock | Lock to remove. The pointer will no longer be valid after this function returns. |
[in] | Force | True to remove the lock even if the reference counter is not 0. |
INT_STATUS_SUCCESS | in case of success. |
INT_STATUS_NOT_NEEDED_HINT | if the reference counter has not reached 0 and Force is False. |
INT_STATUS_INVALID_PARAMETER_1 | if PfnLock is NULL. |
Definition at line 838 of file winpfn.c.
Referenced by IntWinPfnUnInit(), IntWinProcRemoveProcess(), and IntWinProcUnlockCr3().
void IntWinPfnUnInit | ( | void | ) |
Uninits the PFN locks.
If any locks are still active when this function is called, they will be forcibly removed using IntWinPfnRemoveLock.
Definition at line 922 of file winpfn.c.
Referenced by IntGuestUninit().