Bitdefender Hypervisor Memory Introspection
winprocesshp.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2020 Bitdefender
3  * SPDX-License-Identifier: Apache-2.0
4  */
5 #ifndef _WINPROCESSHP_H_
6 #define _WINPROCESSHP_H_
7 
8 #include "winprocess.h"
9 
12  _In_ QWORD Cr3
13  );
14 
17  _In_ QWORD Cr3
18  );
19 
20 #define IntWinGetCurrentProcess() IntWinProcFindObjectByCr3(gVcpu->Regs.Cr3)
21 
24  _In_ QWORD Eprocess
25  );
26 
29  _In_ DWORD Pid
30  );
31 
34  _In_ CHAR const *Name,
35  _In_ BOOLEAN MustBeSystem);
36 
39  _In_ QWORD Eprocess,
40  _In_ QWORD Aux
41  );
42 
45  _In_ QWORD Gva);
46 
50  _In_ QWORD Aux
51  );
52 
55  _In_ QWORD Eprocess,
57  );
58 
61  _In_ QWORD Eprocess,
63  );
64 
65 BOOLEAN
67  void
68  );
69 
72  _Inout_ RBNODE *Node
73  );
74 
77  _In_ RBNODE const *Left,
78  _In_ RBNODE const *Right
79  );
80 
83  _In_ RBNODE const *Left,
84  _In_ RBNODE const *Right
85  );
86 
89  _In_ RBNODE const *Left,
90  _In_ RBNODE const *Right
91  );
92 
95  _Out_writes_bytes_(Length) PCHAR CommandLine,
96  _In_ DWORD Length
97  );
98 
99 void
101  void
102  );
103 
104 void
106  _In_opt_ const char *ProcessName
107  );
108 
109 void
111  void
112  );
113 
114 INTSTATUS
116  _In_ QWORD Eprocess,
117  _Outptr_ void **Ptr
118  );
119 
120 void
122 
123 void
125  _In_ WIN_PROCESS_OBJECT *Process
126  );
127 
128 void
130  _In_ WIN_PROCESS_OBJECT *Process
131  );
132 
133 #endif // _WINPROCESSHP_H_
INTSTATUS IntWinProcGetNameFromEprocess(QWORD Eprocess, CHAR *Name)
Reads a process name from the guest memory.
Definition: winprocesshp.c:615
#define _In_opt_
Definition: intro_sal.h:16
_Bool BOOLEAN
Definition: intro_types.h:58
Exposes the types, constants and functions used to handle Windows processes events (creation...
void IntWinProcLstInsertProcess(WIN_PROCESS_OBJECT *Process)
Inserts a WIN_PROCESS_OBJECT structure into the process lists and trees.
Definition: winprocesshp.c:46
#define _In_
Definition: intro_sal.h:21
int IntWinProcRbTreeNodeCompareUserCr3(RBNODE const *Left, RBNODE const *Right)
Definition: winprocesshp.c:762
#define _Out_writes_bytes_(expr)
Definition: intro_sal.h:38
void FUNC_RbTreeNodeFree(RBNODE *Node)
Definition: rbtree.h:47
Definition: rbtree.h:34
void IntWinProcRbTreeNodeFree(RBNODE *Node)
The NodeFree routine for the process RBTREE structures.
Definition: winprocesshp.c:723
INTSTATUS IntWinProcMapEprocess(QWORD Eprocess, void **Ptr)
Maps a _EPROCESS structure.
BOOLEAN IntWinProcIsEnoughHeapAvailable(void)
Checks if enough heap is available in order to protect a new process.
Definition: winprocesshp.c:685
void IntWinProcDumpVads(const char *ProcessName)
Prints information about the VADs loaded in a process.
Definition: winprocesshp.c:977
void IntWinProcLstUnsafeReInit(void)
Reinitializes the Windows process lists and trees, without doing any cleanup.
Definition: winprocesshp.c:22
#define _Outptr_
Definition: intro_sal.h:19
int INTSTATUS
The status data type.
Definition: introstatus.h:24
int FUNC_RbTreeNodeCompare(RBNODE *Left, RBNODE *Right)
Definition: rbtree.h:59
#define IMAGE_BASE_NAME_LEN
The maximum length of a process name.
Definition: winguest.h:15
PWIN_PROCESS_OBJECT IntWinProcFindObjectByPid(DWORD Pid)
Finds a process by its ID.
Definition: winprocesshp.c:126
#define _Inout_
Definition: intro_sal.h:20
INTSTATUS IntWinProcGetNameFromInternalEprocess(QWORD Eprocess, CHAR *Name)
Get a process name from the internal Introcore buffers.
Definition: winprocesshp.c:648
unsigned long long QWORD
Definition: intro_types.h:53
INTSTATUS(* PFUNC_IterateListCallback)(QWORD Node, QWORD Aux)
Definition: introtypes.h:71
PWIN_PROCESS_OBJECT IntWinProcFindObjectByName(CHAR const *Name, BOOLEAN MustBeSystem)
Finds a process by name.
Definition: winprocesshp.c:157
PWIN_PROCESS_OBJECT IntWinProcFindObjectByCr3(QWORD Cr3)
Finds a process by its kernel CR3.
Definition: winprocesshp.c:195
INTSTATUS IntWinProcIterateGuestProcesses(PFUNC_IterateListCallback Callback, QWORD Aux)
Iterates the in-guest process list and calls Callback for each entry.
Definition: winprocesshp.c:501
char * PCHAR
Definition: intro_types.h:56
int IntWinProcRbTreeNodeCompareCr3(RBNODE const *Left, RBNODE const *Right)
Definition: winprocesshp.c:735
int IntWinProcRbTreeNodeCompareEproc(RBNODE const *Left, RBNODE const *Right)
Definition: winprocesshp.c:789
void IntWinProcLstRemoveProcess(WIN_PROCESS_OBJECT *Process)
Removes a WIN_PROCESS_OBJECT structure from the process lists and trees.
Definition: winprocesshp.c:73
void IntWinProcDump(void)
Prints information about all the processes in the system.
Definition: winprocesshp.c:864
uint32_t DWORD
Definition: intro_types.h:49
INTSTATUS IntWinProcAdd(QWORD Eprocess, QWORD Aux)
Adds a new process to the Introcore list of processes.
Definition: winprocesshp.c:396
PWIN_PROCESS_OBJECT IntWinProcFindObjectByUserCr3(QWORD Cr3)
Finds a process by its user CR3.
Definition: winprocesshp.c:225
INTSTATUS IntWinProcIsPsActiveProcessHead(QWORD Gva)
Checks if a guest memory area is the list head of the process list (PsActiveProcessHead) ...
Definition: winprocesshp.c:258
#define _Function_class_(expr)
Definition: intro_sal.h:40
INTSTATUS IntWinProcGetAgentsAsCli(PCHAR CommandLine, DWORD Length)
Returns the name and ID for all the processes injected as agents inside the guest.
Definition: winprocesshp.c:812
PWIN_PROCESS_OBJECT IntWinProcFindObjectByEprocess(QWORD Eprocess)
Finds a process by the address of its _EPROCESS structure.
Definition: winprocesshp.c:96
#define _Out_writes_z_(expr)
Definition: intro_sal.h:37
void IntWinProcDumpEgFlags(void)
Prints the mitigation flags of a process.
char CHAR
Definition: intro_types.h:56
This structure describes a running process inside the guest.
Definition: winprocess.h:83