Crates.io | benfred-read-process-memory |
lib.rs | benfred-read-process-memory |
version | 0.2.1 |
source | src |
created_at | 2018-08-25 18:41:33.355809 |
updated_at | 2021-03-22 02:47:55.012187 |
description | Read memory from another process. |
homepage | https://github.com/benfred/read-process-memory |
repository | https://github.com/benfred/read-process-memory |
max_upload_size | |
id | 81414 |
size | 28,563 |
A crate to read memory from another process. Code originally taken from Julia Evans' excellent ruby-stacktrace project.
extern crate benfred_read_process_memory as 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();
}