I am trying to obtain the memory map of a process. One way I can think of doing this is to attach Olly/Immunity Debugger to the process and copy the memory map to the clipboard. However, this is probably not a good idea when I'd like to repeat this multiple times consecutively. Is there a tool similar to ListDLLs that can be used to achieve this? I noticed procdump can be used to dump the memory of a process but I don't need a memory dump: I just need a list of valid memory locations.
Automatically list of mapped memory locations(and their attributes) of a running process
windows;memory;dumping
Mark Russinovich's SysInternals suite contains a utility named VMMap, which can be used to view the memory layout of a process and/or dump the information in various formats.As Brendan mentioned, an answer in /proc/self/maps equivalent on Windows shows how to obtain the information via calls to VirtualQueryEx(). So you could easily whip up your own customised utility by writing a few lines of C/C++.Note: the memory layout is not static. Stacks can grow, sections can be unmapped, blocks allocated or freed, reserved space be committed, valid pages be made inaccessible. Depending on the goal of the operation it may be best to integrate the querying of memory layout info with the process that uses it, which makes it easier to achieve the desired accuracy. Things to ponder here are caching (for performance) versus snapshot semantics (to achieve consistent views).