diff --git a/README.md b/README.md index 90705f2..50d1e10 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ $ cattleya -i input -e start obfuscating input... obfuscation done! -$ readeld -h input +$ readelf -h input ELF Header: Magic: 7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00 Class: ELF64 @@ -151,7 +151,7 @@ Hex dump of section '.comment': Encrypts the name of a specific function with AES 256bit using the given key: ``` -$ cargo run -- -i bin/test_64bit --encrypt --encrypt-f fac --encrypt-key foo -o bin/res_enc +$ cattleya -i bin/test_64bit --encrypt --encrypt-f fac --encrypt-key foo -o bin/res_enc start obfuscating bin/test_64bit... obfuscation done! $ ./bin/res_enc diff --git a/src/obfus.rs b/src/obfus.rs index 9ca2e10..0145123 100644 --- a/src/obfus.rs +++ b/src/obfus.rs @@ -341,15 +341,14 @@ impl Obfuscator { .truncate(true) .open("/tmp/cattleya_encrypted_function_name") .map_err(crate::error::Error::CreateFile)?; - let mut writer = aesstream::AesWriter::new(tmp_file, encryptor).unwrap(); - writer + aesstream::AesWriter::new(tmp_file, encryptor) + .map_err(crate::error::Error::OpenFile)? .write_all(function.as_bytes()) .map_err(crate::error::Error::Io)?; let mut encrypted_function_name = Vec::new(); - let mut tmp_file = std::fs::File::open("/tmp/cattleya_encrypted_function_name") - .map_err(crate::error::Error::OpenFile)?; - tmp_file + std::fs::File::open("/tmp/cattleya_encrypted_function_name") + .map_err(crate::error::Error::OpenFile)? .read_to_end(&mut encrypted_function_name) .map_err(crate::error::Error::Io)?;