Skip to content

Commit

Permalink
Revert "refactor(page): load kernel32 instead of kernelbase"
Browse files Browse the repository at this point in the history
This reverts commit 66f3d8f.
  • Loading branch information
Curve committed May 13, 2024
1 parent 088732f commit ae3998f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/page.win.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#include "page.hpp"
#include "module.hpp"
#include "constants.hpp"

#include <limits>
Expand Down Expand Up @@ -251,8 +250,8 @@ namespace lime

static const auto VirtualAlloc2 = []()
{
auto kernel32 = module::load("kernel32.dll");
return reinterpret_cast<decltype(::VirtualAlloc2) *>(kernel32->symbol("VirtualAlloc2"));
auto *kernel_base = LoadLibraryA("kernelbase.dll");
return reinterpret_cast<decltype(::VirtualAlloc2) *>(GetProcAddress(kernel_base, "VirtualAlloc2"));
}();

auto *alloc = VirtualAlloc2(GetCurrentProcess(), nullptr, size, MEM_COMMIT | MEM_RESERVE,
Expand Down

0 comments on commit ae3998f

Please sign in to comment.