Bitdefender Hypervisor Memory Introspection
lixmm.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2020 Bitdefender
3  * SPDX-License-Identifier: Apache-2.0
4  */
5 #ifndef _LIXMM_H_
6 #define _LIXMM_H_
7 
8 #include "lixprocess.h"
9 
10 
14 typedef struct _LIX_VMA
15 {
18 
21 
24 
26 
28 
29  void *Hook;
30 } LIX_VMA, *PLIX_VMA;
31 
32 
35  _Out_ QWORD *InitMm
36  );
37 
40  _In_ QWORD Gva,
41  _In_ LIX_TASK_OBJECT *Task,
42  _Out_ QWORD *VmaStart,
43  _Out_ QWORD *VmaEnd
44  );
45 
48  _In_ LIX_TASK_OBJECT *Task,
49  _In_ QWORD Address,
50  _Out_ LIX_VMA *Vma
51  );
52 
53 LIX_VMA *
55  _In_ LIX_TASK_OBJECT *Task,
56  _In_ QWORD Vma
57  );
58 
59 LIX_VMA *
62  _In_ QWORD Address
63  );
64 
67  _In_ LIX_TASK_OBJECT *Task
68  );
69 
70 void
72  _In_ LIX_TASK_OBJECT *Task
73  );
74 
75 void
77  _In_ QWORD Mm,
79  );
80 
83  _In_ void *Detour
84  );
85 
88  _In_ void *Detour
89  );
90 
93  _In_ void *Detour
94  );
95 
98  _In_ void *Detour
99  );
100 
101 INTSTATUS
103  _In_ void *Detour
104  );
105 
106 #endif // _LIXMM_H_
#define _Out_
Definition: intro_sal.h:22
INTSTATUS IntLixMmGetInitMm(QWORD *InitMm)
Find the address of the "init_mm" variable inside the kernel.
Definition: lixmm.c:76
INTSTATUS IntLixVmaAdjust(void *Detour)
Detour handler for in-guest functions adjusting VMA ranges.
Definition: lixmm.c:2052
INTSTATUS IntLixMmFindVmaRange(QWORD Gva, LIX_TASK_OBJECT *Task, QWORD *VmaStart, QWORD *VmaEnd)
Finds the VMA limits that contain an address.
Definition: lixmm.c:640
#define _In_
Definition: intro_sal.h:21
int INTSTATUS
The status data type.
Definition: introstatus.h:24
INTSTATUS IntLixVmaRemove(void *Detour)
Detour handler for functions that unmap memory for processes.
Definition: lixmm.c:2111
void IntLixMmDestroyVmas(LIX_TASK_OBJECT *Task)
Remove protection for the VMAs belonging to a process.
Definition: lixmm.c:1016
INTSTATUS IntLixVmaInsert(void *Detour)
Detour handler for "__vma_link_rb" function.
Definition: lixmm.c:1692
QWORD Start
Start of the memory described by the VMA.
Definition: lixmm.h:19
INTSTATUS IntLixVmaChangeProtection(void *Detour)
Detour handler for "change_protection" function.
Definition: lixmm.c:1753
LIX_VMA * IntLixMmFindVmaByRange(const LIX_TASK_OBJECT *Process, QWORD Address)
Finds if a memory address inside a process is being protected and returns the corresponding LIX_VMA s...
Definition: lixmm.c:699
INTSTATUS IntLixMmFetchVma(LIX_TASK_OBJECT *Task, QWORD Address, LIX_VMA *Vma)
Retrieve information about a VMA structure containing a user mode address.
Definition: lixmm.c:581
QWORD End
End of the memory described by the VMA.
Definition: lixmm.h:20
unsigned long long QWORD
Definition: intro_types.h:53
void * Hook
The EPT hook placed on the VMA when it is being protected.
Definition: lixmm.h:29
QWORD Flags
Flags for the VMA.
Definition: lixmm.h:25
LIX_TASK_OBJECT * Process
Process owning the VMA.
Definition: lixmm.h:27
QWORD Gva
The guest virtual address of the vm_area_struct this structure is based on.
Definition: lixmm.h:17
void IntLixMmListVmas(QWORD Mm, LIX_TASK_OBJECT *Process)
Definition: lixmm.c:1671
Definition: lixmm.h:14
INTSTATUS IntLixMmPopulateVmas(LIX_TASK_OBJECT *Task)
Populate the Introcore VMAs linked list by iterating the one inside the guest.
Definition: lixmm.c:1510
LIX_VMA * IntLixMmFindVma(LIX_TASK_OBJECT *Task, QWORD Vma)
Finds a protected VMA inside a process VMA list.
Definition: lixmm.c:871
struct _LIX_VMA LIX_VMA
LIST_ENTRY Link
Linked list entry.
Definition: lixmm.h:16
INTSTATUS IntLixVmaExpandDownwards(void *Detour)
Detour handler for "expand_downwards" function.
Definition: lixmm.c:1906
QWORD File
The Gva of the file this VMA maps to. Can be 0 which means this VMA is not a memory mapped file...
Definition: lixmm.h:23
struct _LIX_VMA * PLIX_VMA