Skip to content

Instantly share code, notes, and snippets.

@jeff-1amstudios
Created December 10, 2022 07:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeff-1amstudios/dfd75b57ff0608b058c001780c49fe68 to your computer and use it in GitHub Desktop.
Save jeff-1amstudios/dfd75b57ff0608b058c001780c49fe68 to your computer and use it in GitHub Desktop.
void CheckIfRunningOnServer() {
char* the_path; // edx
char* current_path; // ebp
char* time_string; // eax
FILE* f; // esi
int computer_name_buffer_len; // [esp+0h] [ebp-138h] BYREF
time_t the_clock; // [esp+8h] [ebp-130h] MAPDST BYREF
char* paths[6]; // [esp+Ch] [ebp-12Ch] BYREF
char computer_name[16]; // [esp+24h] [ebp-114h] BYREF
char current_directory[260]; // [esp+34h] [ebp-104h] BYREF
paths[0] = "H:\\";
paths[1] = "\\\\Beelzebub";
paths[2] = "V:\\";
paths[3] = "N:\\";
paths[4] = "\\Damien";
paths[5] = NULL;
computer_name_buffer_len = 16;
time(&the_time);
GetCurrentDirectoryA(257, current_directory);
the_path = paths;
while (the_path != NULL) {
if (strnicmp(current_directory, the_path, strlen(the_path)) == 0) {
if (GetComputerNameA(computer_name, &computer_name_buffer_len) == 0 || computer_name_buffer_len == 0) {
strcpy(computer_name, "UNKNOWN - lucky cunts");
}
f = fopen("\\\\Beelzebub\\Hades\\Carma2\\List_O_Cunts.TXT", "at");
if (f) {
time_string = ctime(&the_clock);
fprintf(f, "Who: %s When: %s", computer_name, time_string);
fflush(f);
fclose(f);
}
f = fopen("\\\\Beelzebub\\Hades\\Users\\Matt\\Cock_Heads.TXT", "at");
if (f) {
time_string = ctime(&the_clock);
fprintf(f, "Who: %s When: %s", computer_name, time_string);
fflush(f);
fclose(f);
}
dprintf("FATAL ERROR: %s", "Do NOT run Carmageddon from the server, you CUNT.");
dword_6B4B24 = 1;
sprintf(gLast_error_message, "%s\n%s", "Do NOT run Carmageddon from the server, you CUNT.", "null STR 2");
time(&the_clock);
f = fopen("Last_Error.TXT", "at");
if (f) {
time_string = ctime(&the_time);
fprintf(f, "When: %sError:\n%s\n---\n", time_string, gLast_error_message);
fflush(f);
fclose(f);
}
gExit_code = 700;
if (dword_754A00) {
v8 = *(void**)(dword_754A00 + 8);
if (v8)
RunShutdownHook();
}
if (gBrender_initialized) {
ShutdownBRender();
}
PDShutdownSystem();
}
the_path++;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment