executable_memory

Crates.ioexecutable_memory
lib.rsexecutable_memory
version0.1.2
sourcesrc
created_at2017-12-17 14:21:27.090301
updated_at2018-01-17 20:28:08.153885
descriptionexecutable memory for windows and unix
homepagehttps://gitlab.com/nathanfaucett/rs-executable_memory
repositoryhttps://gitlab.com/nathanfaucett/rs-executable_memory.git
max_upload_size
id43405
size8,214
Nathan Faucett (nathanfaucett)

documentation

README

rs-executable_memory

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);
}
Commit count: 13

cargo fmt