From 66f3d8fb1ec50f618bf95d5bdd1ccfce058b3fa5 Mon Sep 17 00:00:00 2001 From: Curve Date: Mon, 13 May 2024 17:06:35 +0200 Subject: [PATCH] refactor(page): load `kernel32` instead of `kernelbase` --- src/page.win.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/page.win.cpp b/src/page.win.cpp index 3621869..3639a50 100644 --- a/src/page.win.cpp +++ b/src/page.win.cpp @@ -1,4 +1,5 @@ #include "page.hpp" +#include "module.hpp" #include "constants.hpp" #include @@ -250,8 +251,8 @@ namespace lime static const auto VirtualAlloc2 = []() { - auto *kernel_base = LoadLibraryA("kernelbase.dll"); - return reinterpret_cast(GetProcAddress(kernel_base, "VirtualAlloc2")); + auto kernel32 = module::load("kernel32.dll"); + return reinterpret_cast(kernel32->symbol("VirtualAlloc2")); }(); auto *alloc = VirtualAlloc2(GetCurrentProcess(), nullptr, size, MEM_COMMIT | MEM_RESERVE,