From d620fbb88ea8767e2ea586e3ff57fd9e20ddc7ec Mon Sep 17 00:00:00 2001 From: "@syxhe" Date: Sun, 21 Jul 2024 21:46:49 -0500 Subject: Making progress --- .gitignore | 3 +- src/screen.c | 107 +++++++++++++++++++++++++++++++++++++++++++++-------------- src/screen.h | 44 +++++++++++++++++++++++- 3 files changed, 127 insertions(+), 27 deletions(-) diff --git a/.gitignore b/.gitignore index 6fe730e..8fd19f6 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,5 @@ encrypt screen search main -*.o \ No newline at end of file +*.o +a.out \ No newline at end of file diff --git a/src/screen.c b/src/screen.c index d79ec3c..b9e0b11 100644 --- a/src/screen.c +++ b/src/screen.c @@ -7,27 +7,6 @@ * Example window layout -Random Phrases list: - > WE CLOWN IN THIS MF, TAKE YO SENSITIVE ASS BACK TO @GENTOOMEMES - > R.I.P VxHeaven - > tmp(2) nuked by Smelly - > 99% of Randomware Operators quit before compromising a bank - > Equation Group wuz here - > Lazarus wuz here - > LockBit wuz here - > Sponsored by Equation Group - > Sponsored by Lazarus - > Sponsored by LockBit - > Free my boy Ross Ulbricht he did nothing wrong - > Stay off the dark web, kids - > FREE BITCOIN JUST 3 SPINS AWAY - > We all glow in the dark - > Shoutouts to Simpleflips - > Shoutouts to BugHunter - > Shoutouts to EyeDeeKay - > :beecat: - > :3 - ======================================================== (Window 1) (One line long, top of screen) VX-GAMBLEGROUND: ======================================================== (End Window 1) (Takes up space between top & bottom windows) @@ -54,7 +33,50 @@ SLOTS HERE #include #include -#define STATIC_ARRSIZE(arr) (sizeof((arr)) / sizeof((arr)[0])) +static const char *phrases[] = { + // 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", + "99% of Randomware Operators quit before compromising a bank", + "Equation Group wuz here", + "Lazarus wuz here", + "LockBit wuz here", + "Sponsored by Equation Group", + "Sponsored by Lazarus", + "Sponsored by LockBit", + "Free my boy Ross Ulbricht he did nothing wrong", + "Stay off the dark web, kids", + "FREE BITCOIN JUST 3 SPINS AWAY", + "We all glow in the dark", + "Shoutouts to Simpleflips", + "Shoutouts to BugHunter", + "Shoutouts to EyeDeeKay", + ":beecat:", + ":3", + "You think Jack Rhysider will interview me now?", + "Check out \"Darknet Diaries\"", + + // by @danielsprofile on telegram + "Daniel Spears loves femboys", + "LizardSquad > Razer", + "Sponsored by Major League Gaming", + "Sponsored by LemonParty.org", + "Sponsored by FTX", + "RIP Harambe", + "Shoutout Elliot Alderson", + "Ted Kaczynski was right", + "The FBI watches me jerk off to MILFs lol", + "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", + + NULL +}; static const char *menu_choices[] = { "Spin", @@ -63,6 +85,19 @@ static const char *menu_choices[] = { NULL }; +static float normalize(float value, float oldmin, float oldmax, float newmin, float newmax) { + // x(normal) = (b - a) * ((x - x(min)) / (max x - min x)) + a, where [a, b] is the new range + return (newmax - newmin) * ((value - oldmin) / (oldmax - oldmin)) + newmin; +} + +static int init_rgb_color(int colornum, int red, int green, int blue) { + int nred = normalize(red, RGB_MIN, RGB_MAX, CURSESCOLOR_MIN, CURSESCOLOR_MAX); + int ngreen = normalize(green, RGB_MIN, RGB_MAX, CURSESCOLOR_MIN, CURSESCOLOR_MAX); + int nblue = normalize(blue, RGB_MIN, RGB_MAX, CURSESCOLOR_MIN, CURSESCOLOR_MAX); + + return init_color(colornum, nred, ngreen, nblue); +} + int main() { if(setlocale(LC_ALL, "") == NULL) // Clear out the locale so it doesn't default to ncurses' ISO-8859-1 setting error(1, errno, "Could not set proper locale"); @@ -70,12 +105,21 @@ int main() { if(initscr() == NULL) // Initialize curses error(1, errno, "Could not init standard screen"); - if(has_colors()) { // Init colors if available & create color pairings + if(has_colors() && can_change_color()) { // Init colors if available & create color pairings start_color(); // Init colors here - - //init_color(); + // TODO: FIGURE OUT WHY COLORS ARE SO FUCKEY + init_rgb_color(CC_RED, 255, 0, 0); + init_rgb_color(CC_ORANGE, 255, 128, 0); + init_rgb_color(CC_YELLOW, 255, 255, 0); + init_rgb_color(CC_GREEN, 0, 255, 0); + init_rgb_color(CC_BLUE, 0, 0, 255); + init_rgb_color(CC_PURPLE, 255, 0, 255); + init_rgb_color(CC_WHITE, 255, 255, 255); + + init_pair(1, CC_WHITE, CURSES_BLUE); + } cbreak(); // Disables character buffering @@ -130,7 +174,20 @@ int main() { free_menu(menu); //*/ + // Making this a subwindow of stdscr might be a good idea (maybe) + int height = 1; + int width = col; + int starty = 0; /* Calculating for a center placement */ + int startx = 0; /* of the window */ + + WINDOW *phrase = NULL; + phrase = newwin(height, width, starty, startx); + wbkgd(phrase, COLOR_PAIR(1)); + mvwaddstr(phrase, 0, 1, "VX-GAMBLEGROUND: "); + waddstr(phrase, phrases[1]); + wrefresh(phrase); + wgetch(phrase); endwin(); // Clean up curses return 0; diff --git a/src/screen.h b/src/screen.h index 7795336..a4ecf5a 100644 --- a/src/screen.h +++ b/src/screen.h @@ -1,6 +1,48 @@ #ifndef __SLOTS__SCREEN_H__184802466018249 #define __SLOTS__SCREEN_H__184802466018249 -// +#include + +#define STATIC_ARRSIZE(arr) (sizeof((arr)) / sizeof((arr)[0])) + +#define RGB_MIN 0 +#define RGB_MAX 255 +#define CURSESCOLOR_MIN 0 +#define CURSESCOLOR_MAX 1000 + +enum custom_colors { + // Unspecified color + CC_UNSPEC = -1, + + /* The standard curses colors are defined here as to prevent custom colors from reusing pre-existing + // colors, in case the defaults are to be used */ + + CURSES_BLACK = COLOR_BLACK, // ncurses' default black + CURSES_RED = COLOR_RED, // ncurses' default red + CURSES_GREEN = COLOR_GREEN, // ncurses' default green + CURSES_YELLOW = COLOR_YELLOW, // ncurses' default yellow + CURSES_BLUE = COLOR_BLUE, // ncurses' default blue + CURSES_MAGENTA = COLOR_MAGENTA, // ncurses' default magenta + CURSES_CYAN = COLOR_CYAN, // ncurses' default cyan + CURSES_WHITE = COLOR_WHITE, // ncurses' default white + + CC_RED, + CC_ORANGE, + CC_YELLOW, + CC_GREEN, + CC_BLUE, + CC_PURPLE, + CC_MAGENTA, + CC_WHITE, + + // This isn't actually a color, even if you try to use it as one + CC_TOOBIG +}; + +// Converts value from within the range of [oldmin, oldmax] to a value within the range [newmin, newmax] +static float normalize(float value, float oldmin, float oldmax, float newmin, float newmax); + +// Initialize a new curses color using standard rgb values (0-255) instead of curses' 0-1000 range +static int init_rgb_color(int colornum, int red, int green, int blue); #endif \ No newline at end of file -- cgit v1.2.3