From 84e9beea63799c8c206c7936ccad367cfd2accc2 Mon Sep 17 00:00:00 2001 From: Akash Mozumdar Date: Tue, 8 Jan 2019 21:52:28 -0500 Subject: [PATCH] compile/link on x64 --- vnrhook/CMakeLists.txt | 1 + vnrhook/util/util.cc | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/vnrhook/CMakeLists.txt b/vnrhook/CMakeLists.txt index 1ad5f9d..842b371 100644 --- a/vnrhook/CMakeLists.txt +++ b/vnrhook/CMakeLists.txt @@ -7,6 +7,7 @@ set(vnrhook_src engine/match64.cc engine/native/pchooks.cc util/ithsys/ithsys.cc + util/util.cc ) else() set(vnrhook_src diff --git a/vnrhook/util/util.cc b/vnrhook/util/util.cc index 1ec0166..7911359 100644 --- a/vnrhook/util/util.cc +++ b/vnrhook/util/util.cc @@ -304,13 +304,15 @@ bool SearchResourceString(LPCWSTR str) std::vector SearchMemory(const void* bytes, short length, DWORD protect) { + SYSTEM_INFO systemInfo; + GetNativeSystemInfo(&systemInfo); std::vector> validMemory; - for (BYTE* probe = NULL; (uint64_t)probe < 0x80000000;) // end of user memory space + for (BYTE* probe = NULL; probe < systemInfo.lpMaximumApplicationAddress;) { MEMORY_BASIC_INFORMATION info = {}; if (!VirtualQuery(probe, &info, sizeof(info))) { - probe += 0x1000; // page size + probe += systemInfo.dwPageSize; continue; } else