35 #define VAS_COMPUTE_GLA_64(Base, Index, Level) (PAGE_SX((Base) | ((QWORD)(Index) << ((((Level) - 1) * 9) + 12)))) 36 #define VAS_COMPUTE_GLA_PAE(Base, Index, Level) ((Base) | ((QWORD)(Index) << ((((Level) - 1) * 9) + 12))) 37 #define VAS_COMPUTE_GLA_32(Base, Index, Level) ((Base) | ((QWORD)(Index) << ((((Level) - 1) * 10) + 12))) 39 #define VAS_COMPUTE_GLA(Base, Index, Level, Pg) ( \ 40 (Pg) == PAGING_5_LEVEL_MODE ? VAS_COMPUTE_GLA_64((Base), (Index), (Level)) : \ 41 (Pg) == PAGING_4_LEVEL_MODE ? VAS_COMPUTE_GLA_64((Base), (Index), (Level)) : \ 42 (Pg) == PAGING_PAE_MODE ? VAS_COMPUTE_GLA_PAE((Base), (Index), (Level)) : \ 43 (Pg) == PAGING_NORMAL_MODE ? VAS_COMPUTE_GLA_32((Base), (Index), (Level)) : 0 \ 46 #define VAS_TRANSITIONS_THRESHOLD 64 47 #define VAS_TOTAL_WRITES_THESHOLD 4096 127 #endif // _VASMONITOR_H_
INTSTATUS IntVasUnInit(void)
Uninit the VAS monitor state.
INTSTATUS IntVasInit(void)
Initialize the VAS monitor state.
QWORD LinearAddress
The first linear address translated by this table.
BYTE PagingMode
Paging mode.
INTSTATUS IntVasDump(QWORD Cr3)
Dump the monitored tables for the indicated Cr3.
BYTE Level
The level of the current page table.
int INTSTATUS
The status data type.
LIST_ENTRY Link
List entry link.
struct _VAS_ROOT * PVAS_ROOT
struct _VAS_TABLE_ENTRY * PVAS_TABLE_ENTRY
struct _VAS_ROOT * Root
The root handle.
HOOK_PTEWS WriteState
Write state of each page-table entry.
struct _VAS_TABLE VAS_TABLE
struct _VAS_TABLE * PVAS_TABLE
INTSTATUS IntVasStopMonitorVaSpace(QWORD Cr3, PVAS_ROOT Root)
Stops monitoring the indicated virtual address space.
void * Context
Optional context, will be passed to the callback.
void * WriteHook
The write hook handle.
struct _VAS_TABLE ** Tables
Pointer to children tables, for each valid entry. NULL for leafs.
PVAS_TABLE_ENTRY Entries
Children entries.
QWORD MonitoredBits
Monitored bits inside page-table entries.
PFUNC_VaSpaceModificationCallback Callback
WORD EntriesCount
The number of entries. It can vary from 4 to 512 to 1024, depending on mode.
struct _VAS_ROOT VAS_ROOT
INTSTATUS(* PFUNC_VaSpaceModificationCallback)(void *Context, QWORD VirtualAddress, QWORD OldEntry, QWORD NewEntry, QWORD PageSize)
Translation modification callback.
INTSTATUS IntVasStartMonitorVaSpace(QWORD Cr3, PFUNC_VaSpaceModificationCallback Callback, void *Context, QWORD MonitoredBits, void **Root)
Start monitoring the indicated virtual address space.
QWORD Cr3
Monitored virtual address space.
struct _VAS_TABLE_ENTRY VAS_TABLE_ENTRY