Get allocated memory regions of running process

前端 未结 1 1291
孤独总比滥情好
孤独总比滥情好 2021-01-14 07:59

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

相关标签:
1条回答
  • 2021-01-14 08:05

    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 讨论(0)
提交回复
热议问题