Bitdefender Hypervisor Memory Introspection
windrvobj.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2020 Bitdefender
3  * SPDX-License-Identifier: Apache-2.0
4  */
5 #ifndef _WINDRVOBJ_H_
6 #define _WINDRVOBJ_H_
7 
8 #include "introtypes.h"
9 
13 typedef struct _WIN_DRIVER_OBJECT
14 {
39 
53 
68 
69 
70 BOOLEAN
72  _In_ QWORD DriverObjectAddress
73  );
74 
75 PWIN_DRIVER_OBJECT
77  _In_ QWORD Gva
78  );
79 
80 PWIN_DRIVER_OBJECT
83  );
84 
87  _In_ QWORD GuestAddress,
88  _In_ BOOLEAN StaticDetected,
89  _Out_opt_ PWIN_DRIVER_OBJECT *DriverObject
90  );
91 
94  _In_ QWORD DriverObjectAddress
95  );
96 
99  _Inout_ WIN_DRIVER_OBJECT *DriverObject
100  );
101 
102 INTSTATUS
104  _Inout_ WIN_DRIVER_OBJECT *DriverObject
105  );
106 
107 INTSTATUS
109  _Inout_ WIN_DRIVER_OBJECT *DriverObject
110  );
111 
112 INTSTATUS
114  void
115  );
116 
117 INTSTATUS
119  void
120  );
121 
122 #endif // _WINDRVOBJ_H_
uint16_t * PWCHAR
Definition: intro_types.h:63
QWORD DriverObjectGva
The guest virtual address of the guest _DRIVER_OBJECT represented by this structure.
Definition: windrvobj.h:18
LIST_ENTRY Link
Entry inside the gWinDriverObjects list.
Definition: windrvobj.h:16
_Bool BOOLEAN
Definition: intro_types.h:58
#define _In_
Definition: intro_sal.h:21
void * DrvobjIntegrityObject
The integrity object used for the _DRIVER_OBJECT structure.
Definition: windrvobj.h:47
PWIN_DRIVER_OBJECT IntWinDrvObjFindByDrvObj(QWORD Gva)
Finds a driver object in the gWinDriverObjects list by its guest virtual address. ...
Definition: windrvobj.c:424
INTSTATUS IntWinDrvObjCreateFromAddress(QWORD GuestAddress, BOOLEAN StaticDetected, PWIN_DRIVER_OBJECT *DriverObject)
Creates a new driver object.
Definition: windrvobj.c:227
INTSTATUS IntWinDrvObjUninit(void)
Removes all the driver objects in the gWinDriverObjects.
Definition: windrvobj.c:1429
int INTSTATUS
The status data type.
Definition: introstatus.h:24
INTSTATUS IntWinDrvObjProtect(WIN_DRIVER_OBJECT *DriverObject)
Protects a driver object and its fast IO dispatch table, if one exists.
Definition: windrvobj.c:1164
INTSTATUS IntWinDrvObjUpdateProtection(void)
Updates the protection for all the driver objects in the gWinDriverObjects list.
Definition: windrvobj.c:1385
INTSTATUS IntWinDrvObjUnprotect(WIN_DRIVER_OBJECT *DriverObject)
Deactivates protection for a driver object and its fast IO dispatch structure.
Definition: windrvobj.c:1100
struct _WIN_DRIVER_OBJECT WIN_DRIVER_OBJECT
Holds information about a driver object.
#define _Inout_
Definition: intro_sal.h:20
void * DrvobjHookObject
The EPT hook object used for the _DRIVER_OBJECT structure.
Definition: windrvobj.h:43
#define _Out_opt_
Definition: intro_sal.h:30
PWIN_DRIVER_OBJECT IntWinDrvObjFindByOwnerAddress(QWORD Owner)
Finds a driver object in the gWinDriverObjects list by the base of the kernel module that owns it...
Definition: windrvobj.c:453
QWORD FastIOTableAddress
The guest virtual address of the _FAST_IO_DISPATCH structure used by this driver object. May be 0.
Definition: windrvobj.h:27
INTSTATUS IntWinDrvObjRemove(WIN_DRIVER_OBJECT *DriverObject)
Removes a driver object and updates its owner module.
Definition: windrvobj.c:1344
Holds information about a driver object.
Definition: windrvobj.h:13
unsigned long long QWORD
Definition: intro_types.h:53
DWORD NameHash
Hash of the Name.
Definition: windrvobj.h:34
QWORD Owner
Guest virtual address of the kernel module that owns this driver object.
Definition: windrvobj.h:38
QWORD DriverObjectGpa
The guest physical address of the guest _DRIVER_OBJECT represented by this structure.
Definition: windrvobj.h:25
uint32_t DWORD
Definition: intro_types.h:49
PWCHAR Name
NULL-terminated wide-char string containing the name of the driver, as taken from the guest driver ob...
Definition: windrvobj.h:30
BOOLEAN Aligned
True if the driver object allocation is page aligned.
Definition: windrvobj.h:66
BOOLEAN IntWinDrvObjIsValidDriverObject(QWORD DriverObjectAddress)
Checks if a guest memory area contains a valid _DRIVER_OBJECT structure.
Definition: windrvobj.c:28
struct _WIN_DRIVER_OBJECT * PWIN_DRIVER_OBJECT
BOOLEAN DrvobjProtected
True if the driver object structure is protected.
Definition: windrvobj.h:55
BOOLEAN FiodispProtected
True if the fast IO dispatch structure is protected.
Definition: windrvobj.h:57
void * FiodispIntegrityObject
The integrity object used for the _FAST_IO_DISPATCH structure.
Definition: windrvobj.h:52
INTSTATUS IntWinDrvObjRemoveFromAddress(QWORD DriverObjectAddress)
Frees and removes protection for a driver object by its address.
Definition: windrvobj.c:1246
DWORD NameLen
The length, in characters, of Name, not including the NULL-terminator.
Definition: windrvobj.h:32