MCPcopy Create free account
hub / github.com/Nariod/RustPacker / test_read_shellcode_content

Function test_read_shellcode_content

src/shellcode_reader.rs:20–31  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

18
19 #[test]
20 fn test_read_shellcode_content() {
21 let dir = std::env::temp_dir().join("rustpacker_test_reader");
22 fs::create_dir_all(&dir).unwrap();
23 let path = dir.join("test.bin");
24 let content: Vec<u8> = vec![0xDE, 0xAD, 0xBE, 0xEF];
25 fs::write(&path, &content).unwrap();
26
27 let result = read_shellcode(&path);
28 assert_eq!(result, content);
29
30 fs::remove_dir_all(&dir).unwrap();
31 }
32
33 #[test]
34 fn test_read_shellcode_empty() {

Callers

nothing calls this directly

Calls 1

read_shellcodeFunction · 0.85

Tested by

no test coverage detected