#process-memory #read-memory #another #pid #byte #io #copy-address

bin+lib akhramov-read-process-memory

Read memory from another process

4 releases

Uses old Rust 2015

0.1.7 Jul 10, 2019
0.1.6 Jul 10, 2019
0.1.5 Jul 10, 2019
0.1.4 May 25, 2019

#15 in #read-memory

MIT license

22KB
381 lines

Build Status Build status [Build status] crates.io Coverage Status

A crate to read memory from another process. Code originally taken from Julia Evans' excellent ruby-stacktrace project.

Example

extern crate read_process_memory;

use std::convert::TryInto;
use std::io;
use read_process_memory::{Pid, ProcessHandle, CopyAddress, copy_address};

// Try to read `size` bytes at `address` from the process `pid`.
fn read_some_memory(pid: Pid, address: usize, size: usize) -> io::Result<()> {
    let handle: ProcessHandle = pid.try_into()?;
    let _bytes = copy_address(address, size, &handle)?;
    println!("Read {} bytes", size);
    Ok(())
}

fn main() {
    read_some_memory(123 as Pid, 0x100000, 100).unwrap();
}

Documentation

https://docs.rs/read-process-memory

Dependencies

~245KB