From 1ab98189bc3494060e82e22a82d19442e3c451f8 Mon Sep 17 00:00:00 2001 From: Curve Date: Mon, 13 May 2024 17:28:23 +0200 Subject: [PATCH] refactor(win/page): use `module` --- 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..46b9690 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 kernel_base = module::load("kernelbase.dll"); + return reinterpret_cast(kernel_base->symbol("VirtualAlloc2")); }(); auto *alloc = VirtualAlloc2(GetCurrentProcess(), nullptr, size, MEM_COMMIT | MEM_RESERVE,