开发者

Get allocated memory regions of running process

开发者 https://www.devze.com 2023-01-22 09:50 出处:网络
Can anyone tell me how to get using WinAPI functions memory allocated memory regions of some process? I want know for each region, start address, size and some other things like, protect开发者_C百科 t

Can anyone tell me how to get using WinAPI functions memory allocated memory regions of some process? I want know for each region, start address, size and some other things like, protect开发者_C百科 type etc.

I can't find any WinAPI function to do it ;-(

Can anyone help me?


There is code to brute force this using VirtualQueryEx here:

MEMORY_BASIC_INFORMATION    mbi;
/* Get maximum address range from system info */
GetSystemInfo(&si);
/* walk process addresses */
lpMem = 0;
while (lpMem < si.lpMaximumApplicationAddress) {
        VirtualQueryEx(...)
        /* increment lpMem to next region of memory */
        lpMem = (LPVOID)((DWORD)lpList->mbi.BaseAddress +
        (DWORD)lpList->mbi.RegionSize);
}
0

精彩评论

暂无评论...
验证码 换一张
取 消