Bitdefender Hypervisor Memory Introspection
kernvm.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2020 Bitdefender
3  * SPDX-License-Identifier: Apache-2.0
4  */
5 #ifndef _KERNVM_H_
6 #define _KERNVM_H_
7 
8 #include "introcore.h"
9 
11 typedef struct _MPX_BOUND
12 {
18 
20 typedef struct _MPX_TRANSLATION
21 {
28 
29 
30 //
31 // API
32 //
35  _In_ QWORD VirtualAddress,
36  _Out_ DWORD *OffsetsCount,
38  );
39 
42  _In_ QWORD Cr3,
44  );
45 
48  _In_ QWORD Cr3,
49  _In_ QWORD VirtualAddress,
50  _In_ DWORD Size,
51  _In_ DWORD Ring
52  );
53 
56  _In_ QWORD Cr3,
57  _In_ QWORD VirtualAddress,
58  _In_ DWORD Size,
59  _In_reads_bytes_(Size) void *Buffer,
60  _In_ DWORD Ring
61  );
62 
63 #endif // _KERNVM_H_
#define _Out_
Definition: intro_sal.h:22
#define _In_
Definition: intro_sal.h:21
struct _MPX_BOUND MPX_BOUND
A MPX bound structure.
MPX_BOUND BoundTableEntry
The bound table entry.
Definition: kernvm.h:26
INTSTATUS(* PFUNC_VirtualAddressSpaceCallback)(QWORD Cr3, QWORD VirtualAddress, QWORD Entry, QWORD PageSize)
The type of callback invoked by PFUNC_IntIterateVaSpace while iterating the guest virtual address spa...
Definition: glueiface.h:1814
QWORD BoundTable
The bound table address.
Definition: kernvm.h:25
struct _MPX_BOUND * PMPX_BOUND
int INTSTATUS
The status data type.
Definition: introstatus.h:24
QWORD UpperBound
Upper bound.
Definition: kernvm.h:14
QWORD BoundDirectory
The bound directory address.
Definition: kernvm.h:23
struct _MPX_TRANSLATION MPX_TRANSLATION
A MPX translation structure.
#define _Out_writes_(expr)
Definition: intro_sal.h:28
INTSTATUS IntIterateVirtualAddressSpace(QWORD Cr3, PFUNC_VirtualAddressSpaceCallback Callback)
Iterate an entire virtual address space.
Definition: kernvm.c:327
A MPX translation structure.
Definition: kernvm.h:20
INTSTATUS IntSplitVirtualAddress(QWORD VirtualAddress, DWORD *OffsetsCount, QWORD *OffsetsTrace)
Split a linear address into page-table indexes.
Definition: kernvm.c:12
struct _MPX_TRANSLATION * PMPX_TRANSLATION
unsigned long long QWORD
Definition: intro_types.h:53
INTSTATUS IntValidateRangeForWrite(QWORD Cr3, QWORD VirtualAddress, DWORD Size, DWORD Ring)
Validate a range of virtual memory for write.
Definition: kernvm.c:406
INTSTATUS IntVirtMemSafeWrite(QWORD Cr3, QWORD VirtualAddress, DWORD Size, void *Buffer, DWORD Ring)
Safely modify guest memory.
Definition: kernvm.c:498
A MPX bound structure.
Definition: kernvm.h:11
uint32_t DWORD
Definition: intro_types.h:49
QWORD BoundDirectoryEntry
The bound directory entry.
Definition: kernvm.h:24
QWORD Reserved
Reserved for future use/alignment.
Definition: kernvm.h:16
QWORD PointerValue
Pointer value.
Definition: kernvm.h:15
#define _In_reads_bytes_(expr)
Definition: intro_sal.h:25
QWORD LowerBound
Lower bound.
Definition: kernvm.h:13
QWORD LinearAddressToPointer
Linear address to pointer (LoPA)
Definition: kernvm.h:22
#define MAX_TRANSLATION_DEPTH
Maximum depth of the translation hierarchy.
Definition: introcore.h:61