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,