1
0
Fork 0

Merge pull request #3188 from ZehMatt/query-page

Start enumerating memory pages at minimum application address
This commit is contained in:
Duncan Ogilvie 2023-08-25 12:21:32 +02:00 committed by GitHub
commit 4a767ea507
Signed by: GitHub
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 1 deletions

View File

@ -24,6 +24,14 @@ std::map<Range, MEMPAGE, RangeCompare> memoryPages;
bool bListAllPages = false;
bool bQueryWorkingSet = false;
// Get system information once.
static const SYSTEM_INFO systemInfo = []()
{
SYSTEM_INFO si;
GetSystemInfo(&si);
return si;
}();
static std::vector<MEMPAGE> QueryMemPages()
{
// First gather all possible pages in the memory range
@ -31,7 +39,7 @@ static std::vector<MEMPAGE> QueryMemPages()
pages.reserve(200); //TODO: provide a better estimate
SIZE_T numBytes = 0;
duint pageStart = 0;
duint pageStart = (duint)systemInfo.lpMinimumApplicationAddress;
duint allocationBase = 0;
do