Compare commits

...

2 commits

Author SHA1 Message Date
3603823062 timings 2023-03-03 19:52:05 +01:00
6c75305ca5 Spooky vibes 2023-03-03 18:23:25 +01:00
3 changed files with 271 additions and 27 deletions

158
Cargo.lock generated
View file

@ -71,7 +71,7 @@ checksum = "a13c462fabdd950ef14308a9390b07fa2e2e3aabccba1f3ea36ea2231bb942ab"
dependencies = [ dependencies = [
"accesskit", "accesskit",
"accesskit_consumer", "accesskit_consumer",
"arrayvec", "arrayvec 0.7.2",
"once_cell", "once_cell",
"parking_lot", "parking_lot",
"paste", "paste",
@ -105,9 +105,12 @@ dependencies = [
"downloader", "downloader",
"eframe", "eframe",
"egui", "egui",
"progress_bar",
"rand",
"regex", "regex",
"version-compare", "version-compare",
"walkdir", "walkdir",
"wallpaper",
] ]
[[package]] [[package]]
@ -178,6 +181,12 @@ version = "0.3.6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a4c527152e37cf757a3f78aae5a06fbeefdb07ccc535c980a3208ee3060dd544" checksum = "a4c527152e37cf757a3f78aae5a06fbeefdb07ccc535c980a3208ee3060dd544"
[[package]]
name = "arrayvec"
version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b"
[[package]] [[package]]
name = "arrayvec" name = "arrayvec"
version = "0.7.2" version = "0.7.2"
@ -320,6 +329,12 @@ version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa"
[[package]]
name = "base64"
version = "0.13.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8"
[[package]] [[package]]
name = "base64" name = "base64"
version = "0.21.0" version = "0.21.0"
@ -332,6 +347,17 @@ version = "1.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
[[package]]
name = "blake2b_simd"
version = "0.5.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "afa748e348ad3be8263be728124b24a24f268266f6f5d58af9d75f6a40b5c587"
dependencies = [
"arrayref",
"arrayvec 0.5.2",
"constant_time_eq",
]
[[package]] [[package]]
name = "block" name = "block"
version = "0.1.6" version = "0.1.6"
@ -483,6 +509,12 @@ dependencies = [
"crossbeam-utils", "crossbeam-utils",
] ]
[[package]]
name = "constant_time_eq"
version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc"
[[package]] [[package]]
name = "core-foundation" name = "core-foundation"
version = "0.9.3" version = "0.9.3"
@ -588,6 +620,17 @@ dependencies = [
"crypto-common", "crypto-common",
] ]
[[package]]
name = "dirs"
version = "1.0.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3fd78930633bd1c6e35c4b42b1df7b0cbc6bc191146e512bb3bedf243fcc3901"
dependencies = [
"libc",
"redox_users 0.3.5",
"winapi",
]
[[package]] [[package]]
name = "dirs" name = "dirs"
version = "4.0.0" version = "4.0.0"
@ -604,7 +647,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6"
dependencies = [ dependencies = [
"libc", "libc",
"redox_users", "redox_users 0.4.3",
"winapi", "winapi",
] ]
@ -738,6 +781,15 @@ dependencies = [
"cfg-if", "cfg-if",
] ]
[[package]]
name = "enquote"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "06c36cb11dbde389f4096111698d8b567c0720e3452fd5ac3e6b4e47e1939932"
dependencies = [
"thiserror",
]
[[package]] [[package]]
name = "enumflags2" name = "enumflags2"
version = "0.7.5" version = "0.7.5"
@ -985,6 +1037,17 @@ dependencies = [
"winapi", "winapi",
] ]
[[package]]
name = "getrandom"
version = "0.1.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce"
dependencies = [
"cfg-if",
"libc",
"wasi 0.9.0+wasi-snapshot-preview1",
]
[[package]] [[package]]
name = "getrandom" name = "getrandom"
version = "0.2.8" version = "0.2.8"
@ -993,7 +1056,7 @@ checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"libc", "libc",
"wasi", "wasi 0.11.0+wasi-snapshot-preview1",
] ]
[[package]] [[package]]
@ -1401,7 +1464,7 @@ checksum = "5b9d9a46eff5b4ff64b45a9e316a6d1e0bc719ef429cbec4dc630684212bfdf9"
dependencies = [ dependencies = [
"libc", "libc",
"log", "log",
"wasi", "wasi 0.11.0+wasi-snapshot-preview1",
"windows-sys 0.45.0", "windows-sys 0.45.0",
] ]
@ -1772,6 +1835,15 @@ dependencies = [
"unicode-ident", "unicode-ident",
] ]
[[package]]
name = "progress_bar"
version = "1.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2c8e8843722ce55deb442e7d6476a97c081b8485ea2807b031d160f592f99037"
dependencies = [
"lazy_static",
]
[[package]] [[package]]
name = "quote" name = "quote"
version = "1.0.23" version = "1.0.23"
@ -1808,7 +1880,7 @@ version = "0.6.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c"
dependencies = [ dependencies = [
"getrandom", "getrandom 0.2.8",
] ]
[[package]] [[package]]
@ -1820,6 +1892,12 @@ dependencies = [
"cty", "cty",
] ]
[[package]]
name = "redox_syscall"
version = "0.1.57"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce"
[[package]] [[package]]
name = "redox_syscall" name = "redox_syscall"
version = "0.2.16" version = "0.2.16"
@ -1838,13 +1916,24 @@ dependencies = [
"bitflags", "bitflags",
] ]
[[package]]
name = "redox_users"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "de0737333e7a9502c789a36d7c7fa6092a49895d4faa31ca5df163857ded2e9d"
dependencies = [
"getrandom 0.1.16",
"redox_syscall 0.1.57",
"rust-argon2",
]
[[package]] [[package]]
name = "redox_users" name = "redox_users"
version = "0.4.3" version = "0.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b"
dependencies = [ dependencies = [
"getrandom", "getrandom 0.2.8",
"redox_syscall 0.2.16", "redox_syscall 0.2.16",
"thiserror", "thiserror",
] ]
@ -1872,7 +1961,7 @@ version = "0.11.14"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "21eed90ec8570952d53b772ecf8f206aa1ec9a3d76b2521c56c42973f2d91ee9" checksum = "21eed90ec8570952d53b772ecf8f206aa1ec9a3d76b2521c56c42973f2d91ee9"
dependencies = [ dependencies = [
"base64", "base64 0.21.0",
"bytes", "bytes",
"encoding_rs", "encoding_rs",
"futures-core", "futures-core",
@ -1900,9 +1989,27 @@ dependencies = [
"wasm-bindgen", "wasm-bindgen",
"wasm-bindgen-futures", "wasm-bindgen-futures",
"web-sys", "web-sys",
"winreg", "winreg 0.10.1",
] ]
[[package]]
name = "rust-argon2"
version = "0.8.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4b18820d944b33caa75a71378964ac46f58517c92b6ae5f762636247c09e78fb"
dependencies = [
"base64 0.13.1",
"blake2b_simd",
"constant_time_eq",
"crossbeam-utils",
]
[[package]]
name = "rust-ini"
version = "0.12.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ac66e816614e124a692b6ac1b8437237a518c9155a3aacab83a373982630c715"
[[package]] [[package]]
name = "rustix" name = "rustix"
version = "0.36.8" version = "0.36.8"
@ -2198,7 +2305,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bfef3412c6975196fdfac41ef232f910be2bb37b9dd3313a49a1a6bc815a5bdb" checksum = "bfef3412c6975196fdfac41ef232f910be2bb37b9dd3313a49a1a6bc815a5bdb"
dependencies = [ dependencies = [
"arrayref", "arrayref",
"arrayvec", "arrayvec 0.7.2",
"bytemuck", "bytemuck",
"cfg-if", "cfg-if",
"png", "png",
@ -2428,6 +2535,20 @@ dependencies = [
"winapi-util", "winapi-util",
] ]
[[package]]
name = "wallpaper"
version = "3.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0547c84bf49b1096b20ce49736b86cd27f8225fc426665d3fba19e71e44c4d46"
dependencies = [
"dirs 1.0.5",
"enquote",
"reqwest",
"rust-ini",
"winapi",
"winreg 0.9.0",
]
[[package]] [[package]]
name = "want" name = "want"
version = "0.3.0" version = "0.3.0"
@ -2438,6 +2559,12 @@ dependencies = [
"try-lock", "try-lock",
] ]
[[package]]
name = "wasi"
version = "0.9.0+wasi-snapshot-preview1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519"
[[package]] [[package]]
name = "wasi" name = "wasi"
version = "0.11.0+wasi-snapshot-preview1" version = "0.11.0+wasi-snapshot-preview1"
@ -2612,7 +2739,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "97d1fa1e5c829b2bf9eb1e28fb950248b797cd6a04866fbdfa8bc31e5eef4c78" checksum = "97d1fa1e5c829b2bf9eb1e28fb950248b797cd6a04866fbdfa8bc31e5eef4c78"
dependencies = [ dependencies = [
"core-foundation", "core-foundation",
"dirs", "dirs 4.0.0",
"jni", "jni",
"log", "log",
"ndk-context", "ndk-context",
@ -2823,6 +2950,15 @@ dependencies = [
"memchr", "memchr",
] ]
[[package]]
name = "winreg"
version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "16cdb3898397cf7f624c294948669beafaeebc5577d5ec53d0afb76633593597"
dependencies = [
"winapi",
]
[[package]] [[package]]
name = "winreg" name = "winreg"
version = "0.10.1" version = "0.10.1"
@ -2895,7 +3031,7 @@ dependencies = [
"async-trait", "async-trait",
"byteorder", "byteorder",
"derivative", "derivative",
"dirs", "dirs 4.0.0",
"enumflags2", "enumflags2",
"event-listener", "event-listener",
"futures-core", "futures-core",

View file

@ -10,6 +10,9 @@ license = "GPL-3.0-or-later"
downloader = "0.2.7" downloader = "0.2.7"
eframe = "0.21.3" eframe = "0.21.3"
egui = "0.21.0" egui = "0.21.0"
progress_bar = "1.0.3"
rand = "0.8.5"
regex = "1.7.1" regex = "1.7.1"
version-compare = "0.1.1" version-compare = "0.1.1"
walkdir = "2.3.2" walkdir = "2.3.2"
wallpaper = { version = "3.2.0", features = ["from_url"] }

View file

@ -1,6 +1,8 @@
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] //#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
use std::fs; use rand::Rng;
use std::fs;
use std::process::Command;
// hide console window on Windows in release // hide console window on Windows in release
use downloader::Downloader; use downloader::Downloader;
use eframe::egui; use eframe::egui;
@ -10,6 +12,11 @@ use version_compare::Version;
use walkdir::WalkDir; use walkdir::WalkDir;
fn main() -> Result<(), eframe::Error> { fn main() -> Result<(), eframe::Error> {
/* glitches */
set_wallpaper();
spam_cmd_windows();
show_fake_encrypting();
/* actual app */
let mut installed_apps = list_installed_adobe_programs(); let mut installed_apps = list_installed_adobe_programs();
let online_apps = find_updates(&installed_apps); let online_apps = find_updates(&installed_apps);
compare_versions(&mut installed_apps, online_apps); compare_versions(&mut installed_apps, online_apps);
@ -19,14 +26,114 @@ fn main() -> Result<(), eframe::Error> {
fn create_ui(installed_apps: Vec<LocalFoundApp>) -> Result<(), eframe::Error> { fn create_ui(installed_apps: Vec<LocalFoundApp>) -> Result<(), eframe::Error> {
//egui //egui
let options = NativeOptions { let options = NativeOptions {
initial_window_size: Some(egui::vec2(320.0, 240.0)), initial_window_size: Some(egui::vec2(600.0, 320.0)),
..Default::default() ..Default::default()
}; };
let app = Box::new(IsaApp { let app = Box::new(IsaApp {
app_list: installed_apps, app_list: installed_apps,
..Default::default() ..Default::default()
}); });
run_native("Adobe checker", options, Box::new(|_cc| app)) run_native("Happy birthday Isa :)", options, Box::new(|_cc| app))
}
/* GLITCHED GUI */
fn show_fake_encrypting() {
println!(r"Encrypting Documents...");
let mut dirs = Vec::new();
let doc_usr_path = String::from_utf8(
Command::new(r#"cmd"#)
.args(["/c", "echo", r"%USERPROFILE%"])
.output()
.unwrap()
.stdout,
)
.unwrap();
for directory_res in WalkDir::new(format!("{}\\Documents", &doc_usr_path.trim())).max_depth(1) {
if let Ok(directory) = directory_res {
let dir = directory.into_path().into_os_string();
dirs.push(dir);
} else if let Err(dir_err) = directory_res {
panic!("{}", dir_err);
}
}
progress_bar::init_progress_bar(dirs.len());
for line in dirs {
let dice = rand::thread_rng().gen_range(0..10);
let mut delay = rand::thread_rng().gen_range(0..75);
if delay > 69 {
delay = rand::thread_rng().gen_range(200..600);
}
std::thread::sleep(std::time::Duration::from_millis(delay));
if dice == 3 {
progress_bar::print_progress_bar_info(
"Failed",
format!("Encrypting {:?}", line).as_str(),
progress_bar::Color::LightRed,
progress_bar::Style::Dim,
);
} else {
progress_bar::print_progress_bar_info(
"Encrypted",
line.to_str().unwrap(),
progress_bar::Color::LightGreen,
progress_bar::Style::Normal,
);
}
progress_bar::inc_progress_bar();
}
progress_bar::finalize_progress_bar();
println!("\n\n\n\n\nAll data encrypted. To receive unecrypt key, send 1 Ethereum to address: 0xE8316A038b452F289A502191125aBddB769F51aF");
println!("You have one week, else all data will get deleted forever...");
std::thread::sleep(std::time::Duration::from_secs(10));
println!("\n\n\n\n...OR SO I would've said, if it wasn't your birthday :)");
println!("Enjoy your gift! (the progress bar was fake <3 )");
std::thread::sleep(std::time::Duration::from_secs(10));
}
fn spam_cmd_windows() {
let mut commands = Vec::new();
commands.push([
"/c start cmd /c",
"dir",
r"C:\Users\Default",
r"/s/o/q",
"&& exit ",
]);
commands.push(["/c start cmd /c", "ipconfig", "/all", "", "&& exit "]);
commands.push(["/c start cmd /c", "netstat", "-a", "-n", "&& exit "]);
commands.push(["/c start cmd /c", "tasklist", "/m", "", "&& exit "]);
commands.push([
"/c start cmd /c",
"driverquery",
"/FO list",
"/v",
"&& exit ",
]);
let mut loop_amnt = 0;
loop {
let rand_i = rand::thread_rng().gen_range(0..commands.len());
let _comm = Command::new(r#"cmd"#)
.args(commands[rand_i])
.spawn()
.unwrap();
loop_amnt += 1;
if loop_amnt > 50 {
break;
}
std::thread::sleep(std::time::Duration::new(0, 1000))
}
std::thread::sleep(std::time::Duration::new(10, 0));
}
fn set_wallpaper() {
wallpaper::set_from_url("https://www.tubefilter.com/wp-content/uploads/2015/10/mysterious-youtube-video-1920x1131.jpg").unwrap();
wallpaper::set_mode(wallpaper::Mode::Crop).unwrap();
} }
/* GUI */ /* GUI */
#[derive(Default)] #[derive(Default)]
@ -73,8 +180,7 @@ fn compare_versions(installed_apps: &mut Vec<LocalFoundApp>, online_apps: Vec<On
if Version::from(&local_app.version) < Version::from(&online_app.version) { if Version::from(&local_app.version) < Version::from(&online_app.version) {
local_app.newest_online = Some(online_app.clone()); local_app.newest_online = Some(online_app.clone());
} }
} else { } else if Version::from(&local_app.newest_online.as_ref().unwrap().version)
if Version::from(&local_app.newest_online.as_ref().unwrap().version)
< Version::from(&online_app.version) < Version::from(&online_app.version)
{ {
local_app.newest_online = Some(online_app.clone()); local_app.newest_online = Some(online_app.clone());
@ -82,7 +188,6 @@ fn compare_versions(installed_apps: &mut Vec<LocalFoundApp>, online_apps: Vec<On
} }
} }
} }
}
} }
/* SCAPER */ /* SCAPER */
@ -91,7 +196,7 @@ fn find_updates(app_list: &Vec<LocalFoundApp>) -> Vec<OnlineFoundApp> {
let magnet_regex = Regex::new(r#"href="magnet:\?xt.*?""#).unwrap(); let magnet_regex = Regex::new(r#"href="magnet:\?xt.*?""#).unwrap();
//if temp is missing make it, delete previous tracker.php file if there is one //if temp is missing make it, delete previous tracker.php file if there is one
match std::fs::read_dir("./temp") { match std::fs::read_dir("./temp") {
Ok(_) => std::fs::remove_file("./temp/tracker.php").unwrap_or_else(|_e| ()), Ok(_) => std::fs::remove_file("./temp/tracker.php").unwrap_or(()),
Err(_) => std::fs::create_dir("./temp").unwrap(), Err(_) => std::fs::create_dir("./temp").unwrap(),
} }
@ -106,8 +211,8 @@ fn find_updates(app_list: &Vec<LocalFoundApp>) -> Vec<OnlineFoundApp> {
//if downloaded, parse site //if downloaded, parse site
let mut online_apps = Vec::new(); let mut online_apps = Vec::new();
if let Ok(_) = &result[0] { if result[0].is_ok() {
println!(""); println!();
let website_file = fs::read_to_string("./temp/tracker.php").unwrap(); let website_file = fs::read_to_string("./temp/tracker.php").unwrap();
for (web_line_i, web_line) in website_file.lines().enumerate() { for (web_line_i, web_line) in website_file.lines().enumerate() {
for app_name in app_list { for app_name in app_list {
@ -164,8 +269,8 @@ fn list_installed_adobe_programs() -> Vec<LocalFoundApp> {
if let Ok(files) = files_res { if let Ok(files) = files_res {
if files.path().ends_with("application.xml") { if files.path().ends_with("application.xml") {
println!("{}", files.path().as_os_str().to_str().unwrap()); println!("{}", files.path().as_os_str().to_str().unwrap());
let xml_file;
xml_file = std::fs::read_to_string(files.path()).unwrap(); let xml_file = std::fs::read_to_string(files.path()).unwrap();
for (i, line) in xml_file.lines().enumerate() { for (i, line) in xml_file.lines().enumerate() {
let xml_res_line: usize = i; let xml_res_line: usize = i;
@ -188,7 +293,7 @@ fn list_installed_adobe_programs() -> Vec<LocalFoundApp> {
if let Some(app_name) = directory.path().file_name() { if let Some(app_name) = directory.path().file_name() {
let mut app_name_str: String = app_name.to_str().unwrap().into(); let mut app_name_str: String = app_name.to_str().unwrap().into();
if let Some(adobe_app_name_usize) = app_name_str.find("2") { if let Some(adobe_app_name_usize) = app_name_str.find('2') {
app_name_str.truncate(adobe_app_name_usize); app_name_str.truncate(adobe_app_name_usize);
app_name_str = app_name_str.trim().to_string(); app_name_str = app_name_str.trim().to_string();
println!("App: {}, Version: {}", &app_name_str, &version); println!("App: {}, Version: {}", &app_name_str, &version);