bugfix getmemoryrange

This commit is contained in:
Akash Mozumdar 2018-09-03 18:42:47 -04:00
parent 34082f31ed
commit 79b2782dab

View File

@ -60,13 +60,13 @@ DWORD SearchPattern(DWORD base, DWORD base_length, LPCVOID search, DWORD search_
DWORD IthGetMemoryRange(LPCVOID mem, DWORD *base, DWORD *size) DWORD IthGetMemoryRange(LPCVOID mem, DWORD *base, DWORD *size)
{ {
MEMORY_BASIC_INFORMATION info; MEMORY_BASIC_INFORMATION info = {};
VirtualQuery(mem, &info, sizeof(info)); VirtualQuery(mem, &info, sizeof(info));
if (base) if (base)
*base = (DWORD)info.BaseAddress; *base = (DWORD)info.BaseAddress;
if (size) if (size)
*size = info.RegionSize; *size = info.RegionSize;
return info.Protect; return info.Protect > PAGE_NOACCESS;
} }
inline DWORD GetHash(LPSTR str) inline DWORD GetHash(LPSTR str)