compile/link on x64

This commit is contained in:
Akash Mozumdar 2019-01-08 21:52:28 -05:00
parent f1e7b4dc70
commit 84e9beea63
2 changed files with 5 additions and 2 deletions

View File

@ -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

View File

@ -304,13 +304,15 @@ bool SearchResourceString(LPCWSTR str)
std::vector<uint64_t> SearchMemory(const void* bytes, short length, DWORD protect)
{
SYSTEM_INFO systemInfo;
GetNativeSystemInfo(&systemInfo);
std::vector<std::pair<uint64_t, uint64_t>> 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