I\'m attempting to make a buffer of memory executable, then execute it in Rust. I\'ve gotten all the way until I need to cast the raw executable bytes as code/instructions.
Use mem::transmute to cast a raw pointer to a function pointer type.
use std::mem; let func: unsafe extern "C" fn() = mem::transmute(map.data()); func();