HyperDbg Debugger
Loading...
Searching...
No Matches
PoolManager.h
Go to the documentation of this file.
1
12#pragma once
13
15// Definition //
17
22#define MaximumRequestsQueueDepth 300
23#define NumberOfPreAllocatedBuffers 10
24
26// Structures //
28
33typedef struct _POOL_TABLE
34{
35 UINT64 Address; // Should be the start of the list as we compute it as the start address
36 SIZE_T Size;
38 LIST_ENTRY PoolsList;
42
44
56
58// Variables //
60
66
72
78
84
90
96
102
104// Functions //
106
107// ----------------------------------------------------------------------------
108// Private Interfaces
109//
110
114static BOOLEAN
116
117static VOID PlmgrFreeRequestNewAllocation(VOID);
118
119// ----------------------------------------------------------------------------
120// Public Interfaces
121//
122
125
126VOID
128
129VOID
131
134
137
138UINT64
139PoolManagerRequestPool(POOL_ALLOCATION_INTENTION Intention, BOOLEAN RequestNewPool, UINT32 Size);
140
142PoolManagerFreePool(UINT64 AddressToFree);
POOL_TYPE SIZE_T NumberOfBytes
Definition Hooks.h:88
VOID PlmgrFreeRequestNewAllocation(VOID)
Definition PoolManager.c:37
BOOLEAN PlmgrAllocateRequestNewAllocation(SIZE_T NumberOfBytes)
Allocate global requesting variable.
Definition PoolManager.c:21
BOOLEAN PoolManagerCheckAndPerformAllocationAndDeallocation()
This function performs allocations from VMX non-root based on g_RequestNewAllocation.
Definition PoolManager.c:320
UINT64 PoolManagerRequestPool(POOL_ALLOCATION_INTENTION Intention, BOOLEAN RequestNewPool, UINT32 Size)
This function should be called from vmx-root in order to get a pool from the list.
Definition PoolManager.c:230
struct _POOL_TABLE POOL_TABLE
Table of holding pools detail structure.
volatile LONG LockForReadingPool
Spinlock for reading pool.
Definition PoolManager.h:77
struct _REQUEST_NEW_ALLOCATION REQUEST_NEW_ALLOCATION
Manage the requests for new allocations.
BOOLEAN PoolManagerRequestAllocation(SIZE_T Size, UINT32 Count, POOL_ALLOCATION_INTENTION Intention)
Request to allocate new buffers.
Definition PoolManager.c:436
struct _POOL_TABLE * PPOOL_TABLE
BOOLEAN g_IsNewRequestForAllocationReceived
We set it when there is a new allocation.
Definition PoolManager.h:89
volatile LONG LockForRequestAllocation
Request allocation Spinlock.
Definition PoolManager.h:71
REQUEST_NEW_ALLOCATION * g_RequestNewAllocation
If sb wants allocation from vmx root, adds it's request to this structure.
Definition PoolManager.h:65
BOOLEAN g_IsNewRequestForDeAllocation
We set it when there is a new allocation.
Definition PoolManager.h:95
LIST_ENTRY g_ListOfAllocatedPoolsHead
Create a list from all pools.
Definition PoolManager.h:101
BOOLEAN PoolManagerInitialize()
Initializes the pool manager.
Definition PoolManager.c:53
BOOLEAN PoolManagerFreePool(UINT64 AddressToFree)
This function set a pool flag to be freed, and it will be freed on the next IOCTL when it's safe to r...
Definition PoolManager.c:154
struct _REQUEST_NEW_ALLOCATION * PREQUEST_NEW_ALLOCATION
VOID PoolManagerUninitialize()
Uninitialize the pool manager (free the buffers, etc.).
Definition PoolManager.c:93
VOID PoolManagerShowPreAllocatedPools()
Shows list of pre-allocated pools available (used for debugging purposes).
Definition PoolManager.c:195
BOOLEAN g_PoolManagerInitialized
Pool manager memory allocator initialized.
Definition PoolManager.h:83
UCHAR BOOLEAN
Definition BasicTypes.h:35
long LONG
Definition BasicTypes.h:28
unsigned int UINT32
Definition BasicTypes.h:54
enum _POOL_ALLOCATION_INTENTION POOL_ALLOCATION_INTENTION
Inum of intentions for buffers (buffer tag).
Table of holding pools detail structure.
Definition PoolManager.h:34
UINT64 Address
Definition PoolManager.h:35
BOOLEAN ShouldBeFreed
Definition PoolManager.h:40
BOOLEAN AlreadyFreed
Definition PoolManager.h:41
BOOLEAN IsBusy
Definition PoolManager.h:39
POOL_ALLOCATION_INTENTION Intention
Definition PoolManager.h:37
LIST_ENTRY PoolsList
Definition PoolManager.h:38
SIZE_T Size
Definition PoolManager.h:36
Manage the requests for new allocations.
Definition PoolManager.h:50
UINT32 Count
Definition PoolManager.h:52
SIZE_T Size
Definition PoolManager.h:51
POOL_ALLOCATION_INTENTION Intention
Definition PoolManager.h:53