Crates.io | executable_memory |
lib.rs | executable_memory |
version | 0.1.2 |
source | src |
created_at | 2017-12-17 14:21:27.090301 |
updated_at | 2018-01-17 20:28:08.153885 |
description | executable memory for windows and unix |
homepage | https://gitlab.com/nathanfaucett/rs-executable_memory |
repository | https://gitlab.com/nathanfaucett/rs-executable_memory.git |
max_upload_size | |
id | 43405 |
size | 8,214 |
executable memory for windows and unix
extern crate executable_memory;
use executable_memory::ExecutableMemory;
fn main() {
let mut memory = ExecutableMemory::default(); // Page size 1
// x86_64
memory[0] = 0xb8;
memory[1] = 0xff;
memory[2] = 0xff;
memory[3] = 0xff;
memory[4] = 0xff;
memory[5] = 0xc3;
let f: fn() -> u32 = unsafe {
mem::transmute((&memory[0..6]).as_ptr())
};
assert_eq!(f(), 4294967295);
}