Bitdefender Hypervisor Memory Introspection
lixfastread.c File Reference
#include "introcore.h"
#include "guests.h"
#include "introstatus.h"
#include "lixguest.h"

Go to the source code of this file.

Functions

INTSTATUS IntLixFsrInitMap (QWORD Gva)
 Initialize the fast read mechanism. More...
 
void IntLixFsrUninitMap (void)
 Uninitialize the fast read mechanism. More...
 
INTSTATUS IntLixFsrRead (QWORD Gva, DWORD Offset, DWORD Size, void *Buffer)
 Performs a read from a previously mapped guest virtual address. More...
 

Variables

static QWORD gMappedGva = 0
 The guest virtual address that is currently mapped. More...
 
static BYTEgMapping1 = NULL
 The mapping point of the first page mapped. More...
 
static BYTEgMapping2 = NULL
 The mapping point of the second page mapped. More...
 

Function Documentation

◆ IntLixFsrInitMap()

INTSTATUS IntLixFsrInitMap ( QWORD  Gva)

Initialize the fast read mechanism.

This function will map two pages starting from the Gva parameter.

Parameters
[in]GvaThe guest virtual address to be mapped.
Returns
INT_STATUS_SUCCESS On success.
INT_STATUS_ALREADY_INITIALIZED If the fast read mechanism is already initialized.
The status returned by IntVirtMemMap if a mapping error occurs.

Definition at line 17 of file lixfastread.c.

Referenced by IntLixMmFindVmaInLinkedList(), IntLixMmFindVmaInRbTree(), IntLixVmaAdjustInternal(), and IntLixVmaFill().

◆ IntLixFsrRead()

INTSTATUS IntLixFsrRead ( QWORD  Gva,
DWORD  Offset,
DWORD  Size,
void *  Buffer 
)

Performs a read from a previously mapped guest virtual address.

Parameters
[in]GvaThe guest virtual address supplied to a previous IntLixFsrInitMap call.
[in]OffsetThe offset relative to the guest virtual address supplied to the IntLixFsrInitMap.
[in]SizeThe number of bytes which follows to be fetched.
[out]BufferThe buffer that stores the read outcome.
Returns
INT_STATUS_SUCCESS On success.
INT_STATUS_NOT_INITIALIZED If the mechanism is not yet initialized (via IntLixFsrInitMap).
INT_STATUS_INVALID_PARAMETER_1 If the Gva parameter is different from the mapped address.
INT_STATUS_INVALID_PARAMETER_3 If Buffer parameter does not point to a valid memory location.
INT_STATUS_INVALID_PARAMETER_MIX If the requested memory range spills out of the mapped range.

Definition at line 86 of file lixfastread.c.

Referenced by IntLixMmFindVmaInLinkedList(), IntLixMmFindVmaInRbTree(), IntLixVmaAdjustInternal(), and IntLixVmaFill().

◆ IntLixFsrUninitMap()

void IntLixFsrUninitMap ( void  )

Uninitialize the fast read mechanism.

Definition at line 62 of file lixfastread.c.

Referenced by IntLixMmFindVmaInLinkedList(), IntLixMmFindVmaInRbTree(), IntLixVmaAdjustInternal(), and IntLixVmaFill().

Variable Documentation

◆ gMappedGva

QWORD gMappedGva = 0
static

The guest virtual address that is currently mapped.

Definition at line 10 of file lixfastread.c.

Referenced by IntLixFsrInitMap(), IntLixFsrRead(), and IntLixFsrUninitMap().

◆ gMapping1

BYTE* gMapping1 = NULL
static

The mapping point of the first page mapped.

Definition at line 12 of file lixfastread.c.

Referenced by IntLixFsrInitMap(), IntLixFsrRead(), and IntLixFsrUninitMap().

◆ gMapping2

BYTE* gMapping2 = NULL
static

The mapping point of the second page mapped.

Definition at line 13 of file lixfastread.c.

Referenced by IntLixFsrRead(), and IntLixFsrUninitMap().