Crates.io | memreader |
lib.rs | memreader |
version | 0.1.1 |
source | src |
created_at | 2017-02-27 00:36:56.05079 |
updated_at | 2017-02-27 00:44:33.564641 |
description | A library crate designed to read memory from other processes |
homepage | |
repository | https://github.com/jkcclemens/memreader |
max_upload_size | |
id | 8706 |
size | 27,219 |
memreader
is a library written in Rust, designed to read memory from
other processes.
extern crate memreader;
use memreader::{MemReader, ProvidesSlices};
use std::env::args;
fn main() {
let args: Vec<String> = args().skip(1).collect();
if args.len() < 3 {
return;
}
let pid: u32 = args[0].parse().unwrap();
let addr: usize = args[1].parse().unwrap();
let n: usize = args[2].parse().unwrap();
let reader = MemReader::new(pid).unwrap();
let mut buf = vec![0; n];
reader.address_slice_len(addr, n).read_exact(&mut buf).unwrap();
println!("{} bytes at location {} in process {}'s memory: {:?}", n, addr, pid, buf);
}