tombana Master Cheater Reputation: 2 Joined: 14 Jun 2007 Posts: 456 Location: The Netherlands
|
Posted: Sun Apr 04, 2010 12:57 pm Post subject: |
|
|
slovach wrote: | why the second for loop?
for i = min address; i <= max; i += region size
virtualquery for delicious informations, do whatever with it
go hog wild |
Wouldn't calling virtualquery on every address slow things down?
@iPromise: something like this:
Code: | for (DWORD addr = lpStartAddress; addr <= lpStopAddress; )
{
S = VirtualQuery((LPCVOID) addr, &MBI, sizeof(MEMORY_BASIC_INFORMATION));
if( MBI.Protect == PAGE_READWRITE ){ //And other protections like execute and so on
for (DWORD i = MBI.BaseAddress; i <= ((DWORD) MBI.BaseAddress + (DWORD) MBI.RegionSize); i++)
{
...
}
}
addr = ((DWORD) MBI.BaseAddress + (DWORD) MBI.RegionSize);
} |
|
|