Crates.io | rhai-memflow |
lib.rs | rhai-memflow |
version | 0.1.2 |
source | src |
created_at | 2022-09-09 22:18:17.417159 |
updated_at | 2022-10-18 23:53:41.30363 |
description | Rhai package for memflow |
homepage | |
repository | https://github.com/dankope/rhai-memflow/ |
max_upload_size | |
id | 662143 |
size | 78,294 |
rhai-memflow
This crate provides the memory introspection library Memflow to Rhai, an embedded scripting language and evaluation engine for Rust.
Memflow is a library that allows live memory introspection of running systems and their snapshots.
Cargo.toml
[dependencies]
rhai-memflow = "0.1"
# `rhai-memflow` uses version `^0.2.0-beta`, this .
memflow = { version = "^0.2.0-beta", features = ["plugins"] }
let calc_proc = OS.process("CalculatorApp.exe");
let mod_base = calc_proc.mod("CalculatorApp.dll").base;
// Our native!
native COFFHeader {
^ 6, // Pad 6 bytes.
sections: UInt16,
timestamp: UInt32
};
let coff_header = calc_proc.read(COFFHeader, mod_base + 0x40);
print(coff_header);
use memflow::prelude::v1::*;
use rhai::{packages::Package, Engine, Scope};
// Create our inventory and OS.
let inventory = Inventory::scan();
let os = inventory.builder().os_chain(chain).build()?;
// Register our memflow package.
let mut engine = Engine::new();
let package = MemflowPackage::new();
package.register_into_engine(&mut engine);
// Add our OS to rhai scope.
let mut scope = Scope::new();
let shared_os: SharedOs = RefCell::new(os);
scope.push_constant("OS", shared_os);
// Run our script.
engine
.eval_with_scope::<()>(&mut scope, include_str!("script.rhai"))
.expect("eval failed");