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.

Examples

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/file.com")).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.

Enums

Layer

Layer transform ranges of Cells

LayerIter

Iterator over a range of Cells.

OpaqueLayer

Layer that replace all overlapped Cells.

Type Definitions

Cell

A cell represents a single, possible undefined, byte.