Module panopticon_core::layer [] [src]

A layer spans parts of a region and transforms the content of cells inside.

Layers can overlap with other Layers below that are in the same Region. Layer can be used to modify Regions by overlaying parts of the original Cells with new ones.


use std::path::Path;
use panopticon_core::{Region,OpaqueLayer,Bound,Layer};

// All accessable RAM is modeled as a single region
let mut reg = Region::undefined("ram".to_string(),0xc0000000);

// The layer that simulates mapping the COM file into RAM
let mapping = OpaqueLayer::open(Path::new("path/to/")).ok().unwrap();

// COM files are always mapped at 0100h
reg.cover(Bound::new(0x100,0x100 + mapping.len()),Layer::Opaque(mapping));

Loading a Windows COM file.



Layer transform ranges of Cells


Iterator over a range of Cells.


Layer that replace all overlapped Cells.

Type Definitions


A cell represents a single, possible undefined, byte.