Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/taviso/loadlibrary.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGert Dreyer <gertdreyer@gmail.com>2020-08-04 10:17:43 +0300
committerGert Dreyer <gertdreyer@gmail.com>2020-08-04 10:17:43 +0300
commit207f56a17c11d228b4e808816da7dd9020e1a5df (patch)
tree1a9b63c5d7b2ace9aa09d85ef3af2daec7c6e0cc
parentd74abc85f86796465f9aacd1142c79f01d64848a (diff)
Added GlobalAlloc metods to mirror LocalAlloc
-rw-r--r--peloader/winapi/Heap.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/peloader/winapi/Heap.c b/peloader/winapi/Heap.c
index 21d1de9..d34bf07 100644
--- a/peloader/winapi/Heap.c
+++ b/peloader/winapi/Heap.c
@@ -105,6 +105,23 @@ STATIC PVOID WINAPI RtlAllocateHeap(PVOID HeapHandle,
return malloc(Size);
}
+STATIC PVOID WINAPI GlobalAlloc(UINT uFlags, SIZE_T uBytes)
+{
+ PVOID Buffer = malloc(uBytes);
+ assert(uFlags == 0);
+
+ DebugLog("%#x, %u => %p", uFlags, uBytes, Buffer);
+
+ return Buffer;
+}
+
+STATIC PVOID WINAPI GlobalFree(PVOID hMem)
+{
+ DebugLog("%p", hMem);
+ free(hMem);
+ return NULL;
+}
+
DECLARE_CRT_EXPORT("HeapCreate", HeapCreate);
DECLARE_CRT_EXPORT("GetProcessHeap", GetProcessHeap);
DECLARE_CRT_EXPORT("HeapAlloc", HeapAlloc);
@@ -115,3 +132,5 @@ DECLARE_CRT_EXPORT("LocalAlloc", LocalAlloc);
DECLARE_CRT_EXPORT("LocalFree", LocalFree);
DECLARE_CRT_EXPORT("RtlCreateHeap", RtlCreateHeap);
DECLARE_CRT_EXPORT("RtlAllocateHeap", RtlAllocateHeap);
+DECLARE_CRT_EXPORT("GlobalAlloc", GlobalAlloc);
+DECLARE_CRT_EXPORT("GlobalFree", GlobalFree);