#[macro_use]
extern crate cfg_if;
extern crate libc;
pub mod slice;
pub mod error;
cfg_if! {
if #[cfg(target_os = "macos")] {
pub mod mac;
pub use mac::MemReader;
} else if #[cfg(target_os = "linux")] {
pub mod linux;
pub use linux::MemReader;
} else if #[cfg(target_os = "windows")] {
pub mod windows;
pub use windows::MemReader;
} else {
panic!("Unsupported system");
}
}
use slice::MemorySlice;
use error::*;
trait ReadsMemory {
fn read_bytes(&self, address: usize, n: usize) -> Result<Vec<u8>>;
}
pub trait ProvidesSlices {
fn address_slice(&self, start: usize, end: usize) -> MemorySlice;
fn address_slice_len(&self, start: usize, n: usize) -> MemorySlice;
}