Several fixes for various compile options
This commit is contained in:
parent
c9c0eb9392
commit
c002344993
@ -20,6 +20,10 @@ set(EnableTextmodeStdin 0 CACHE BOOL "Textmode Stdin -> Console bridge (EXPERIME
|
||||
set(EnableWarnings 1 CACHE BOOL "Enable compile warnings")
|
||||
set(EnableNullGraphics 0 CACHE BOOL "Enable experimental textmode hooks (CRASHES)")
|
||||
|
||||
if(NOT EnableVisuals)
|
||||
set(EnableGUI 0)
|
||||
endif()
|
||||
|
||||
find_package(Git REQUIRED)
|
||||
find_package(OpenSSL REQUIRED)
|
||||
|
||||
@ -49,10 +53,12 @@ endif()
|
||||
|
||||
if(EnableVisuals)
|
||||
find_package(glez REQUIRED)
|
||||
get_target_property(glez_INCLUDE_DIRS glez INTERFACE_INCLUDE_DIRECTORIES)
|
||||
find_package(SDL2 REQUIRED)
|
||||
find_package(GLEW REQUIRED)
|
||||
if(ExternalDrawing)
|
||||
find_package(xoverlay REQUIRED)
|
||||
get_target_property(xoverlay_INCLUDE_DIRS xoverlay INTERFACE_INCLUDE_DIRECTORIES)
|
||||
target_include_directories(cathook PRIVATE
|
||||
"${xoverlay_INCLUDE_DIRS}")
|
||||
target_link_libraries(cathook xoverlay)
|
||||
|
@ -14,7 +14,6 @@ target_sources(cathook PRIVATE
|
||||
"${CMAKE_CURRENT_LIST_DIR}/entitycache.hpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/entityhitboxcache.hpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/enums.hpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/fidgetspinner.hpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/gameinfo.hpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/globals.h"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/hack.hpp"
|
||||
|
@ -16,7 +16,6 @@ target_sources(cathook PRIVATE
|
||||
"${CMAKE_CURRENT_LIST_DIR}/AutoTaunt.hpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/Bunnyhop.hpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/CatBot.hpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/ESP.hpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/FollowBot.hpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/hacklist.hpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/HealArrows.hpp"
|
||||
@ -25,14 +24,19 @@ target_sources(cathook PRIVATE
|
||||
"${CMAKE_CURRENT_LIST_DIR}/LagExploit.hpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/Misc.hpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/Noisemaker.hpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/Radar.hpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/SkinChanger.hpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/Spam.hpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/SpyAlert.hpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/Trigger.hpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/UberSpam.hpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/Walkbot.hpp")
|
||||
|
||||
if(EnableVisuals)
|
||||
target_sources(cathook PRIVATE
|
||||
"${CMAKE_CURRENT_LIST_DIR}/ESP.hpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/Radar.hpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/SkinChanger.hpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/SpyAlert.hpp")
|
||||
endif()
|
||||
|
||||
target_include_directories(cathook PRIVATE "${CMAKE_CURRENT_LIST_DIR}")
|
||||
|
||||
add_subdirectory(ac)
|
@ -1,7 +1,11 @@
|
||||
target_sources(cathook PRIVATE
|
||||
"${CMAKE_CURRENT_LIST_DIR}/CreateMove.hpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/hookedmethods.hpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/others.hpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/PaintTraverse.hpp")
|
||||
"${CMAKE_CURRENT_LIST_DIR}/others.hpp")
|
||||
|
||||
if(EnableVisuals)
|
||||
target_sources(cathook PRIVATE
|
||||
"${CMAKE_CURRENT_LIST_DIR}/PaintTraverse.hpp")
|
||||
endif()
|
||||
|
||||
target_include_directories(cathook PRIVATE "${CMAKE_CURRENT_LIST_DIR}")
|
@ -49,6 +49,7 @@ CUserCmd *GetUserCmd_hook(IInput *, int);
|
||||
void DrawModelExecute_hook(IVModelRender *_this, const DrawModelState_t &state,
|
||||
const ModelRenderInfo_t &info, matrix3x4_t *matrix);
|
||||
|
||||
#if ENABLE_VISUALS
|
||||
void Paint_hook(IEngineVGui *_this, PaintMode_t mode);
|
||||
|
||||
/* SDL HOOKS */
|
||||
@ -65,6 +66,7 @@ void SDL_GL_SwapWindow_hook(SDL_Window *window);
|
||||
|
||||
void DoSDLHooking();
|
||||
void DoSDLUnhooking();
|
||||
#endif
|
||||
|
||||
#include "CreateMove.hpp"
|
||||
#include "PaintTraverse.hpp"
|
||||
|
@ -6,8 +6,7 @@ target_sources(cathook PRIVATE
|
||||
"${CMAKE_CURRENT_LIST_DIR}/drawmgr.hpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/EffectChams.hpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/EffectGlow.hpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/glez.h"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/xoverlay.h")
|
||||
"${CMAKE_CURRENT_LIST_DIR}/fidgetspinner.hpp")
|
||||
|
||||
if(EnableGUI)
|
||||
add_subdirectory(menu)
|
||||
|
@ -10,8 +10,10 @@
|
||||
#include <thread>
|
||||
|
||||
extern "C" {
|
||||
#include "visual/glez.h"
|
||||
#include "visual/xoverlay.h"
|
||||
#include <glez.h>
|
||||
#if EXTERNAL_DRAWING
|
||||
#include <xoverlay.h>
|
||||
#endif
|
||||
}
|
||||
|
||||
#define draw_api drawex::api
|
||||
|
@ -1,108 +0,0 @@
|
||||
/*
|
||||
* glez.h
|
||||
*
|
||||
* Created on: Dec 7, 2017
|
||||
* Author: nullifiedcat
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
/* Types */
|
||||
|
||||
typedef struct glez_vec4_s
|
||||
{
|
||||
union {
|
||||
float data[4];
|
||||
struct
|
||||
{
|
||||
float r;
|
||||
float g;
|
||||
float b;
|
||||
float a;
|
||||
};
|
||||
struct
|
||||
{
|
||||
float x;
|
||||
float y;
|
||||
float z;
|
||||
float w;
|
||||
};
|
||||
};
|
||||
} glez_vec4_t, glez_rgba_t;
|
||||
|
||||
typedef unsigned int glez_texture_t;
|
||||
typedef unsigned int glez_font_t;
|
||||
|
||||
/* State functions */
|
||||
|
||||
void glez_init(int width, int height);
|
||||
|
||||
void glez_shutdown();
|
||||
|
||||
void glez_begin();
|
||||
|
||||
void glez_end();
|
||||
|
||||
void glez_resize(int width, int height);
|
||||
|
||||
/* Helper functions */
|
||||
|
||||
static inline glez_rgba_t glez_rgba(unsigned char r, unsigned char g,
|
||||
unsigned char b, unsigned char a)
|
||||
{
|
||||
glez_rgba_t result;
|
||||
result.r = (float) r / 255.0f;
|
||||
result.g = (float) g / 255.0f;
|
||||
result.b = (float) b / 255.0f;
|
||||
result.a = (float) a / 255.0f;
|
||||
return result;
|
||||
}
|
||||
|
||||
/* Font-related functions */
|
||||
|
||||
#define GLEZ_FONT_COUNT 64
|
||||
#define GLEZ_FONT_INVALID ((glez_font_t) 0xFFFFFFFF)
|
||||
|
||||
glez_font_t glez_font_load(const char *path, float size);
|
||||
|
||||
void glez_font_unload(glez_font_t handle);
|
||||
|
||||
void glez_font_string_size(glez_font_t font, const char *string, float *out_x,
|
||||
float *out_y);
|
||||
|
||||
/* Texture-related functions */
|
||||
|
||||
#define GLEZ_TEXTURE_COUNT 64
|
||||
#define GLEZ_TEXTURE_INVALID ((glez_texture_t) 0xFFFFFFFF)
|
||||
|
||||
glez_texture_t glez_texture_load_png_rgba(const char *path);
|
||||
|
||||
void glez_texture_unload(glez_texture_t handle);
|
||||
|
||||
void glez_texture_size(glez_texture_t handle, int *width, int *height);
|
||||
|
||||
/* Drawing functions */
|
||||
|
||||
void glez_line(float x, float y, float dx, float dy, glez_rgba_t color,
|
||||
float thickness);
|
||||
|
||||
void glez_rect(float x, float y, float w, float h, glez_rgba_t color);
|
||||
|
||||
void glez_rect_outline(float x, float y, float w, float h, glez_rgba_t color,
|
||||
float thickness);
|
||||
|
||||
void glez_rect_textured(float x, float y, float w, float h, glez_rgba_t color,
|
||||
glez_texture_t texture, float tx, float ty, float tw,
|
||||
float th, float angle);
|
||||
|
||||
void glez_string(float x, float y, const char *string, glez_font_t font,
|
||||
glez_rgba_t color, float *out_x, float *out_y);
|
||||
|
||||
void glez_string_with_outline(float x, float y, const char *string,
|
||||
glez_font_t font, glez_rgba_t color,
|
||||
glez_rgba_t outline_color, float outline_width,
|
||||
int adjust_outline_alpha, float *out_x,
|
||||
float *out_y);
|
||||
|
||||
void glez_circle(float x, float y, float radius, glez_rgba_t color,
|
||||
float thickness, int steps);
|
@ -1,48 +0,0 @@
|
||||
/*
|
||||
* overlay.hpp
|
||||
*
|
||||
* Created on: Nov 8, 2017
|
||||
* Author: nullifiedcat
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/XKBlib.h>
|
||||
|
||||
struct xoverlay_library
|
||||
{
|
||||
Display *display;
|
||||
Window window;
|
||||
Colormap colormap;
|
||||
GC gc;
|
||||
XGCValues gcvalues;
|
||||
XFontStruct font;
|
||||
int screen;
|
||||
|
||||
int width;
|
||||
int height;
|
||||
|
||||
struct
|
||||
{
|
||||
int x;
|
||||
int y;
|
||||
} mouse;
|
||||
|
||||
char init;
|
||||
char drawing;
|
||||
char mapped;
|
||||
};
|
||||
|
||||
extern struct xoverlay_library xoverlay_library;
|
||||
|
||||
int xoverlay_init();
|
||||
void xoverlay_destroy();
|
||||
|
||||
void xoverlay_show();
|
||||
|
||||
void xoverlay_hide();
|
||||
|
||||
void xoverlay_draw_begin();
|
||||
|
||||
void xoverlay_draw_end();
|
@ -9,7 +9,6 @@ target_sources(cathook PRIVATE
|
||||
"${CMAKE_CURRENT_LIST_DIR}/entitycache.cpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/entityhitboxcache.cpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/entry.cpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/fidgetspinner.cpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/globals.cpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/hack.cpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/headshake.cpp"
|
||||
|
@ -367,13 +367,13 @@ free(logname);*/
|
||||
hooks::modelrender.HookMethod((void *) DrawModelExecute_hook,
|
||||
offsets::DrawModelExecute());
|
||||
hooks::modelrender.Apply();
|
||||
#endif
|
||||
#endif
|
||||
hooks::enginevgui.Set(g_IEngineVGui);
|
||||
hooks::enginevgui.HookMethod(
|
||||
(void *) Paint_hook,
|
||||
offsets::PlatformOffset(14, offsets::undefined, offsets::undefined));
|
||||
hooks::enginevgui.Apply();
|
||||
#endif
|
||||
#endif
|
||||
hooks::steamfriends.Set(g_ISteamFriends);
|
||||
hooks::steamfriends.HookMethod((void *) GetFriendPersonaName_hook,
|
||||
offsets::GetFriendPersonaName());
|
||||
@ -469,7 +469,9 @@ void hack::Shutdown()
|
||||
return;
|
||||
hack::shutdown = true;
|
||||
playerlist::Save();
|
||||
#if ENABLE_VISUALS
|
||||
DoSDLUnhooking();
|
||||
#endif
|
||||
logging::Info("Unregistering convars..");
|
||||
ConVar_Unregister();
|
||||
logging::Info("Shutting down killsay...");
|
||||
|
@ -17,7 +17,6 @@ target_sources(cathook PRIVATE
|
||||
"${CMAKE_CURRENT_LIST_DIR}/AutoTaunt.cpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/Bunnyhop.cpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/CatBot.cpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/ESP.cpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/FollowBot.cpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/HealArrows.cpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/KillSay.cpp"
|
||||
@ -25,12 +24,17 @@ target_sources(cathook PRIVATE
|
||||
"${CMAKE_CURRENT_LIST_DIR}/LagExploit.cpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/Misc.cpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/Noisemaker.cpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/Radar.cpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/SkinChanger.cpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/Spam.cpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/SpyAlert.cpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/Trigger.cpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/UberSpam.cpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/Walkbot.cpp")
|
||||
|
||||
if(EnableVisuals)
|
||||
target_sources(cathook PRIVATE
|
||||
"${CMAKE_CURRENT_LIST_DIR}/ESP.cpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/Radar.cpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/SkinChanger.cpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/SpyAlert.cpp")
|
||||
endif()
|
||||
|
||||
add_subdirectory(ac)
|
@ -1,7 +1,11 @@
|
||||
target_sources(cathook PRIVATE
|
||||
"${CMAKE_CURRENT_LIST_DIR}/CreateMove.cpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/nographics.cpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/others.cpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/Paint.cpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/PaintTraverse.cpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/sdl.cpp")
|
||||
"${CMAKE_CURRENT_LIST_DIR}/others.cpp")
|
||||
|
||||
if(EnableVisuals)
|
||||
target_sources(cathook PRIVATE
|
||||
"${CMAKE_CURRENT_LIST_DIR}/Paint.cpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/PaintTraverse.cpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/sdl.cpp")
|
||||
endif()
|
@ -6,7 +6,10 @@
|
||||
*/
|
||||
|
||||
#include "common.hpp"
|
||||
|
||||
#if ENABLE_GUI
|
||||
#include "GUI.h"
|
||||
#endif
|
||||
|
||||
CatVar clean_screenshots(CV_SWITCH, "clean_screenshots", "1",
|
||||
"Clean screenshots",
|
||||
@ -159,7 +162,9 @@ void PaintTraverse_hook(void *_this, unsigned int vp, bool fr, bool ar)
|
||||
|
||||
if (clean_screenshots && g_IEngine->IsTakingScreenshot())
|
||||
return;
|
||||
#if ENABLE_GUI
|
||||
g_pGUI->Update();
|
||||
#endif
|
||||
PROF_SECTION(PT_active);
|
||||
draw::UpdateWTS();
|
||||
}
|
||||
|
@ -5,7 +5,8 @@ target_sources(cathook PRIVATE
|
||||
"${CMAKE_CURRENT_LIST_DIR}/drawing.cpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/drawmgr.cpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/EffectChams.cpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/EffectGlow.cpp")
|
||||
"${CMAKE_CURRENT_LIST_DIR}/EffectGlow.cpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/fidgetspinner.cpp")
|
||||
|
||||
if(EnableGUI)
|
||||
add_subdirectory(menu)
|
||||
|
@ -13,11 +13,11 @@
|
||||
#include <GL/glew.h>
|
||||
#include <GL/gl.h>
|
||||
|
||||
#if EXTERNAL_DRAWING
|
||||
extern "C" {
|
||||
#include "visual/xoverlay.h"
|
||||
#include <xoverlay.h>
|
||||
}
|
||||
|
||||
#define DRAW_XOVERLAY 0
|
||||
#endif
|
||||
|
||||
SDL_GLContext context = nullptr;
|
||||
|
||||
@ -62,7 +62,7 @@ bool ready()
|
||||
|
||||
void initialize()
|
||||
{
|
||||
#if DRAW_XOVERLAY
|
||||
#if EXTERNAL_DRAWING
|
||||
int status = xoverlay_init();
|
||||
xoverlay_draw_begin();
|
||||
glez_init(xoverlay_library.width, xoverlay_library.height);
|
||||
@ -156,7 +156,7 @@ void get_string_size(const char *string, font_handle_t &font, float *x,
|
||||
void draw_begin()
|
||||
{
|
||||
PROF_SECTION(DRAWEX_draw_begin);
|
||||
#if DRAW_XOVERLAY
|
||||
#if EXTERNAL_DRAWING
|
||||
xoverlay_draw_begin();
|
||||
#else
|
||||
SDL_GL_MakeCurrent(sdl_current_window, context);
|
||||
@ -169,7 +169,7 @@ void draw_end()
|
||||
PROF_SECTION(DRAWEX_draw_end);
|
||||
glez_end();
|
||||
SDL_GL_MakeCurrent(sdl_current_window, nullptr);
|
||||
#if DRAW_XOVERLAY
|
||||
#if EXTERNAL_DRAWING
|
||||
xoverlay_draw_end();
|
||||
#endif
|
||||
}
|
||||
|
@ -5,7 +5,7 @@
|
||||
* Author: nullifiedcat
|
||||
*/
|
||||
|
||||
#include "fidgetspinner.hpp"
|
||||
#include "visual/fidgetspinner.hpp"
|
||||
#include "common.hpp"
|
||||
|
||||
#include <math.h>
|
Reference in New Issue
Block a user