Compare commits
No commits in common. "c7ee48dfa6b1aae259af518a1fe3ef409039eca4" and "1f3e5316104f0376b5e09dab41e50e2b0fd18589" have entirely different histories.
c7ee48dfa6
...
1f3e531610
2
Makefile
2
Makefile
|
@ -5,7 +5,7 @@ INCLUDES=-Isrc/include/sdk/common -Isrc/include/sdk/public -Isrc/include/sdk/pm_
|
|||
CFLAGS=-Wall -Wextra -Wno-write-strings -m32 -fPIC $(INCLUDES)
|
||||
LDFLAGS=-lm
|
||||
|
||||
OBJS=obj/main.c.o obj/globals.c.o obj/cvars.c.o obj/hooks.c.o obj/detour.c.o obj/util.c.o obj/features/movement.c.o obj/features/esp.c.o obj/features/chams.c.o obj/features/aim.c.o obj/features/misc.c.o obj/game_detection.c.o
|
||||
OBJS=obj/main.c.o obj/globals.c.o obj/cvars.c.o obj/hooks.c.o obj/detour.c.o obj/util.c.o obj/features/movement.c.o obj/features/esp.c.o obj/features/chams.c.o obj/features/aim.c.o obj/features/misc.c.o
|
||||
BIN=libhlcheat.so
|
||||
|
||||
.PHONY: clean all inject
|
||||
|
|
|
@ -55,10 +55,6 @@ console variables than more customization at runtime.
|
|||
=bullet_tracers()= function inside [[https://git.deadzone.lol/Wizzard/goldsource-cheat/src/branch/main/src/features/misc.c][src/features/misc.c]]. See previous chams note.
|
||||
#+end_quote
|
||||
|
||||
#+begin_quote
|
||||
*Note:* You can disable the watermark with dz_watermark 0
|
||||
#+end_quote
|
||||
|
||||
* Building
|
||||
#+begin_src console
|
||||
$ git clone --recurse-submodules https://git.deadzone.lol/Wizzard/goldsource-cheat
|
||||
|
|
|
@ -1,68 +0,0 @@
|
|||
#include "include/game_detection.h"
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
static GameType current_game = GAME_UNKNOWN;
|
||||
|
||||
GameType get_current_game(void) {
|
||||
if (current_game != GAME_UNKNOWN) {
|
||||
return current_game;
|
||||
}
|
||||
|
||||
FILE *fp = fopen("/proc/self/cmdline", "r");
|
||||
if (fp) {
|
||||
char buf[1024];
|
||||
size_t size = fread(buf, sizeof(char), sizeof(buf) - 1, fp);
|
||||
fclose(fp);
|
||||
|
||||
if (size > 0) {
|
||||
buf[size] = '\0';
|
||||
|
||||
char *gameTypeToken = NULL;
|
||||
char *steamToken = NULL;
|
||||
|
||||
int tokensFound = 0;
|
||||
|
||||
for (char *token = buf; token < buf + size; token += strlen(token) + 1) {
|
||||
tokensFound++;
|
||||
|
||||
if (strcmp(token, "-game") == 0) {
|
||||
gameTypeToken = token + strlen(token) + 1;
|
||||
} else if (strcmp(token, "-steam") == 0) {
|
||||
steamToken = token;
|
||||
}
|
||||
}
|
||||
|
||||
if (gameTypeToken) {
|
||||
if (strcmp(gameTypeToken, "cstrike") == 0) {
|
||||
current_game = GAME_CS16;
|
||||
} else if (strcmp(gameTypeToken, "dod") == 0) {
|
||||
current_game = GAME_DAY_OF_DEFEAT;
|
||||
} else if (strcmp(gameTypeToken, "tfc") == 0) {
|
||||
current_game = GAME_TFC;
|
||||
}
|
||||
} else if (steamToken && tokensFound == 2) {
|
||||
// If only `-steam` is found and no `-game`, with only two tokens, assume it's Half-Life 1
|
||||
current_game = GAME_HALFLIFE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return current_game;
|
||||
}
|
||||
|
||||
int IsCS16(void) {
|
||||
return get_current_game() == GAME_CS16;
|
||||
}
|
||||
|
||||
int IsHalfLife(void) {
|
||||
return get_current_game() == GAME_HALFLIFE;
|
||||
}
|
||||
|
||||
int IsDayOfDefeat(void) {
|
||||
return get_current_game() == GAME_DAY_OF_DEFEAT;
|
||||
}
|
||||
|
||||
int IsTFC(void) {
|
||||
return get_current_game() == GAME_TFC;
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
#ifndef _GAME_DETECT_H_
|
||||
#define _GAME_DETECT_H_
|
||||
|
||||
typedef enum {
|
||||
GAME_UNKNOWN = 0,
|
||||
GAME_HALFLIFE,
|
||||
GAME_CS16,
|
||||
GAME_TFC,
|
||||
GAME_DAY_OF_DEFEAT
|
||||
} GameType;
|
||||
|
||||
GameType get_current_game(void);
|
||||
int IsCS16(void);
|
||||
int IsHalfLife(void);
|
||||
int IsDayOfDefeat(void);
|
||||
|
||||
#endif
|
28
src/main.c
28
src/main.c
|
@ -8,7 +8,6 @@
|
|||
#include "include/cvars.h"
|
||||
#include "include/hooks.h"
|
||||
#include "include/util.h"
|
||||
#include "include/game_detection.h"
|
||||
|
||||
static bool loaded = false;
|
||||
|
||||
|
@ -41,33 +40,6 @@ void load(void) {
|
|||
this_game_id = get_cur_game();
|
||||
|
||||
i_engine->pfnClientCmd("echo \"goldsource-cheat loaded successfully!\"");
|
||||
i_engine->pfnClientCmd("echo \"Deadzone rulez!\"");
|
||||
i_engine->pfnClientCmd("echo \"https://git.deadzone.lol/Wizzard/goldsource-cheat\"");
|
||||
|
||||
|
||||
GameType game = get_current_game();
|
||||
switch(game) {
|
||||
case GAME_HALFLIFE:
|
||||
i_engine->pfnClientCmd("echo \"Detected Game: Half-Life 1\"");
|
||||
break;
|
||||
case GAME_CS16:
|
||||
i_engine->pfnClientCmd("echo \"Detected Game: Counter-Strike 1.6\"");
|
||||
break;
|
||||
case GAME_DAY_OF_DEFEAT:
|
||||
i_engine->pfnClientCmd("echo \"Detected Game: Day of Defeat\"");
|
||||
break;
|
||||
case GAME_TFC:
|
||||
i_engine->pfnClientCmd("echo \"Detected Game: Team Fortress Classic\"");
|
||||
break;
|
||||
default:
|
||||
i_engine->pfnClientCmd("echo \"Detected Game: Unknown Game\"");
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
return;
|
||||
|
||||
|
||||
|
||||
loaded = true;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue