(file_path: &Path)
| 1 | use std::path::Path; |
| 2 | |
| 3 | pub fn read_shellcode(file_path: &Path) -> Vec<u8> { |
| 4 | println!("[+] Reading binary file.."); |
| 5 | match std::fs::read(file_path) { |
| 6 | Ok(bytes) => { |
| 7 | println!("[+] Done reading binary file!"); |
| 8 | bytes |
| 9 | } |
| 10 | Err(err) => panic!("Failed to read shellcode file {:?}: {}", file_path, err), |
| 11 | } |
| 12 | } |
| 13 | |
| 14 | #[cfg(test)] |
| 15 | mod tests { |
no outgoing calls