diff --git a/kernelx.cpp b/kernelx.cpp index d31ab2c..52f7602 100644 --- a/kernelx.cpp +++ b/kernelx.cpp @@ -145,6 +145,13 @@ static LPVOID MappableQuery(_In_opt_ LPCVOID lpAddress, _Out_ PMAPPABLE_MEM pMap } --it; + + if (it->first + it->second.RegionSize <= (ULONG_PTR)lpAddress) + { + *pMappable = {}; + return nullptr; + } + *pMappable = it->second; return (LPVOID)it->first; }