machina 0.6.1

Manage and execute assembly at runtime.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#[macro_use]
extern crate sam;

#[cfg(test)]
mod tests {
    extern crate machina;

    use self::machina::memory::Memory;

    #[test]
    fn leet() {
        let mut memory = Memory::new(1);
        memory.emit_bytes(sam!(x64 => "mov rax, 0x1337"));
        let rax = memory.execute();
        drop(memory);
        assert_eq!(rax, 0x1337);
    }
}