This crate supports reading virtual memory maps from another process - and supports Linux, macOS, Windows, and FreeBSD operating systems.
use proc_maps::get_process_maps;
let maps = get_process_maps(pid)?;
for map in maps {
println!("Filename {:?} Address {} Size {}", map.filename(), map.start(), map.size());
}
cargo run --example print_maps <PID>
This code was originally developed by Julia Evans as part of the rbspy project: https://github.com/rbspy/rbspy.
Released under the MIT License.