Cross platform APIs for memory allocation.
More...
Go to the source code of this file.
Cross platform APIs for memory allocation.
- Author
- Behrooz Abbassi (Behro.nosp@m.ozAb.nosp@m.bassi.nosp@m.@hyp.nosp@m.erdbg.nosp@m..org)
-
Sina Karvandi (sina@.nosp@m.hype.nosp@m.rdbg..nosp@m.org)
- Version
- 0.1
- Date
- 2022-01-17
- Copyright
- This project is released under the GNU Public License v3.
◆ PlatformMemAllocateContiguousZeroedMemory()
PVOID PlatformMemAllocateContiguousZeroedMemory |
( |
SIZE_T | NumberOfBytes | ) |
|
Allocate a contiguous zeroed memory.
- Parameters
-
- Returns
- PVOID
23{
25 PHYSICAL_ADDRESS MaxPhysicalAddr = {.QuadPart = MAXULONG64};
26
27 Result = MmAllocateContiguousMemory(
NumberOfBytes, MaxPhysicalAddr);
28 if (Result != NULL)
30
31 return Result;
32}
POOL_TYPE SIZE_T NumberOfBytes
Definition Hooks.h:167
NULL()
Definition test-case-generator.py:530
◆ PlatformMemAllocateNonPagedPool()
PVOID PlatformMemAllocateNonPagedPool |
( |
SIZE_T | NumberOfBytes | ) |
|
Allocate a non-paged buffer.
- Parameters
-
- Returns
- PVOID
42{
44
45 return Result;
46}
#define POOLTAG
Pool tag.
Definition Constants.h:417
◆ PlatformMemAllocateNonPagedPoolWithQuota()
PVOID PlatformMemAllocateNonPagedPoolWithQuota |
( |
SIZE_T | NumberOfBytes | ) |
|
Allocate a non-paged buffer (use QUOTA)
- Parameters
-
- Returns
- PVOID
56{
57 PVOID Result = ExAllocatePool2(POOL_FLAG_NON_PAGED | POOL_FLAG_USE_QUOTA,
NumberOfBytes,
POOLTAG);
58
59 return Result;
60}
◆ PlatformMemAllocateZeroedNonPagedPool()
PVOID PlatformMemAllocateZeroedNonPagedPool |
( |
SIZE_T | NumberOfBytes | ) |
|
Allocate a non-paged buffer (zeroed)
- Parameters
-
- Returns
- PVOID
70{
72
73 if (Result != NULL)
75
76 return Result;
77}
◆ PlatformMemFreePool()
VOID PlatformMemFreePool |
( |
PVOID | BufferAddress | ) |
|
Free (dellocate) a non-paged buffer.
- Parameters
-
- Returns
- VOID
87{
89}
UINT64 BOOLEAN PVOID BufferAddress
Definition HyperDbgScriptImports.h:67