skyracer2012
skyracer2012

Reputation: 33

Get List of all Regions used by a process c++

When using tools such as Process Hacker or x64dbg there is a Memory tap (x64dbg Memory Map). Is there a way to get all of those regions displayed there in c++ with its coresponding base address and size?

I know how to get all the Modules but that only gives me Images but not Mapped nor Private Regions.

As you can see in the Image I want the green ones and not only the red. If you need any further Information let me know.

enter image description here

Edit: The platform I am using is Windows.

Edit2: I found the solution by changing the post from Can't VirtualAlloc on free region returned by VirtualQuery to my needs by looping VirtualQuery and adding Base + Region Size.

Thanks for all your help!

Upvotes: 1

Views: 930

Answers (1)

MaxV
MaxV

Reputation: 2800

On Linux you can use /proc (doc).

  • /proc/<pid>/map_files - Information about memory mapped files
  • /proc/<pid>/maps - Memory maps to executables and library files (2.4)

Upvotes: 1

Related Questions