Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int main()
- {
- SYSTEM_INFO si;
- GetSystemInfo(&si);
- char *pMin = (char*)si.lpMinimumApplicationAddress;
- char *pMax = (char*)si.lpMaximumApplicationAddress;
- for (char* pAddress = pMin; pAddress<pMax; /*Empty*/)
- {
- MEMORY_BASIC_INFORMATION mbi;
- DWORD res = VirtualQuery(pAddress, &mbi, sizeof(mbi));
- if (res != sizeof(mbi))
- {
- cerr << "VirtualQuery failed!" << endl;
- return -1;
- }
- if (mbi.State == MEM_COMMIT)
- {
- DWORD base = (DWORD)mbi.BaseAddress;
- cout << hex << showbase << base << " - " << base + mbi.RegionSize-1 << endl;
- }
- pAddress += mbi.RegionSize;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement