Skip to content

Commit

Permalink
Merge branch 'main' into ancientpkg
Browse files Browse the repository at this point in the history
  • Loading branch information
a-random-lemurian committed Dec 17, 2023
2 parents 715976c + 0e30519 commit 72886e1
Show file tree
Hide file tree
Showing 7 changed files with 70 additions and 30 deletions.
5 changes: 3 additions & 2 deletions src/common/utils.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#include "utils.h"
#include <unistd.h>
#include <signal.h>

void msleep(int tms)
{
Expand Down Expand Up @@ -46,8 +48,7 @@ int chartoint(char *str, int numbase)

void trigger_segfault()
{
char *segfault = "segfault";
segfault[0] = 'S';
kill(getpid(), SIGSEGV);
}

void segfault_or_abort(int threshold)
Expand Down
2 changes: 1 addition & 1 deletion src/uselinux/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
add_executable(uselinux uselinuxcommon.c userspace.c main.c
deskenv.c yearoflinuxdesktop.c)
deskenv.c yearoflinuxdesktop.c hackerman.c)
add_executable(antisnap antisnap.c uselinuxcommon.c)
target_link_libraries(antisnap PUBLIC common argparse)
target_link_libraries(uselinux PUBLIC common argparse)
46 changes: 46 additions & 0 deletions src/uselinux/hackerman.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/**
* @file hackerman.c
* @author Lemuria
* @brief Hackerman mode.
* @date 2022-11-18
*
* @copyright MIT License
*
* Legal disclaimer: Does not actually hack UNATCO, Area 51, the Statue of
* Liberty, the Illuminati, or your local bank.
*/

#include "hackerman.h"
#include <common/utils.h>

static char* places_to_hack[] = {
"UNATCO", "AREA 51", "STATUE OF LIBERTY",
"ILLUMINATI", "BANKS"
};

void hackerman_mode()
{
printf("AUGMENTATIONS ACTIVATED\n");
printf("HACKING IN PROGRESS\n");

for (size_t i = 0; i < LEN(places_to_hack); i++)
{
printf("%s...", places_to_hack[i]);
msleep(randint(140, 280));
printf("HACKED\n");
}
}

void hackerman(char *distro)
{
if (!strcasecmp(distro, "kali"))
{
printf("Activating Hackerman mode....\n");
hackerman_mode();
}
else
{
printf("fatal: --hackerman requires Kali Linux (use -d kali)\n");
exit(1);
}
}
19 changes: 19 additions & 0 deletions src/uselinux/hackerman.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#ifndef HACKERMAN_H
#define HACKERMAN_H

/**
* @brief Activate Hackerman mode. Requires Kali Linux, a distribution that
* comes preinstalled with several tools for hacking.
*
* @param distro Distribution being used. Must be Kali Linux.
*/
void hackerman(char *distro);

/**
* @brief Perform all the operations normally performed during Hackerman
* mode, such as "hacking" NASA, Area 51 and in general displaying unrealistic
* hacking effects such as code that makes no sense.
*/
void hackerman_mode();

#endif /* HACKERMAN_H */
1 change: 1 addition & 0 deletions src/uselinux/main.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "deskenv.h"
#include "hackerman.h"
#include "uselinuxcommon.h"
#include "userspace.h"
#include "yearoflinuxdesktop.h"
Expand Down
19 changes: 0 additions & 19 deletions src/uselinux/uselinuxcommon.c
Original file line number Diff line number Diff line change
@@ -1,24 +1,5 @@
#include "uselinuxcommon.h"

/**
* @brief Activate Hackerman mode. Requires Kali Linux, a distribution that
* comes preinstalled with several tools for hacking.
*
* @param distro Distribution being used. Must be Kali Linux.
*/
void hackerman(char *distro)
{
if (!strcasecmp(distro, "kali"))
{
printf("Activating Hackerman mode....\n");
}
else
{
printf("fatal: --hackerman requires Kali Linux (use -d kali)\n");
exit(1);
}
}

/**
* @brief Bash an operating system, insulting it.
*
Expand Down
8 changes: 0 additions & 8 deletions src/uselinux/uselinuxcommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,6 @@
#define LINUX_KERNEL_FIRST_RELEASE 1991
#define ANALYTICAL_ENGINE_YEAR 1833

/**
* @brief Activate Hackerman mode. Requires Kali Linux, a distribution that
* comes preinstalled with several tools for hacking.
*
* @param distro Distribution being used. Must be Kali Linux.
*/
void hackerman(char *distro);

/**
* @brief Bash an operating system, insulting it.
*
Expand Down

0 comments on commit 72886e1

Please sign in to comment.