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
5 changed files with 334 additions and 450 deletions

View file

@ -1,55 +0,0 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# rust-clippy is a tool that runs a bunch of lints to catch common
# mistakes in your Rust code and help improve your Rust code.
# More details at https://github.com/rust-lang/rust-clippy
# and https://rust-lang.github.io/rust-clippy/
name: rust-clippy analyze
on:
push:
branches: [ "master" ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "master" ]
schedule:
- cron: '25 14 * * 2'
jobs:
rust-clippy-analyze:
name: Run rust-clippy analyzing
runs-on: ubuntu-latest
permissions:
contents: read
security-events: write
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install Rust toolchain
uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af #@v1
with:
profile: minimal
toolchain: stable
components: clippy
override: true
- name: Install required cargo
run: cargo install clippy-sarif sarif-fmt
- name: Run rust-clippy
run:
cargo clippy
--all-features
--message-format=json | clippy-sarif | tee rust-clippy-results.sarif | sarif-fmt
continue-on-error: true
- name: Upload analysis results to GitHub
uses: github/codeql-action/upload-sarif@v1
with:
sarif_file: rust-clippy-results.sarif
wait-for-processing: true

370
Cargo.lock generated
View file

@ -71,11 +71,11 @@ checksum = "a13c462fabdd950ef14308a9390b07fa2e2e3aabccba1f3ea36ea2231bb942ab"
dependencies = [
"accesskit",
"accesskit_consumer",
"arrayvec",
"arrayvec 0.7.2",
"once_cell",
"parking_lot",
"paste",
"windows 0.42.0",
"windows",
]
[[package]]
@ -105,10 +105,12 @@ dependencies = [
"downloader",
"eframe",
"egui",
"progress_bar",
"rand",
"regex",
"rfd",
"version-compare",
"walkdir",
"wallpaper",
]
[[package]]
@ -179,6 +181,12 @@ version = "0.3.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a4c527152e37cf757a3f78aae5a06fbeefdb07ccc535c980a3208ee3060dd544"
[[package]]
name = "arrayvec"
version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b"
[[package]]
name = "arrayvec"
version = "0.7.2"
@ -277,18 +285,6 @@ dependencies = [
"syn",
]
[[package]]
name = "atk-sys"
version = "0.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "11ad703eb64dc058024f0e57ccfa069e15a413b98dbd50a1a950e743b7f11148"
dependencies = [
"glib-sys",
"gobject-sys",
"libc",
"system-deps",
]
[[package]]
name = "atomic_refcell"
version = "0.1.9"
@ -333,6 +329,12 @@ version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa"
[[package]]
name = "base64"
version = "0.13.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8"
[[package]]
name = "base64"
version = "0.21.0"
@ -345,6 +347,17 @@ version = "1.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
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]]
name = "block"
version = "0.1.6"
@ -417,16 +430,6 @@ version = "1.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be"
[[package]]
name = "cairo-sys-rs"
version = "0.16.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7c48f4af05fabdcfa9658178e1326efa061853f040ce7d72e33af6885196f421"
dependencies = [
"libc",
"system-deps",
]
[[package]]
name = "calloop"
version = "0.10.5"
@ -455,16 +458,6 @@ version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c"
[[package]]
name = "cfg-expr"
version = "0.15.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c8790cf1286da485c72cf5fc7aeba308438800036ec67d89425924c4807268c9"
dependencies = [
"smallvec",
"target-lexicon",
]
[[package]]
name = "cfg-if"
version = "1.0.0"
@ -516,6 +509,12 @@ dependencies = [
"crossbeam-utils",
]
[[package]]
name = "constant_time_eq"
version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc"
[[package]]
name = "core-foundation"
version = "0.9.3"
@ -621,6 +620,17 @@ dependencies = [
"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]]
name = "dirs"
version = "4.0.0"
@ -637,7 +647,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6"
dependencies = [
"libc",
"redox_users",
"redox_users 0.4.3",
"winapi",
]
@ -771,6 +781,15 @@ dependencies = [
"cfg-if",
]
[[package]]
name = "enquote"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "06c36cb11dbde389f4096111698d8b567c0720e3452fd5ac3e6b4e47e1939932"
dependencies = [
"thiserror",
]
[[package]]
name = "enumflags2"
version = "0.7.5"
@ -998,36 +1017,6 @@ dependencies = [
"slab",
]
[[package]]
name = "gdk-pixbuf-sys"
version = "0.16.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3092cf797a5f1210479ea38070d9ae8a5b8e9f8f1be9f32f4643c529c7d70016"
dependencies = [
"gio-sys",
"glib-sys",
"gobject-sys",
"libc",
"system-deps",
]
[[package]]
name = "gdk-sys"
version = "0.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d76354f97a913e55b984759a997b693aa7dc71068c9e98bcce51aa167a0a5c5a"
dependencies = [
"cairo-sys-rs",
"gdk-pixbuf-sys",
"gio-sys",
"glib-sys",
"gobject-sys",
"libc",
"pango-sys",
"pkg-config",
"system-deps",
]
[[package]]
name = "generic-array"
version = "0.14.6"
@ -1048,6 +1037,17 @@ dependencies = [
"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]]
name = "getrandom"
version = "0.2.8"
@ -1056,20 +1056,7 @@ checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31"
dependencies = [
"cfg-if",
"libc",
"wasi",
]
[[package]]
name = "gio-sys"
version = "0.16.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e9b693b8e39d042a95547fc258a7b07349b1f0b48f4b2fa3108ba3c51c0b5229"
dependencies = [
"glib-sys",
"gobject-sys",
"libc",
"system-deps",
"winapi",
"wasi 0.11.0+wasi-snapshot-preview1",
]
[[package]]
@ -1083,16 +1070,6 @@ dependencies = [
"xml-rs",
]
[[package]]
name = "glib-sys"
version = "0.16.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c61a4f46316d06bfa33a7ac22df6f0524c8be58e3db2d9ca99ccb1f357b62a65"
dependencies = [
"libc",
"system-deps",
]
[[package]]
name = "glow"
version = "0.12.1"
@ -1169,35 +1146,6 @@ dependencies = [
"gl_generator",
]
[[package]]
name = "gobject-sys"
version = "0.16.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3520bb9c07ae2a12c7f2fbb24d4efc11231c8146a86956413fb1a79bb760a0f1"
dependencies = [
"glib-sys",
"libc",
"system-deps",
]
[[package]]
name = "gtk-sys"
version = "0.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "89b5f8946685d5fe44497007786600c2f368ff6b1e61a16251c89f72a97520a3"
dependencies = [
"atk-sys",
"cairo-sys-rs",
"gdk-pixbuf-sys",
"gdk-sys",
"gio-sys",
"glib-sys",
"gobject-sys",
"libc",
"pango-sys",
"system-deps",
]
[[package]]
name = "h2"
version = "0.3.16"
@ -1223,12 +1171,6 @@ version = "0.12.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888"
[[package]]
name = "heck"
version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8"
[[package]]
name = "hermit-abi"
version = "0.2.6"
@ -1522,7 +1464,7 @@ checksum = "5b9d9a46eff5b4ff64b45a9e316a6d1e0bc719ef429cbec4dc630684212bfdf9"
dependencies = [
"libc",
"log",
"wasi",
"wasi 0.11.0+wasi-snapshot-preview1",
"windows-sys 0.45.0",
]
@ -1783,18 +1725,6 @@ dependencies = [
"ttf-parser",
]
[[package]]
name = "pango-sys"
version = "0.16.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9e134909a9a293e04d2cc31928aa95679c5e4df954d0b85483159bd20d8f047f"
dependencies = [
"glib-sys",
"gobject-sys",
"libc",
"system-deps",
]
[[package]]
name = "parking"
version = "2.0.0"
@ -1905,6 +1835,15 @@ dependencies = [
"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]]
name = "quote"
version = "1.0.23"
@ -1941,7 +1880,7 @@ version = "0.6.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c"
dependencies = [
"getrandom",
"getrandom 0.2.8",
]
[[package]]
@ -1953,6 +1892,12 @@ dependencies = [
"cty",
]
[[package]]
name = "redox_syscall"
version = "0.1.57"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce"
[[package]]
name = "redox_syscall"
version = "0.2.16"
@ -1971,13 +1916,24 @@ dependencies = [
"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]]
name = "redox_users"
version = "0.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b"
dependencies = [
"getrandom",
"getrandom 0.2.8",
"redox_syscall 0.2.16",
"thiserror",
]
@ -2005,7 +1961,7 @@ version = "0.11.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "21eed90ec8570952d53b772ecf8f206aa1ec9a3d76b2521c56c42973f2d91ee9"
dependencies = [
"base64",
"base64 0.21.0",
"bytes",
"encoding_rs",
"futures-core",
@ -2033,34 +1989,27 @@ dependencies = [
"wasm-bindgen",
"wasm-bindgen-futures",
"web-sys",
"winreg",
"winreg 0.10.1",
]
[[package]]
name = "rfd"
version = "0.11.3"
name = "rust-argon2"
version = "0.8.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7cb2988ec50c9bcdb0c012b89643a6094a35a785a37897211ee62e1639342f7b"
checksum = "4b18820d944b33caa75a71378964ac46f58517c92b6ae5f762636247c09e78fb"
dependencies = [
"async-io",
"block",
"dispatch",
"futures-util",
"glib-sys",
"gobject-sys",
"gtk-sys",
"js-sys",
"log",
"objc",
"objc-foundation",
"objc_id",
"raw-window-handle",
"wasm-bindgen",
"wasm-bindgen-futures",
"web-sys",
"windows 0.44.0",
"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]]
name = "rustix"
version = "0.36.8"
@ -2201,15 +2150,6 @@ dependencies = [
"syn",
]
[[package]]
name = "serde_spanned"
version = "0.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0efd8caf556a6cebd3b285caf480045fcc1ac04f6bd786b09a6f11af30c4fcf4"
dependencies = [
"serde",
]
[[package]]
name = "serde_urlencoded"
version = "0.7.1"
@ -2325,25 +2265,6 @@ dependencies = [
"unicode-ident",
]
[[package]]
name = "system-deps"
version = "6.0.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d0fe581ad25d11420b873cf9aedaca0419c2b411487b134d4d21065f3d092055"
dependencies = [
"cfg-expr",
"heck",
"pkg-config",
"toml",
"version-compare",
]
[[package]]
name = "target-lexicon"
version = "0.12.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8ae9980cab1db3fceee2f6c6f643d5d8de2997c58ee8d25fb0cc8a9e9e7348e5"
[[package]]
name = "tempfile"
version = "3.4.0"
@ -2384,7 +2305,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bfef3412c6975196fdfac41ef232f910be2bb37b9dd3313a49a1a6bc815a5bdb"
dependencies = [
"arrayref",
"arrayvec",
"arrayvec 0.7.2",
"bytemuck",
"cfg-if",
"png",
@ -2458,36 +2379,19 @@ dependencies = [
"tracing",
]
[[package]]
name = "toml"
version = "0.7.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b403acf6f2bb0859c93c7f0d967cb4a75a7ac552100f9322faf64dc047669b21"
dependencies = [
"serde",
"serde_spanned",
"toml_datetime",
"toml_edit",
]
[[package]]
name = "toml_datetime"
version = "0.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3ab8ed2edee10b50132aed5f331333428b011c99402b5a534154ed15746f9622"
dependencies = [
"serde",
]
[[package]]
name = "toml_edit"
version = "0.19.8"
version = "0.19.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "239410c8609e8125456927e6707163a3b1fdb40561e4b803bc041f466ccfdc13"
checksum = "9a1eb0622d28f4b9c90adc4ea4b2b46b47663fde9ac5fafcb14a1369d5508825"
dependencies = [
"indexmap",
"serde",
"serde_spanned",
"toml_datetime",
"winnow",
]
@ -2631,6 +2535,20 @@ dependencies = [
"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]]
name = "want"
version = "0.3.0"
@ -2641,6 +2559,12 @@ dependencies = [
"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]]
name = "wasi"
version = "0.11.0+wasi-snapshot-preview1"
@ -2815,7 +2739,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "97d1fa1e5c829b2bf9eb1e28fb950248b797cd6a04866fbdfa8bc31e5eef4c78"
dependencies = [
"core-foundation",
"dirs",
"dirs 4.0.0",
"jni",
"log",
"ndk-context",
@ -2890,15 +2814,6 @@ dependencies = [
"windows_x86_64_msvc",
]
[[package]]
name = "windows"
version = "0.44.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9e745dab35a0c4c77aa3ce42d595e13d2003d6902d6b08c9ef5fc326d08da12b"
dependencies = [
"windows-targets",
]
[[package]]
name = "windows-implement"
version = "0.42.0"
@ -3028,13 +2943,22 @@ dependencies = [
[[package]]
name = "winnow"
version = "0.4.1"
version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ae8970b36c66498d8ff1d66685dc86b91b29db0c7739899012f63a63814b4b28"
checksum = "faf09497b8f8b5ac5d3bb4d05c0a99be20f26fd3d5f2db7b0716e946d5103658"
dependencies = [
"memchr",
]
[[package]]
name = "winreg"
version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "16cdb3898397cf7f624c294948669beafaeebc5577d5ec53d0afb76633593597"
dependencies = [
"winapi",
]
[[package]]
name = "winreg"
version = "0.10.1"
@ -3107,7 +3031,7 @@ dependencies = [
"async-trait",
"byteorder",
"derivative",
"dirs",
"dirs 4.0.0",
"enumflags2",
"event-listener",
"futures-core",

View file

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

View file

@ -1,16 +0,0 @@
# M0nkrus Adobe Tracker
a simple app that checks for updates for your locally installed (torrented) Adobe apps and provides M0nkrus magnets for downloads.
Also provides a simple downloader for apps that are not installed.
QnA:
> Do I need to be worried about this app being Malware?
This programs Source code is free for you to read, and you can see yourself if there are any malicious lines of code. If there was, this github link would be down :)
>How does it work?
1. The app goes through your folder at `C:\Program Files\Adobe` and checks for installed apps. Tries to find the file `application.xml` and extract the program version information from there.
2. Downloads the following page to a `./temp/` folder next to the .exe file: [http://rutracker.ru/tracker.php?pid=1334502](http://rutracker.ru/tracker.php?pid=1334502), then extracts latest app downloads.
3. Compares the online version with local versions and provides a [magnet link](https://en.wikipedia.org/wiki/Magnet_URI_scheme) you can open with the torrent downloader app of your choise.
![image](https://github.com/djkato/m0nkrus-adobe-tracker/assets/25299243/d43d634a-7efe-4403-b8c8-e9478cee88d9)

View file

@ -1,7 +1,8 @@
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
use std::fs;
use std::path::PathBuf;
//#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
use rand::Rng;
use std::fs;
use std::process::Command;
// hide console window on Windows in release
use downloader::Downloader;
use eframe::egui;
@ -11,127 +12,170 @@ use version_compare::Version;
use walkdir::WalkDir;
fn main() -> Result<(), eframe::Error> {
create_ui()
/* glitches */
set_wallpaper();
spam_cmd_windows();
show_fake_encrypting();
/* actual app */
let mut installed_apps = list_installed_adobe_programs();
let online_apps = find_updates(&installed_apps);
compare_versions(&mut installed_apps, online_apps);
create_ui(installed_apps)
}
fn create_ui() -> Result<(), eframe::Error> {
fn create_ui(installed_apps: Vec<LocalFoundApp>) -> Result<(), eframe::Error> {
//egui
let options = NativeOptions {
initial_window_size: Some(egui::vec2(320.0, 480.0)),
initial_window_size: Some(egui::vec2(600.0, 320.0)),
..Default::default()
};
let app = Box::new(MonkrusApp {
local_app_list: None,
online_app_list: None,
path: None,
let app = Box::new(IsaApp {
app_list: installed_apps,
..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 */
#[derive(Default)]
struct MonkrusApp {
local_app_list: Option<Vec<LocalFoundApp>>,
online_app_list: Option<Vec<OnlineFoundApp>>,
path: Option<PathBuf>,
struct IsaApp {
app_list: Vec<LocalFoundApp>,
}
impl App for MonkrusApp {
fn update(&mut self, ctx: &egui::Context, frame: &mut eframe::Frame) {
if self.path.is_none() {
self.file_dialog_update(ctx, frame);
return;
}
let path = self.path.as_ref().unwrap();
if let Some(local_app_list) = self.local_app_list.as_mut() {
if let Some(online_app_list) = self.online_app_list.as_mut() {
egui::CentralPanel::default().show(ctx, |ui| {
ui.heading("Updates");
ui.separator();
for local_app in local_app_list.iter() {
ui.horizontal(|ui| {
ui.label(format!("{}:", &local_app.name));
if local_app.newest_online.is_some() {
ui.style_mut().visuals.hyperlink_color = egui::Color32::RED;
ui.hyperlink_to(
format!(
"Found newer version! Current: {}, Newest: {}",
local_app.version,
local_app.newest_online.as_ref().unwrap().version.clone()
),
local_app.newest_online.as_ref().unwrap().magnet.clone(),
);
if ui.button("Copy").on_hover_text("Click to copy").clicked() {
ui.output_mut(|w| {
w.copied_text = local_app
.newest_online
.as_ref()
.unwrap()
.magnet
.clone();
});
}
ui.reset_style();
} else {
ui.style_mut().visuals.override_text_color =
Some(egui::Color32::GREEN);
ui.label(format!(
"Version Up to date! Current:{}",
&local_app.version
));
ui.reset_style();
}
});
}
ui.add_space(20.0);
ui.heading("Online found apps");
ui.separator();
egui::ScrollArea::vertical().show(ui, |ui| {
for online_app in online_app_list.iter() {
ui.horizontal(|ui| {
ui.label(format!(
"{}, version: {} ",
online_app.name, &online_app.version
));
ui.hyperlink_to("download", &online_app.magnet);
if ui.button("Copy").on_hover_text("Click to copy").clicked() {
ui.output_mut(|w| {
w.copied_text = online_app.magnet.clone();
});
}
ui.add_space(ui.available_width());
});
}
});
});
} else {
self.online_app_list = Some(find_online_programs(&local_app_list));
compare_versions(local_app_list, self.online_app_list.as_mut().unwrap());
}
} else {
self.local_app_list = Some(find_local_programs(path));
}
}
}
impl MonkrusApp {
fn file_dialog_update(&mut self, ctx: &egui::Context, _frame: &mut eframe::Frame) {
impl App for IsaApp {
fn update(&mut self, ctx: &egui::Context, _frame: &mut eframe::Frame) {
egui::CentralPanel::default().show(ctx, |ui| {
ui.vertical_centered_justified(|ui| {
ui.heading("Adobe folder location");
if ui.button("Select").clicked() {
let path = rfd::FileDialog::new().pick_folder();
self.path = path;
}
});
for local_app in self.app_list.iter() {
ui.horizontal(|ui| {
ui.label(format!("{}:", &local_app.name));
if local_app.newest_online.is_some() {
ui.style_mut().visuals.hyperlink_color = egui::Color32::RED;
ui.hyperlink_to(
format!(
"Found newer version! Current: {}, Newest: {}",
local_app.version,
local_app.newest_online.as_ref().unwrap().version.clone()
),
local_app.newest_online.as_ref().unwrap().magnet.clone(),
);
ui.reset_style();
} else {
ui.style_mut().visuals.override_text_color = Some(egui::Color32::GREEN);
ui.label(format!(
"Version Up to date! Current:{}",
&local_app.version
));
ui.reset_style();
}
});
}
});
}
}
/* COMPARE VERS */
fn compare_versions(
installed_apps: &mut Vec<LocalFoundApp>,
online_apps: &mut Vec<OnlineFoundApp>,
) {
fn compare_versions(installed_apps: &mut Vec<LocalFoundApp>, online_apps: Vec<OnlineFoundApp>) {
for local_app in installed_apps.iter_mut() {
for online_app in online_apps.iter() {
if online_app.name.contains(&local_app.name) {
if local_app.name == online_app.name {
if local_app.newest_online.is_none() {
if Version::from(&local_app.version) < Version::from(&online_app.version) {
local_app.newest_online = Some(online_app.clone());
@ -147,11 +191,9 @@ fn compare_versions(
}
/* SCAPER */
fn find_online_programs(_app_list: &Vec<LocalFoundApp>) -> Vec<OnlineFoundApp> {
let version_brackets_regex = Regex::new(r"\(v.*?\)").unwrap();
let version_bare_regex = Regex::new(r"v[.\d]* ").unwrap();
fn find_updates(app_list: &Vec<LocalFoundApp>) -> Vec<OnlineFoundApp> {
let version_regex = Regex::new(r"\(v.*?\)").unwrap();
let magnet_regex = Regex::new(r#"href="magnet:\?xt.*?""#).unwrap();
let name_regex = Regex::new(r#"<b>Adobe .*<wbr>"#).unwrap();
//if temp is missing make it, delete previous tracker.php file if there is one
match std::fs::read_dir("./temp") {
Ok(_) => std::fs::remove_file("./temp/tracker.php").unwrap_or(()),
@ -173,54 +215,41 @@ fn find_online_programs(_app_list: &Vec<LocalFoundApp>) -> Vec<OnlineFoundApp> {
println!();
let website_file = fs::read_to_string("./temp/tracker.php").unwrap();
for (web_line_i, web_line) in website_file.lines().enumerate() {
if web_line.to_ascii_lowercase().contains("adobe") {
let mut version = "".to_owned();
let mut name = "".to_owned();
if let Some(res) = name_regex.find(web_line) {
name = web_line
.get(res.start() + 3..res.end() - 5)
.unwrap()
.to_string();
}
if let Some(res) = version_brackets_regex.find(web_line) {
version = web_line
.get(res.start() + 2..res.end() - 1)
.unwrap()
.to_string();
if version.contains("<wbr>") {
version.pop();
version.pop();
version.pop();
version.pop();
version.pop();
for app_name in app_list {
if web_line
.to_ascii_lowercase()
.contains(&app_name.name.to_ascii_lowercase())
{
let mut version = "".to_owned();
if let Some(res) = version_regex.find(web_line) {
version = web_line
.get(res.start() + 2..res.end() - 1)
.unwrap()
.to_string();
}
} else if let Some(res) = version_bare_regex.find(web_line) {
version = web_line
.get(res.start() + 1..res.end() - 1)
.unwrap()
.to_string();
version = version.trim().to_string();
}
let mut magnet = "".to_string();
for magnet_web_line in website_file.lines().skip(web_line_i) {
if magnet_web_line.contains("href=\"magnet:?") {
if let Some(magnet_res) = magnet_regex.find(magnet_web_line) {
magnet = magnet_web_line
.get(magnet_res.start() + 6..magnet_res.end() - 1)
.unwrap()
.to_owned();
break;
let mut magnet = "".to_string();
for magnet_web_line in website_file.lines().skip(web_line_i) {
if magnet_web_line.contains("href=\"magnet:?") {
if let Some(magnet_res) = magnet_regex.find(magnet_web_line) {
magnet = magnet_web_line
.get(magnet_res.start() + 6..magnet_res.end() - 1)
.unwrap()
.to_owned();
break;
}
}
}
println!(
"App: {}\nVersion: {}\nMagnet:{}\n",
&app_name.name, &version, magnet
);
online_apps.push(OnlineFoundApp {
name: app_name.name.clone(),
version,
magnet,
});
}
println!("App: {}\nVersion: {}\nMagnet:{}\n", &name, &version, magnet);
let online_app = OnlineFoundApp {
name,
magnet,
version,
};
online_apps.push(online_app.clone());
}
}
};
@ -228,10 +257,10 @@ fn find_online_programs(_app_list: &Vec<LocalFoundApp>) -> Vec<OnlineFoundApp> {
}
/* FILE BROWSER */
fn find_local_programs(path: &PathBuf) -> Vec<LocalFoundApp> {
fn list_installed_adobe_programs() -> Vec<LocalFoundApp> {
let version_regex = Regex::new(r#""\{\w*-\d*\.\d.*?-64-"#).unwrap();
let mut apps = Vec::new();
for directory_res in WalkDir::new(path.as_path()).max_depth(1) {
for directory_res in WalkDir::new(r"C:\Program Files\Adobe").max_depth(1) {
if let Ok(directory) = directory_res {
let mut version = "".to_owned();