HyperDbg Debugger
Loading...
Searching...
No Matches
GlobalVariableManagement.h File Reference

Headers for management of global variables. More...

Go to the source code of this file.

Functions

BOOLEAN GlobalGuestStateAllocateZeroedMemory (VOID)
 Allocate guest state memory.
VOID GlobalGuestStateFreeMemory (VOID)
 Free guest state memory.

Detailed Description

Headers for management of global variables.

Author
Behrooz Abbassi (Behro.nosp@m.ozAb.nosp@m.bassi.nosp@m.@hyp.nosp@m.erdbg.nosp@m..org)
Version
0.1
Date
2022-03-29

Function Documentation

◆ GlobalGuestStateAllocateZeroedMemory()

BOOLEAN GlobalGuestStateAllocateZeroedMemory ( VOID )

Allocate guest state memory.

Returns
BOOLEAN
21{
22 SSIZE_T BufferSizeInByte = sizeof(VIRTUAL_MACHINE_STATE) * KeQueryActiveProcessorCount(0);
23
24 //
25 // Allocate global variable to hold Guest(s) state
26 //
27 if (!g_GuestState)
28 {
30
31 if (!g_GuestState)
32 {
33 LogError("Err, insufficient memory\n");
34 return FALSE;
35 }
36 }
37
38 //
39 // Zero the memory
40 //
41 RtlZeroMemory(g_GuestState, BufferSizeInByte);
42
43 return TRUE;
44}
PVOID PlatformMemAllocateNonPagedPool(SIZE_T NumberOfBytes)
Allocates non-paged pool memory.
Definition PlatformMem.c:208
#define TRUE
Definition BasicTypes.h:114
#define FALSE
Definition BasicTypes.h:113
#define LogError(format,...)
Log in the case of error.
Definition HyperDbgHyperLogIntrinsics.h:113
struct _VIRTUAL_MACHINE_STATE VIRTUAL_MACHINE_STATE
The status of each core after and before VMX.
VIRTUAL_MACHINE_STATE * g_GuestState
Save the state and variables related to virtualization on each to logical core.
Definition GlobalVariables.h:38

◆ GlobalGuestStateFreeMemory()

VOID GlobalGuestStateFreeMemory ( VOID )

Free guest state memory.

Returns
VOID
53{
56}
PVOID PlatformMemFreePool(PVOID BufferAddress)
Frees a memory pool.
Definition PlatformMem.c:269
NULL()
Definition test-case-generator.py:530