|
Bitdefender Hypervisor Memory Introspection
|
Go to the source code of this file.
Data Structures | |
| struct | _DRIVER_EXPORT_CACHE |
| Driver export cache. More... | |
Macros | |
| #define | for_each_driver(_var_name) list_for_each (gKernelDrivers, KERNEL_DRIVER, _var_name) |
| Iterates the gKernelDrivers linked list. More... | |
| #define | MAX_DRIVER_EXPORT_CACHE_ENTRIES 10 |
| Maximum entries inside the DRIVER_EXPORT_CACHE. More... | |
Typedefs | |
| typedef struct _DRIVER_EXPORT_CACHE | DRIVER_EXPORT_CACHE |
| Driver export cache. More... | |
| typedef struct _DRIVER_EXPORT_CACHE * | PDRIVER_EXPORT_CACHE |
Functions | |
| INTSTATUS | IntDriverLoadHandler (void const *Detour) |
| The detour handler that will be invoked when a guest loads a new driver.This handles driver loading in both Windows and Linux OSs. It simply gathers the arguments from the guest and delegates the driver loading event to IntLixDrvCreateFromAddress or IntWinDrvCreateFromAddress. If one of this function fails Introcore will try to trap to a debugger. More... | |
| INTSTATUS | IntDriverUnloadHandler (void const *Detour) |
| The detour handler that will be invoked when a guest driver is unloaded.This handles driver unloading for both Windows and Linux OSs. It simply gathers the arguments from the guest and delegates the driver unloading event to IntLixDrvRemoveFromAddress or IntWinDrvRemoveFromAddress. If one of this function fails introcore will try to trap to a debugger. More... | |
| KERNEL_DRIVER * | IntDriverFindByAddress (QWORD Gva) |
| Returns the driver in which Gva resides. More... | |
| KERNEL_DRIVER * | IntDriverFindByBase (QWORD Gva) |
| Searches a driver object by its module base. More... | |
| KERNEL_DRIVER * | IntDriverFindByLoadOrder (DWORD LoadOrder) |
| Searches a driver by its module load order. More... | |
| KERNEL_DRIVER * | IntDriverFindByName (const void *Name) |
| Searches for a driver by its name. More... | |
| KERNEL_DRIVER * | IntDriverFindByPath (const WCHAR *Path) |
| Searches for a driver by its module path. More... | |
| void | IntDriverUninit (void) |
| Uninitializes the drivers submodule. More... | |
| void | IntDriverDump (void) |
| Prints all the currently loaded drivers. More... | |
| void | IntDriverCacheCreateExport (const QWORD Rip) |
| Adds a new export entry to the gDriverExportCache. More... | |
| void | IntDriverCacheCreateUnknown (const QWORD Rip) |
| Adds a new entry to the gDriverExportCache. More... | |
| DRIVER_EXPORT_CACHE_ENTRY * | IntDriverCacheExportFind (const QWORD Rip) |
| Finds an entry inside the gDriverExportCache. More... | |
| void | IntDriverCacheInv (const QWORD BaseAddress, const QWORD Length) |
| Invalidates all cache entries for a given guest memory range. More... | |
Variables | |
| LIST_HEAD | gKernelDrivers = LIST_HEAD_INIT(gKernelDrivers) |
| List of all the drivers currently loaded inside the guest. More... | |
| static DRIVER_EXPORT_CACHE | gDriverExportCache = {0} |
| The driver exports cache. More... | |
| #define for_each_driver | ( | _var_name | ) | list_for_each (gKernelDrivers, KERNEL_DRIVER, _var_name) |
Iterates the gKernelDrivers linked list.
Can be used to safely iterate the drivers list. The current driver pointed to by _var_name can safely be removed from the list, but note that removing other drivers while iterating the list using this macro is not a valid operation and can corrupt the list.
| [in] | _var_name | The name of the variable in which the KERNEL_DRIVER pointer will be placed. This variable will be declared by the macro an available only in the context created by the macro. |
Definition at line 21 of file drivers.c.
Referenced by IntDriverDump(), IntDriverFindByAddress(), IntDriverFindByBase(), IntDriverFindByLoadOrder(), IntDriverFindByName(), IntDriverFindByPath(), and IntDriverUninit().
| #define MAX_DRIVER_EXPORT_CACHE_ENTRIES 10 |
Maximum entries inside the DRIVER_EXPORT_CACHE.
Definition at line 24 of file drivers.c.
Referenced by IntDriverCacheCreateExport(), and IntDriverCacheCreateUnknown().
| typedef struct _DRIVER_EXPORT_CACHE DRIVER_EXPORT_CACHE |
Driver export cache.
| typedef struct _DRIVER_EXPORT_CACHE * PDRIVER_EXPORT_CACHE |
| void IntDriverCacheCreateExport | ( | const QWORD | Rip | ) |
Adds a new export entry to the gDriverExportCache.
If the cache is full, it is reset.
| [in] | Rip | The guest RIP for which this entry is created. |
Definition at line 432 of file drivers.c.
Referenced by IntExceptWinKernelGetOriginator().
| void IntDriverCacheCreateUnknown | ( | const QWORD | Rip | ) |
Adds a new entry to the gDriverExportCache.
If the cache is full, it is reset.
| [in] | Rip | The guest RIP for which this entry is created. |
Definition at line 458 of file drivers.c.
Referenced by IntExceptWinKernelGetOriginator().
| DRIVER_EXPORT_CACHE_ENTRY* IntDriverCacheExportFind | ( | const QWORD | Rip | ) |
Finds an entry inside the gDriverExportCache.
| [in] | Rip | The guest RIP to search for. |
Definition at line 484 of file drivers.c.
Referenced by IntExceptWinKernelGetOriginator().
Invalidates all cache entries for a given guest memory range.
| [in] | BaseAddress | The start of the range. |
| [in] | Length | The size of the range. |
Definition at line 508 of file drivers.c.
Referenced by IntWinDrvRemoveFromAddress().
| void IntDriverDump | ( | void | ) |
| KERNEL_DRIVER* IntDriverFindByAddress | ( | QWORD | Gva | ) |
Returns the driver in which Gva resides.
For Windows guests, this will check that Gva is inside a kernel module and will return the appropriate driver. For Linux guests, if the module is initialized, this will check that the Gva is inside a kernel module and will return the appropriate driver; if the module is not initialized, this will check that Gva is inside the 'init_layout' memory region.
| [in] | Gva | The searched guest virtual address. |
Definition at line 164 of file drivers.c.
Referenced by IntAlertEptFillFromVictimZone(), IntCrLixHandleWrite(), IntExceptGetOriginatorFromModification(), IntExceptGetVictimMsr(), IntExceptLixKernelGetOriginator(), IntExceptPrintMsrInfo(), IntExceptWinKernelGetOriginator(), IntLixDumpStacktrace(), IntLixStackTraceGet(), IntLixStackTraceGetReg(), IntLixVdsoHandleWriteCommon(), IntLogCurrentIP(), IntLogStackTrace(), IntWinDrvObjCreateFromAddress(), IntWinDrvObjHandleWrite(), IntWinDrvObjRemove(), IntWinGuestFinishInit(), IntWinInfCheckCtxLoggerOnRelocation(), IntWinInfHookGetWmiLoggerGetCpuClock(), IntWinInfHookSppViolationCallbackWmiPtrChanged(), IntWinStackTraceGet32(), and IntWinStackTraceGet64().
| KERNEL_DRIVER* IntDriverFindByBase | ( | QWORD | Gva | ) |
Searches a driver object by its module base.
| [in] | Gva | Guest virtual address to search for. |
Definition at line 211 of file drivers.c.
Referenced by IntExceptKernelLogWindowsInformation().
| KERNEL_DRIVER* IntDriverFindByLoadOrder | ( | DWORD | LoadOrder | ) |
Searches a driver by its module load order.
The load order is the order in which the drivers were added to the gKernelDrivers list. For Windows drivers, the driver at position 0 is always ntoskrnl.exe, while the driver at position 1 is always hal.dll.
| [in] | LoadOrder | The index inside the list. |
Definition at line 235 of file drivers.c.
Referenced by IntLdrFixImports(), IntWinAgentHandleDriverVmcall(), and IntWinAgentSelectBootstrapAddress().
| KERNEL_DRIVER* IntDriverFindByName | ( | const void * | Name | ) |
Searches for a driver by its name.
| [in] | Name | NULL-terminated string with the driver name. For Windows guests this must be a wide char string; for Linux guests it must be a char string. |
Definition at line 266 of file drivers.c.
Referenced by IntLdrFixImports(), IntWinAgentHandleDriverVmcall(), IntWinApiHook(), IntWinHalCreateHalData(), and IntWinNetFindTcpObjects().
| KERNEL_DRIVER* IntDriverFindByPath | ( | const WCHAR * | Path | ) |
Searches for a driver by its module path.
This function always returns NULL for Linux guests.
| [in] | Path | NULL-terminated string with the kernel module path. |
| void IntDriverUninit | ( | void | ) |
Uninitializes the drivers submodule.
This will free every driver inside the gKernelDrivers list. The actual remove operation is delegated to IntLixDrvRemoveEntry or IntWinDrvRemoveEntry.
Definition at line 354 of file drivers.c.
Referenced by IntLixGuestUninit(), and IntWinGuestUninit().
|
static |
| LIST_HEAD gKernelDrivers = LIST_HEAD_INIT(gKernelDrivers) |