Merge pull request #390 from thinkingmaster/master

[WIP] CMake building system + lib/ update
This commit is contained in:
BenCat07 2018-04-28 19:44:42 +02:00 committed by GitHub
commit ada1ae21ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
271 changed files with 871 additions and 31851 deletions

7
.gitignore vendored
View File

@ -266,3 +266,10 @@ CTestTestfile.cmake
Data Folder Data Folder
/core /core
.vscode/settings.json .vscode/settings.json
.idea
cmake-build-debug
libcathook.so
build
# idk where it comes from
cathook.cbp

9
.gitmodules vendored
View File

@ -1,18 +1,9 @@
[submodule "source-sdk-2013"] [submodule "source-sdk-2013"]
path = source-sdk-2013 path = source-sdk-2013
url = https://github.com/ValveSoftware/source-sdk-2013 url = https://github.com/ValveSoftware/source-sdk-2013
[submodule "simple-ipc"]
path = simple-ipc
url = https://github.com/nullifiedcat/simple-ipc
[submodule "ucccccp"] [submodule "ucccccp"]
path = ucccccp path = ucccccp
url = https://github.com/nullifiedcat/ucccccp url = https://github.com/nullifiedcat/ucccccp
[submodule "libxoverlay"]
path = libxoverlay
url = https://github.com/nullifiedcat/libxoverlay
[submodule "libglez"]
path = libglez
url = https://github.com/BenCat07/libglez
[submodule "source-sdk-2013-headers"] [submodule "source-sdk-2013-headers"]
path = source-sdk-2013-headers path = source-sdk-2013-headers
url = https://github.com/nullifiedcat/source-sdk-2013-headers url = https://github.com/nullifiedcat/source-sdk-2013-headers

View File

@ -1,12 +1,131 @@
# UNFINISHED - DO NOT USE. # UNFINISHED - DO NOT USE.
cmake_minimum_required ( VERSION 3.0 ) if(NOT CMAKE_BUILD_TYPE)
project ( cathook ) set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Build type")
endif()
set(CMAKE_BUILD_TYPE_VALUES "Debug;Release" CACHE INTERNAL "List of supported build")
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS ${CMAKE_BUILD_TYPE_VALUES})
set (SOURCESDK "source-sdk-2013-headers") cmake_minimum_required(VERSION 3.0)
project(cathook VERSION 0.0.1 DESCRIPTION "Free Source Engine Trainer")
add_library(cathook SHARED "")
include_directories ( . include ucccccp SYSTEM ${SOURCESDK} ${SOURCESDK}/public ${SOURCESDK}/mathlib ${SOURCESDK}/common ${SOURCESDK}/public/tier0 ${SOURCESDK}/public/tier1) set(GameSpecific 1 CACHE BOOL "Build for specific target game (As opposed to universal, but slower, lib)")
set(Game "tf2" CACHE STRING "Target game")
set(GameValues "tf2;hl2dm;dab;tf2c;css;dynamic" CACHE INTERNAL "List of supported game types")
set_property(CACHE Game PROPERTY STRINGS ${GameValues})
set(EnableVisuals 1 CACHE BOOL "Enable Visuals")
set(ExternalDrawing 0 CACHE BOOL "External Visuals")
set(EnableGUI 1 CACHE BOOL "Enable GUI")
set(EnableIPC 1 CACHE BOOL "Enable IPC")
set(DataPath "/opt/cathook/data" CACHE STRING "Data location")
set(VACBypass 0 CACHE BOOL "Textmode VAC bypass")
set(Textmode 0 CACHE BOOL "Various textmode-only features for bots")
set(EnableTextmodeStdin 0 CACHE BOOL "Textmode Stdin -> Console bridge (EXPERIMENTAL)")
set(EnableWarnings 1 CACHE BOOL "Enable compile warnings")
set(EnableNullGraphics 0 CACHE BOOL "Enable experimental textmode hooks (CRASHES)")
add_subdirectory (src) if(NOT EnableVisuals)
set(EnableGUI 0)
endif()
find_package(Git REQUIRED)
find_package(OpenSSL REQUIRED)
# cat packages
execute_process(COMMAND
"${GIT_EXECUTABLE}" log -1 --pretty=\"%h\"
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
OUTPUT_VARIABLE GIT_COMMIT_HASH
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(COMMAND
"${GIT_EXECUTABLE}" log -1 --pretty=\"%ai\"
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
OUTPUT_VARIABLE GIT_COMMIT_TIME
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
find_library(ValveLibrarySDL2 NAMES libSDL2-2.0.so.0 PATHS "${PROJECT_SOURCE_DIR}/lib" NO_DEFAULT_PATH)
find_library(ValveLibraryTier0 NAMES tier0 PATHS "${PROJECT_SOURCE_DIR}/lib" NO_DEFAULT_PATH)
find_library(ValveLibraryVStdLib NAMES vstdlib PATHS "${PROJECT_SOURCE_DIR}/lib" NO_DEFAULT_PATH)
if(EnableIPC)
find_package(SimpleIPC REQUIRED)
get_target_property(SimpleIPC_INCLUDE_DIRS SimpleIPC INTERFACE_INCLUDE_DIRECTORIES)
target_include_directories(cathook PRIVATE "${SimpleIPC_INCLUDE_DIRS}")
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)
endif()
target_include_directories(cathook PRIVATE
"${SDL2_INCLUDE_DIRS}"
"${glez_INCLUDE_DIRS}")
target_link_libraries(cathook ${ValveLibrarySDL2} glez ${GLEW_LIBRARIES})
endif()
configure_file(include/config.h.in ${CMAKE_SOURCE_DIR}/include/config.h @ONLY)
configure_file(include/version.h.in ${CMAKE_SOURCE_DIR}/include/version.h @ONLY)
set_target_properties(cathook PROPERTIES COMPILE_FLAGS "-m32 -msse -msse2 -msse3" LINK_FLAGS "-m32 -static")
target_compile_definitions(cathook PRIVATE
_GLIBCXX_USE_CXX11_ABI=0
_POSIX=1
FREETYPE_GL_USE_VAO=1
RAD_TELEMETRY_DISABLED=1
LINUX=1
USE_SDL=1
_LINUX=1
POSIX=1
GNUC=1
NO_MALLOC_OVERRIDE=1)
target_include_directories(cathook SYSTEM PRIVATE
"source-sdk-2013-headers/mp/src/mathlib"
"source-sdk-2013-headers/mp/src/public"
"source-sdk-2013-headers/mp/src/common"
"source-sdk-2013-headers/mp/src/public/tier0"
"source-sdk-2013-headers/mp/src/public/tier1"
"source-sdk-2013-headers/mp/src/tier1"
"source-sdk-2013-headers/mp/src")
target_include_directories(cathook PRIVATE "ucccccp")
if(EnableWarnings)
target_compile_options(cathook PRIVATE -Wall -Wextra)
endif()
add_subdirectory(include)
add_subdirectory(src)
add_custom_target(data
bash ./install-data "${DataPath}"
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
VERBATIM)
# TODO glez_LIBRARIES?
target_link_libraries(cathook ${ValveLibraryTier0} ${ValveLibraryVStdLib} ssl stdc++)
set_target_properties(cathook PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
# Strip
if(CMAKE_BUILD_TYPE STREQUAL "Release")
message("Stripping info from library")
add_custom_command(TARGET cathook POST_BUILD
COMMAND strip --strip-all "$<TARGET_FILE:cathook>")
endif()
add_custom_command(TARGET cathook POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:cathook> "${CMAKE_SOURCE_DIR}/bin/$<TARGET_FILE_NAME:cathook>")

View File

@ -3,7 +3,7 @@
[cathook announcements channel in telegram](https://t.me/cathook_cheat) [cathook announcements channel in telegram](https://t.me/cathook_cheat)
# Detected ## Risk of VAC detection
The software is most likely detected. Only use it on accounts you won't regret getting VAC banned. The software is most likely detected. Only use it on accounts you won't regret getting VAC banned.
@ -37,6 +37,24 @@ and a lot of useful features, including
# INSTALLATION # INSTALLATION
You need CMake to build cathook, CMake should take care of dependencies
Install [libglez](https://github.com/nullifiedcat/libglez) and [libxoverlay](https://github.com/nullifiedcat/libxoverlay)
* Clone the repo of library (`git clone <URL>`)
* `mkdir build && cd build`
* `cmake ..`
* `make && sudo make install`
Install cathook
* `git clone --recursive https://github.com/nullifiedcat/cathook`
* `cd cathook && mkdir build && cd build`
* `cmake .. && make`
* `sudo make data`
### Outdated (but might be helpful):
You can use gcc-7 for compiling cathook if you add `-e CC=gcc-7 CXX=g++-7` to make command line You can use gcc-7 for compiling cathook if you add `-e CC=gcc-7 CXX=g++-7` to make command line
Ubuntu gcc6 installation: (check if you have gcc-6 installed already by typing `gcc-6 -v` Ubuntu gcc6 installation: (check if you have gcc-6 installed already by typing `gcc-6 -v`
@ -58,10 +76,12 @@ sudo pacman -U https://archive.archlinux.org/packages/g/gcc-multilib/gcc-multili
If you don't use Ubuntu or Arch (or if Arch script gets outdated), here's the list of what cathook requires: If you don't use Ubuntu or Arch (or if Arch script gets outdated), here's the list of what cathook requires:
* `gcc-6` * `cmake-qt-gui` (optional, for easy configuring)
* `g++-6` * `cmake`
* `gcc-6-multilib` * `gcc-7`
* `g++-6-multilib` * `g++-7`
* `gcc-7-multilib`
* `g++-7-multilib`
* `glew` * `glew`
* `gdb` (for the injection script, you can use different injector if you want) * `gdb` (for the injection script, you can use different injector if you want)
* `libssl-dev:i386` * `libssl-dev:i386`
@ -81,15 +101,16 @@ git clone --recursive https://github.com/nullifiedcat/cathook && cd cathook && b
**Errors while installing?** **Errors while installing?**
`/usr/include/c++/5/string:38:28: fatal error: bits/c++config.h: No such file or directory` `/usr/include/c++/5/string:38:28: fatal error: bits/c++config.h: No such file or directory`
You don't have gcc-multilib-6 installed correctly. You don't have gcc-7-multilib installed correctly.
`/usr/bin/ld: cannot find -lxoverlay` Anything related to `glez` or `xoverlay`
You don't have cathook libs installed. Use ./catlibs script in scripts folder to install them.
Install libglez and libxoverlay.
`src/<any file>: fatal error: mathlib/vector.h: No such file or directory` `src/<any file>: fatal error: mathlib/vector.h: No such file or directory`
You didn't download Source SDK. **DO NOT DOWNLOAD CATHOOK USING "DOWNLOAD .ZIP" FROM GITHUB. USE git clone --recursive!** You didn't download Source SDK. **DO NOT DOWNLOAD CATHOOK USING "DOWNLOAD .ZIP" FROM GITHUB. USE git clone --recursive!**
If you are using another distro, make sure to have g++-6, gdb, libc6 and build essentials installed. If you are using another distro, make sure to have required dependencies installed.
## Updating cathook ## Updating cathook
Run the `update` script in cathook folder. Run the `update` script in cathook folder.

View File

@ -1,28 +0,0 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26403.7
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cathook", "cathook.vcxproj", "{B8CA8341-A6F9-425D-8F9A-1B8F27786B80}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{B8CA8341-A6F9-425D-8F9A-1B8F27786B80}.Debug|x64.ActiveCfg = Debug|x64
{B8CA8341-A6F9-425D-8F9A-1B8F27786B80}.Debug|x64.Build.0 = Debug|x64
{B8CA8341-A6F9-425D-8F9A-1B8F27786B80}.Debug|x86.ActiveCfg = Debug|Win32
{B8CA8341-A6F9-425D-8F9A-1B8F27786B80}.Debug|x86.Build.0 = Debug|Win32
{B8CA8341-A6F9-425D-8F9A-1B8F27786B80}.Release|x64.ActiveCfg = Release|x64
{B8CA8341-A6F9-425D-8F9A-1B8F27786B80}.Release|x64.Build.0 = Release|x64
{B8CA8341-A6F9-425D-8F9A-1B8F27786B80}.Release|x86.ActiveCfg = Release|Win32
{B8CA8341-A6F9-425D-8F9A-1B8F27786B80}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,19 +0,0 @@
#!/usr/bin/env bash
if ! [ -d "$1" ]; then
echo "Creating cathook data directory at $1"
sudo mkdir -p "$1"
sudo chown -R $USER "$1"
sudo chmod -R 777 "$1"
fi
rsync -avh --progress "data/" "$1"
if ! [ -d "$1/res" ]; then
echo "Creating cathook data directory at $1/res"
sudo mkdir -p "$1/res"
sudo chown -R $USER "$1/res"
sudo chmod -R 777 "$1/res"
fi
rsync -avh --progress "res/" "$1/res"

View File

@ -1,4 +0,0 @@
// 2D drawing shader
void main() {
gl_FragColor = gl_Color;
}

View File

@ -1,13 +0,0 @@
// 2D drawing shader
uniform mat4 model;
uniform mat4 view;
uniform mat4 projection;
attribute vec2 vertex;
attribute vec4 color;
void main()
{
gl_FrontColor = color;
gl_Position = projection*(view*(model*vec4(vertex,0.0,1.0)));
}

View File

@ -1,6 +0,0 @@
// 2D drawing shader
uniform sampler2D texture;
void main()
{
gl_FragColor = texture2D(texture, gl_TexCoord[0].xy) * gl_Color;
}

View File

@ -1,15 +0,0 @@
// 2D drawing shader - modified freetype-gl shader
uniform mat4 model;
uniform mat4 view;
uniform mat4 projection;
attribute vec2 vertex;
attribute vec2 tex_coord;
attribute vec4 color;
void main()
{
gl_TexCoord[0].xy = tex_coord.xy;
gl_FrontColor = color;
gl_Position = projection*(view*(model*vec4(vertex,0.0,1.0)));
}

View File

@ -1,11 +0,0 @@
/* Freetype GL - A C OpenGL Freetype engine
*
* Distributed under the OSI-approved BSD 2-Clause License. See accompanying
* file `LICENSE` for more details.
*/
uniform sampler2D texture;
void main()
{
float a = texture2D(texture, gl_TexCoord[0].xy).r;
gl_FragColor = vec4(gl_Color.rgb, gl_Color.a*a);
}

View File

@ -1,18 +0,0 @@
/* Freetype GL - A C OpenGL Freetype engine
*
* Distributed under the OSI-approved BSD 2-Clause License. See accompanying
* file `LICENSE` for more details.
*/
uniform mat4 model;
uniform mat4 view;
uniform mat4 projection;
attribute vec3 vertex;
attribute vec2 tex_coord;
attribute vec4 color;
void main()
{
gl_TexCoord[0].xy = tex_coord.xy;
gl_FrontColor = color;
gl_Position = projection*(view*(model*vec4(vertex,1.0)));
}

View File

Before

Width:  |  Height:  |  Size: 367 KiB

After

Width:  |  Height:  |  Size: 367 KiB

View File

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

2
include/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
config.h
version.h

View File

@ -5,8 +5,7 @@
* Author: nullifiedcat * Author: nullifiedcat
*/ */
#ifndef CDUMPER_HPP_ #pragma once
#define CDUMPER_HPP_
#include <fstream> #include <fstream>
#include <string> #include <string>
@ -116,5 +115,3 @@ public:
private: private:
std::fstream m_file; std::fstream m_file;
}; };
#endif /* CDUMPER_HPP_ */

69
include/CMakeLists.txt Normal file
View File

@ -0,0 +1,69 @@
target_sources(cathook PRIVATE
"${CMAKE_CURRENT_LIST_DIR}/angles.hpp"
"${CMAKE_CURRENT_LIST_DIR}/averager.hpp"
"${CMAKE_CURRENT_LIST_DIR}/backpacktf.hpp"
"${CMAKE_CURRENT_LIST_DIR}/base64.hpp"
"${CMAKE_CURRENT_LIST_DIR}/CDumper.hpp"
"${CMAKE_CURRENT_LIST_DIR}/chatlog.hpp"
"${CMAKE_CURRENT_LIST_DIR}/chatstack.hpp"
"${CMAKE_CURRENT_LIST_DIR}/common.hpp"
"${CMAKE_CURRENT_LIST_DIR}/conditions.hpp"
"${CMAKE_CURRENT_LIST_DIR}/crits.hpp"
"${CMAKE_CURRENT_LIST_DIR}/cvwrapper.hpp"
"${CMAKE_CURRENT_LIST_DIR}/e8call.hpp"
"${CMAKE_CURRENT_LIST_DIR}/entitycache.hpp"
"${CMAKE_CURRENT_LIST_DIR}/entityhitboxcache.hpp"
"${CMAKE_CURRENT_LIST_DIR}/enums.hpp"
"${CMAKE_CURRENT_LIST_DIR}/gameinfo.hpp"
"${CMAKE_CURRENT_LIST_DIR}/globals.h"
"${CMAKE_CURRENT_LIST_DIR}/hack.hpp"
"${CMAKE_CURRENT_LIST_DIR}/headshake.hpp"
"${CMAKE_CURRENT_LIST_DIR}/helpers.hpp"
"${CMAKE_CURRENT_LIST_DIR}/hitrate.hpp"
"${CMAKE_CURRENT_LIST_DIR}/hooks.hpp"
"${CMAKE_CURRENT_LIST_DIR}/hoovy.hpp"
"${CMAKE_CURRENT_LIST_DIR}/https_request.hpp"
"${CMAKE_CURRENT_LIST_DIR}/init.hpp"
"${CMAKE_CURRENT_LIST_DIR}/interfaces.hpp"
"${CMAKE_CURRENT_LIST_DIR}/ipc.hpp"
"${CMAKE_CURRENT_LIST_DIR}/itemtypes.hpp"
"${CMAKE_CURRENT_LIST_DIR}/json.hpp"
"${CMAKE_CURRENT_LIST_DIR}/localplayer.hpp"
"${CMAKE_CURRENT_LIST_DIR}/logging.hpp"
"${CMAKE_CURRENT_LIST_DIR}/macros.hpp"
"${CMAKE_CURRENT_LIST_DIR}/netmessage.hpp"
"${CMAKE_CURRENT_LIST_DIR}/netvars.hpp"
"${CMAKE_CURRENT_LIST_DIR}/offsets.hpp"
"${CMAKE_CURRENT_LIST_DIR}/playerlist.hpp"
"${CMAKE_CURRENT_LIST_DIR}/playerresource.h"
"${CMAKE_CURRENT_LIST_DIR}/prediction.hpp"
"${CMAKE_CURRENT_LIST_DIR}/profiler.hpp"
"${CMAKE_CURRENT_LIST_DIR}/projlogging.hpp"
"${CMAKE_CURRENT_LIST_DIR}/sconvars.hpp"
"${CMAKE_CURRENT_LIST_DIR}/sdk.hpp"
"${CMAKE_CURRENT_LIST_DIR}/sharedobj.hpp"
"${CMAKE_CURRENT_LIST_DIR}/targethelper.hpp"
"${CMAKE_CURRENT_LIST_DIR}/textfile.hpp"
"${CMAKE_CURRENT_LIST_DIR}/textmode.hpp"
"${CMAKE_CURRENT_LIST_DIR}/tfmm.hpp"
"${CMAKE_CURRENT_LIST_DIR}/timer.hpp"
"${CMAKE_CURRENT_LIST_DIR}/trace.hpp"
"${CMAKE_CURRENT_LIST_DIR}/ucccccp_cmds.hpp"
"${CMAKE_CURRENT_LIST_DIR}/usercmd.hpp"
"${CMAKE_CURRENT_LIST_DIR}/velocity.hpp"
"${CMAKE_CURRENT_LIST_DIR}/vfunc.hpp"
"${CMAKE_CURRENT_LIST_DIR}/votelogger.hpp"
"${CMAKE_CURRENT_LIST_DIR}/xorstring.hpp")
target_include_directories(cathook PRIVATE "${CMAKE_CURRENT_LIST_DIR}")
add_subdirectory(classinfo)
add_subdirectory(copypasted)
add_subdirectory(hacks)
add_subdirectory(hooks)
add_subdirectory(reclasses)
add_subdirectory(sdk)
if(EnableVisuals)
add_subdirectory(visual)
endif()

View File

@ -5,8 +5,7 @@
* Author: nullifiedcat * Author: nullifiedcat
*/ */
#ifndef CHATSTACK_HPP_ #pragma once
#define CHATSTACK_HPP_
#define CHATSTACK_INTERVAL 0.8f #define CHATSTACK_INTERVAL 0.8f
@ -30,5 +29,3 @@ void Reset();
extern std::stack<msg_t> stack; extern std::stack<msg_t> stack;
extern float last_say; extern float last_say;
} }
#endif /* CHATSTACK_HPP_ */

View File

@ -0,0 +1,5 @@
target_sources(cathook PRIVATE
"${CMAKE_CURRENT_LIST_DIR}/classinfo.hpp"
"${CMAKE_CURRENT_LIST_DIR}/dump.hpp")
target_include_directories(cathook PRIVATE "${CMAKE_CURRENT_LIST_DIR}")

View File

@ -5,10 +5,9 @@
* Author: nullifiedcat * Author: nullifiedcat
*/ */
#ifndef CLASSINFO_HPP_ #pragma once
#define CLASSINFO_HPP_
#include "common.hpp" #include "config.h"
#include "dummy.gen.hpp" #include "dummy.gen.hpp"
@ -27,10 +26,10 @@ void InitClassTable();
extern client_classes::dummy *client_class_list; extern client_classes::dummy *client_class_list;
#if not defined(BUILD_GAME) or defined(DYNAMIC_CLASSES) #if not GAME_SPECIFIC
#define CL_CLASS(x) (client_class_list->x) #define CL_CLASS(x) (client_class_list->x)
#else #else
#define CL_CLASS(x) (client_classes_constexpr::BUILD_GAME::x) #define CL_CLASS(x) (client_classes_constexpr::GAME::x)
#endif #endif
#define RCC_CLASS(tf, hl2dm, css, def) \ #define RCC_CLASS(tf, hl2dm, css, def) \
@ -40,5 +39,3 @@ extern client_classes::dummy *client_class_list;
#define RCC_PLAYER RCC_CLASS(CTFPlayer, CHL2MP_Player, CCSPlayer, 0) #define RCC_PLAYER RCC_CLASS(CTFPlayer, CHL2MP_Player, CCSPlayer, 0)
#define RCC_PLAYERRESOURCE \ #define RCC_PLAYERRESOURCE \
RCC_CLASS(CTFPlayerResource, CPlayerResource, CCSPlayerResource, 0) RCC_CLASS(CTFPlayerResource, CPlayerResource, CCSPlayerResource, 0)
#endif /* CLASSINFO_HPP_ */

View File

@ -5,9 +5,6 @@
* Author: nullifiedcat * Author: nullifiedcat
*/ */
#ifndef DUMP_HPP_ #pragma once
#define DUMP_HPP_
void PerformClassDump(); void PerformClassDump();
#endif /* DUMP_HPP_ */

View File

@ -1,18 +1,13 @@
/* /*
* common.h * common.hpp
* *
* Created on: Dec 5, 2016 * Created on: Dec 5, 2016
* Author: nullifiedcat * Author: nullifiedcat
*/ */
#ifndef COMMON_H_ #pragma once
#define COMMON_H_
#if defined(LINUX) and not defined(NO_IPC) #include "config.h"
#define ENABLE_IPC 1
#else
#undef ENABLE_IPC
#endif
#include <emmintrin.h> #include <emmintrin.h>
#include <vector> #include <vector>
@ -41,12 +36,12 @@
#include <elf.h> #include <elf.h>
#include <sys/mman.h> #include <sys/mman.h>
#include <fcntl.h> #include <fcntl.h>
#include <stdio.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/types.h> #include <sys/types.h>
#include <string.h>
#include <pwd.h> #include <pwd.h>
#include <assert.h> #include <cstring>
#include <cstdio>
#include <cassert>
#include "timer.hpp" #include "timer.hpp"
#include "averager.hpp" #include "averager.hpp"
@ -54,7 +49,7 @@
#include "macros.hpp" #include "macros.hpp"
#include <visual/colors.hpp> #include <visual/colors.hpp>
#if ENABLE_VISUALS == 1 #if ENABLE_VISUALS
#include <visual/drawex.hpp> #include <visual/drawex.hpp>
#include <visual/drawing.hpp> #include <visual/drawing.hpp>
@ -113,8 +108,7 @@
#include "copypasted/CSignature.h" #include "copypasted/CSignature.h"
#if ENABLE_GUI #if ENABLE_GUI
#include "gui/GUI.hpp" #include "GUI.h"
#include "menu/GUI.h"
#endif #endif
#include <hacks/hacklist.hpp> #include <hacks/hacklist.hpp>
@ -152,5 +146,3 @@ template <typename T> constexpr T _clamp(T _min, T _max, T _val)
#define GET_RENDER_CONTEXT \ #define GET_RENDER_CONTEXT \
(IsTF2() ? g_IMaterialSystem->GetRenderContext() \ (IsTF2() ? g_IMaterialSystem->GetRenderContext() \
: g_IMaterialSystemHL->GetRenderContext()) : g_IMaterialSystemHL->GetRenderContext())
#endif /* COMMON_H_ */

View File

@ -5,8 +5,7 @@
* Author: nullifiedcat * Author: nullifiedcat
*/ */
#ifndef CONDITIONS_HPP_ #pragma once
#define CONDITIONS_HPP_
#include <entitycache.hpp> #include <entitycache.hpp>
#include "netvars.hpp" #include "netvars.hpp"
@ -315,5 +314,3 @@ template <condition cond> inline void RemoveCondition(CachedEntity *ent)
} }
CondBitSet<cond, false>(CE_VAR(ent, netvar.iCond, condition_data_s)); CondBitSet<cond, false>(CE_VAR(ent, netvar.iCond, condition_data_s));
} }
#endif /* CONDITIONS_HPP_ */

16
include/config.h.in Normal file
View File

@ -0,0 +1,16 @@
#pragma once
#define OFF 0
#define ON 1
#define GAME_SPECIFIC @GameSpecific@
#define GAME @Game@
#define ENABLE_VISUALS @EnableVisuals@
#define EXTERNAL_DRAWING @ExternalDrawing@
#define ENABLE_GUI @EnableGUI@
#define ENABLE_IPC @EnableIPC@
#define DATA_PATH "@DataPath@"
#define ENABLE_VAC_BYPASS @VACBypass@
#define ENABLE_TEXTMODE_STDIN @EnableTextmodeStdin@
#define ENABLE_NULL_GRAPHICS @EnableNullGraphics@
#define TEXTMODE @Textmode@

View File

@ -0,0 +1,5 @@
target_sources(cathook PRIVATE
"${CMAKE_CURRENT_LIST_DIR}/CSignature.h"
"${CMAKE_CURRENT_LIST_DIR}/Netvar.h")
target_include_directories(cathook PRIVATE "${CMAKE_CURRENT_LIST_DIR}")

View File

@ -11,9 +11,9 @@ public:
uintptr_t dwFindPattern(uintptr_t dwAddress, uintptr_t dwLength, uintptr_t dwFindPattern(uintptr_t dwAddress, uintptr_t dwLength,
const char *szPattern); const char *szPattern);
void *GetModuleHandleSafe(const char *pszModuleName); void *GetModuleHandleSafe(const char *pszModuleName);
uintptr_t GetClientSignature(char *chPattern); uintptr_t GetClientSignature(const char *chPattern);
uintptr_t GetEngineSignature(char *chPattern); uintptr_t GetEngineSignature(const char *chPattern);
uintptr_t GetVstdSignature(char *chPattern); uintptr_t GetVstdSignature(const char *chPattern);
}; };
extern CSignature gSignatures; extern CSignature gSignatures;

View File

@ -5,8 +5,7 @@
* Author: nullifiedcat * Author: nullifiedcat
*/ */
#ifndef CRITS_HPP_ #pragma once
#define CRITS_HPP_
class CUserCmd; class CUserCmd;
class IClientEntity; class IClientEntity;
@ -42,5 +41,3 @@ bool random_crits_enabled();
extern int *g_PredictionRandomSeed; extern int *g_PredictionRandomSeed;
extern std::unordered_map<int, int> command_number_mod; extern std::unordered_map<int, int> command_number_mod;
#endif /* CRITS_HPP_ */

View File

@ -5,8 +5,7 @@
* Author: nullifiedcat * Author: nullifiedcat
*/ */
#ifndef CVWRAPPER_HPP_ #pragma once
#define CVWRAPPER_HPP_
class ConVar; class ConVar;
@ -189,5 +188,3 @@ std::vector<CatVar *> &CatVarList();
void RegisterCatCommands(); void RegisterCatCommands();
void RegisterCatVars(); void RegisterCatVars();
int GetRebasedCatVarCount(); int GetRebasedCatVarCount();
#endif /* CVWRAPPER_HPP_ */

View File

@ -5,8 +5,7 @@
* Author: nullifiedcat * Author: nullifiedcat
*/ */
#ifndef ENTITYCACHE_HPP_ #pragma once
#define ENTITYCACHE_HPP_
#include "entityhitboxcache.hpp" #include "entityhitboxcache.hpp"
#include "averager.hpp" #include "averager.hpp"
@ -136,5 +135,3 @@ void Update();
void Invalidate(); void Invalidate();
extern int max; extern int max;
} }
#endif /* ENTITYCACHE_HPP_ */

View File

@ -5,8 +5,7 @@
* Author: nullifiedcat * Author: nullifiedcat
*/ */
#ifndef ENTITYHITBOXCACHE_HPP_ #pragma once
#define ENTITYHITBOXCACHE_HPP_
#include <mathlib/vector.h> #include <mathlib/vector.h>
#include <mathlib/mathlib.h> #include <mathlib/mathlib.h>
@ -70,5 +69,3 @@ inline EntityHitboxCache &Get(unsigned i)
return array[i]; return array[i];
} }
} }
#endif /* ENTITYHITBOXCACHE_HPP_ */

View File

@ -5,8 +5,7 @@
* Author: nullifiedcat * Author: nullifiedcat
*/ */
#ifndef ENUMS_HPP_ #pragma once
#define ENUMS_HPP_
enum EntityType enum EntityType
{ {
@ -104,5 +103,3 @@ enum hitbox_t
knee_R = 16, knee_R = 16,
foot_R = 17 foot_R = 17
}; };
#endif /* ENUMS_HPP_ */

View File

@ -5,32 +5,34 @@
* Author: nullifiedcat * Author: nullifiedcat
*/ */
#ifndef GAMEINFO_HPP_ #pragma once
#define GAMEINFO_HPP_
#include "common.hpp" #include "config.h"
#include "macros.hpp"
#ifdef BUILD_GAME extern int g_AppID;
#if GAME_SPECIFIC
constexpr bool IsTF2() constexpr bool IsTF2()
{ {
return !c_strcmp(TO_STRING(BUILD_GAME), "tf2"); return !c_strcmp(TO_STRING(GAME), "tf2");
} }
constexpr bool IsTF2C() constexpr bool IsTF2C()
{ {
return !c_strcmp(TO_STRING(BUILD_GAME), "tf2c"); return !c_strcmp(TO_STRING(GAME), "tf2c");
} }
constexpr bool IsHL2DM() constexpr bool IsHL2DM()
{ {
return !c_strcmp(TO_STRING(BUILD_GAME), "hl2dm"); return !c_strcmp(TO_STRING(GAME), "hl2dm");
} }
constexpr bool IsCSS() constexpr bool IsCSS()
{ {
return !c_strcmp(TO_STRING(BUILD_GAME), "css"); return !c_strcmp(TO_STRING(GAME), "css");
} }
constexpr bool IsDynamic() constexpr bool IsDynamic()
{ {
return !c_strcmp(TO_STRING(BUILD_GAME), "dynamic"); return !c_strcmp(TO_STRING(GAME), "dynamic");
} }
constexpr bool IsTF() constexpr bool IsTF()
@ -42,6 +44,7 @@ constexpr bool IsTF()
#define IF_GAME(x) if (x) #define IF_GAME(x) if (x)
#else #else
inline bool IsTF2() inline bool IsTF2()
{ {
return g_AppID == 440; return g_AppID == 440;
@ -71,5 +74,3 @@ inline bool IsTF()
#define IF_GAME(x) if (x) #define IF_GAME(x) if (x)
#endif #endif
#endif /* GAMEINFO_HPP_ */

View File

@ -5,8 +5,7 @@
* Author: nullifiedcat * Author: nullifiedcat
*/ */
#ifndef GLOBALS_H_ #pragma once
#define GLOBALS_H_
#include <time.h> #include <time.h>
@ -54,5 +53,3 @@ class CUserCmd;
extern CUserCmd *g_pUserCmd; extern CUserCmd *g_pUserCmd;
extern GlobalSettings g_Settings; extern GlobalSettings g_Settings;
#endif /* GLOBALS_H_ */

View File

@ -1,18 +0,0 @@
/*
* GUI.hpp
*
* Created on: Nov 14, 2017
* Author: nullifiedcat
*/
#pragma once
#include "cmdui/cmdui.hpp"
namespace gui
{
void init();
void update();
void draw();
}

View File

@ -1,19 +0,0 @@
/*
* cmdui.hpp
*
* Created on: Nov 17, 2017
* Author: nullifiedcat
*/
#pragma once
namespace gui
{
namespace cmdui
{
void init();
void update();
void draw();
}
}

View File

@ -5,8 +5,7 @@
* Author: nullifiedcat * Author: nullifiedcat
*/ */
#ifndef HACK_H_ #pragma once
#define HACK_H_
class IHack; class IHack;
class CUserCmd; class CUserCmd;
@ -38,5 +37,3 @@ void Shutdown();
void CC_Cat(const CCommand &args); void CC_Cat(const CCommand &args);
extern ConCommand *c_Cat; extern ConCommand *c_Cat;
} }
#endif /* HACK_H_ */

View File

@ -5,8 +5,7 @@
* Author: nullifiedcat * Author: nullifiedcat
*/ */
#ifndef HACKS_ACHIEVEMENT_HPP_ #pragma once
#define HACKS_ACHIEVEMENT_HPP_
namespace hacks namespace hacks
{ {
@ -20,5 +19,3 @@ void Unlock();
} }
} }
} }
#endif /* HACKS_ACHIEVEMENT_HPP_ */

View File

@ -5,10 +5,10 @@
* Author: nullifiedcat * Author: nullifiedcat
*/ */
#ifndef HAIMBOT_H_ #pragma once
#define HAIMBOT_H_
#include "common.hpp" #include "common.hpp"
#include "config.h"
class ConVar; class ConVar;
class IClientEntity; class IClientEntity;
@ -43,7 +43,7 @@ extern int target_eid;
// Functions called by other functions for when certian game calls are run // Functions called by other functions for when certian game calls are run
void CreateMove(); void CreateMove();
#if ENABLE_VISUALS == 1 #if ENABLE_VISUALS
void DrawText(); void DrawText();
#endif #endif
void Reset(); void Reset();
@ -63,5 +63,3 @@ float EffectiveTargetingRange();
} }
} }
} }
#endif /* HAIMBOT_H_ */

View File

@ -5,8 +5,7 @@
* Author: nullifiedcat * Author: nullifiedcat
*/ */
#ifndef ANTIAIM_H_ #pragma once
#define ANTIAIM_H_
class CatVar; class CatVar;
class CUserCmd; class CUserCmd;
@ -39,5 +38,3 @@ void ProcessUserCmd(CUserCmd *cmd);
} }
} }
} }
#endif /* ANTIAIM_H_ */

View File

@ -5,8 +5,7 @@
* Author: nullifiedcat * Author: nullifiedcat
*/ */
#ifndef HACKS_ANTIBACKSTAB_HPP_ #pragma once
#define HACKS_ANTIBACKSTAB_HPP_
namespace hacks namespace hacks
{ {
@ -20,5 +19,3 @@ void PaintTraverse();
} }
} }
} }
#endif /* HACKS_ANTIBACKSTAB_HPP_ */

View File

@ -5,8 +5,7 @@
* Author: nullifiedcat * Author: nullifiedcat
*/ */
#ifndef HACKS_ANTIDISGUISE_HPP_ #pragma once
#define HACKS_ANTIDISGUISE_HPP_
#include "common.hpp" #include "common.hpp"
@ -23,5 +22,3 @@ void Draw();
} }
} }
} }
#endif /* HACKS_ANTIDISGUISE_HPP_ */

View File

@ -5,8 +5,7 @@
* Author: nullifiedcat * Author: nullifiedcat
*/ */
#ifndef HACKS_AUTOBACKSTAB_HPP_ #pragma once
#define HACKS_AUTOBACKSTAB_HPP_
namespace hacks namespace hacks
{ {
@ -20,5 +19,3 @@ const Vector GetWorldSpaceCenter(CachedEntity *ent);
} }
} }
} }
#endif /* HACKS_AUTOBACKSTAB_HPP_ */

View File

@ -5,8 +5,7 @@
* Author: nullifiedcat & Lighty * Author: nullifiedcat & Lighty
*/ */
#ifndef HACKS_AUTODETONATOR_HPP_ #pragma once
#define HACKS_AUTODETONATOR_HPP_
#include "common.hpp" #include "common.hpp"
@ -20,5 +19,3 @@ void CreateMove();
} }
} }
} }
#endif /* HACKS_AUTODETONATOR_HPP_ */

View File

@ -5,8 +5,7 @@
* Author: nullifiedcat * Author: nullifiedcat
*/ */
#ifndef HACKS_AUTOHEAL_HPP_ #pragma once
#define HACKS_AUTOHEAL_HPP_
#include "common.hpp" #include "common.hpp"
@ -41,5 +40,3 @@ bool CanHeal(int idx);
} }
} }
} }
#endif /* HACKS_AUTOHEAL_HPP_ */

View File

@ -5,8 +5,7 @@
* Author: nullifiedcat * Author: nullifiedcat
*/ */
#ifndef HACKS_AUTOREFLECT_HPP_ #pragma once
#define HACKS_AUTOREFLECT_HPP_
#include "common.hpp" #include "common.hpp"
@ -29,5 +28,3 @@ bool IsEntStickyBomb(CachedEntity *ent);
} }
} }
} }
#endif /* HACKS_AUTOREFLECT_HPP_ */

View File

@ -5,8 +5,7 @@
* Author: nullifiedcat * Author: nullifiedcat
*/ */
#ifndef HACKS_AUTOSTICKY_HPP_ #pragma once
#define HACKS_AUTOSTICKY_HPP_
#include "common.hpp" #include "common.hpp"
@ -26,5 +25,3 @@ void CreateMove();
} }
} }
} }
#endif /* HACKS_AUTOSTICKY_HPP_ */

View File

@ -5,8 +5,7 @@
* Author: nullifiedcat * Author: nullifiedcat
*/ */
#ifndef HBUNNYHOP_H_ #pragma once
#define HBUNNYHOP_H_
#include "common.hpp" #include "common.hpp"
@ -23,5 +22,3 @@ void CreateMove();
} }
} }
} }
#endif /* HBUNNYHOP_H_ */

View File

@ -0,0 +1,42 @@
target_sources(cathook PRIVATE
"${CMAKE_CURRENT_LIST_DIR}/Achievement.hpp"
"${CMAKE_CURRENT_LIST_DIR}/Aimbot.hpp"
"${CMAKE_CURRENT_LIST_DIR}/Announcer.hpp"
"${CMAKE_CURRENT_LIST_DIR}/AntiAim.hpp"
"${CMAKE_CURRENT_LIST_DIR}/AntiBackstab.hpp"
"${CMAKE_CURRENT_LIST_DIR}/AntiCheat.hpp"
"${CMAKE_CURRENT_LIST_DIR}/AntiDisguise.hpp"
"${CMAKE_CURRENT_LIST_DIR}/AutoBackstab.hpp"
"${CMAKE_CURRENT_LIST_DIR}/AutoDeadringer.hpp"
"${CMAKE_CURRENT_LIST_DIR}/AutoDetonator.hpp"
"${CMAKE_CURRENT_LIST_DIR}/AutoHeal.hpp"
"${CMAKE_CURRENT_LIST_DIR}/AutoJoin.hpp"
"${CMAKE_CURRENT_LIST_DIR}/AutoReflect.hpp"
"${CMAKE_CURRENT_LIST_DIR}/AutoSticky.hpp"
"${CMAKE_CURRENT_LIST_DIR}/AutoTaunt.hpp"
"${CMAKE_CURRENT_LIST_DIR}/Bunnyhop.hpp"
"${CMAKE_CURRENT_LIST_DIR}/CatBot.hpp"
"${CMAKE_CURRENT_LIST_DIR}/FollowBot.hpp"
"${CMAKE_CURRENT_LIST_DIR}/hacklist.hpp"
"${CMAKE_CURRENT_LIST_DIR}/HealArrows.hpp"
"${CMAKE_CURRENT_LIST_DIR}/KillSay.hpp"
"${CMAKE_CURRENT_LIST_DIR}/Killstreak.hpp"
"${CMAKE_CURRENT_LIST_DIR}/LagExploit.hpp"
"${CMAKE_CURRENT_LIST_DIR}/Misc.hpp"
"${CMAKE_CURRENT_LIST_DIR}/Noisemaker.hpp"
"${CMAKE_CURRENT_LIST_DIR}/Spam.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)

View File

@ -18,10 +18,13 @@ namespace catbot
bool is_a_catbot(unsigned steamID); bool is_a_catbot(unsigned steamID);
bool should_ignore_player(CachedEntity *player); bool should_ignore_player(CachedEntity *player);
void update_ipc_data(ipc::user_data_s &data);
void update(); void update();
void init(); void init();
void level_init(); void level_init();
#if ENABLE_IPC
void update_ipc_data(ipc::user_data_s &data);
#endif
} }
} }
} }

View File

@ -5,8 +5,7 @@
* Author: nullifiedcat * Author: nullifiedcat
*/ */
#ifndef HESP_H_ #pragma once
#define HESP_H_
#include "common.hpp" #include "common.hpp"
@ -64,5 +63,3 @@ void ResetEntityStrings();
} }
} }
} }
#endif /* HESP_H_ */

View File

@ -5,7 +5,7 @@
* *
*/ */
#include "common.hpp"; #include "common.hpp"
namespace hacks namespace hacks
{ {

View File

@ -5,8 +5,7 @@
* Author: nullifiedcat * Author: nullifiedcat
*/ */
#ifndef HACKS_KILLSAY_HPP_ #pragma once
#define HACKS_KILLSAY_HPP_
#include "common.hpp" #include "common.hpp"
@ -35,5 +34,3 @@ extern const std::vector<std::string> builtin_nonecore_mlg;
} }
} }
} }
#endif /* HACKS_KILLSAY_HPP_ */

View File

@ -5,8 +5,7 @@
* Author: nullifiedcat * Author: nullifiedcat
*/ */
#ifndef HACKS_LAGEXPLOIT_HPP_ #pragma once
#define HACKS_LAGEXPLOIT_HPP_
#include "common.hpp" #include "common.hpp"
@ -27,5 +26,3 @@ bool ExploitActive();
} }
} }
} }
#endif /* HACKS_LAGEXPLOIT_HPP_ */

View File

@ -5,10 +5,10 @@
* Author: nullifiedcat * Author: nullifiedcat
*/ */
#ifndef HACKS_MISC_HPP_ #pragma once
#define HACKS_MISC_HPP_
#include "common.hpp" #include "common.hpp"
#include "config.h"
namespace hacks namespace hacks
{ {
@ -18,7 +18,7 @@ namespace misc
{ {
void CreateMove(); void CreateMove();
#if ENABLE_VISUALS == 1 #if ENABLE_VISUALS
void DrawText(); void DrawText();
#endif #endif
@ -86,5 +86,3 @@ void Schema_Reload();
void CC_Misc_Disconnect_VAC(); void CC_Misc_Disconnect_VAC();
DECLARE_HACK_SINGLETON(Misc);*/ DECLARE_HACK_SINGLETON(Misc);*/
#endif /* HACKS_MISC_HPP_ */

View File

@ -5,8 +5,7 @@
* Author: nullifiedcat * Author: nullifiedcat
*/ */
#ifndef HACKS_NOISEMAKER_HPP_ #pragma once
#define HACKS_NOISEMAKER_HPP_
#include "common.hpp" #include "common.hpp"
@ -23,5 +22,3 @@ void CreateMove();
} }
} }
} }
#endif /* HACKS_NOISEMAKER_HPP_ */

View File

@ -5,8 +5,7 @@
* Author: nullifiedcat * Author: nullifiedcat
*/ */
#ifndef HACKS_RADAR_HPP_ #pragma once
#define HACKS_RADAR_HPP_
#include "visual/atlas.hpp" #include "visual/atlas.hpp"
#include "common.hpp" #include "common.hpp"
@ -30,5 +29,3 @@ void Draw();
} }
} }
} }
#endif /* HACKS_RADAR_HPP_ */

View File

@ -5,8 +5,7 @@
* Author: nullifiedcat * Author: nullifiedcat
*/ */
#ifndef HACKS_SKINCHANGER_HPP_ #pragma once
#define HACKS_SKINCHANGER_HPP_
#include "common.hpp" #include "common.hpp"
@ -145,5 +144,3 @@ void DrawText();
} }
} }
} }
#endif /* HACKS_SKINCHANGER_HPP_ */

View File

@ -5,8 +5,7 @@
* Author: nullifiedcat * Author: nullifiedcat
*/ */
#ifndef HACKS_SPAM_HPP_ #pragma once
#define HACKS_SPAM_HPP_
#include "common.hpp" #include "common.hpp"
@ -36,5 +35,3 @@ void Reload();
} }
} }
} }
#endif /* HACKS_SPAM_HPP_ */

View File

@ -5,8 +5,7 @@
* Author: nullifiedcat * Author: nullifiedcat
*/ */
#ifndef HACKS_SPYALERT_HPP_ #pragma once
#define HACKS_SPYALERT_HPP_
#include "common.hpp" #include "common.hpp"
@ -25,5 +24,3 @@ void Draw();
} }
} }
} }
#endif /* HACKS_SPYALERT_HPP_ */

View File

@ -5,8 +5,7 @@
* Author: nullifiedcat * Author: nullifiedcat
*/ */
#ifndef HTRIGGER_H_ #pragma once
#define HTRIGGER_H_
#include "common.hpp" #include "common.hpp"
@ -31,5 +30,3 @@ bool CheckLineBox(Vector B1, Vector B2, Vector L1, Vector L2, Vector &Hit);
} }
} }
} }
#endif /* HTRIGGER_H_ */

View File

@ -5,8 +5,7 @@
* Author: nullifiedcat * Author: nullifiedcat
*/ */
#ifndef HACKS_UBERSPAM_HPP_ #pragma once
#define HACKS_UBERSPAM_HPP_
#include "common.hpp" #include "common.hpp"
@ -26,5 +25,3 @@ extern const std::vector<std::string> builtin_nonecore;
} }
} }
} }
#endif /* HACKS_UBERSPAM_HPP_ */

View File

@ -7,6 +7,8 @@
#pragma once #pragma once
#include "config.h"
namespace hacks namespace hacks
{ {
namespace shared namespace shared
@ -15,7 +17,7 @@ namespace walkbot
{ {
void Initialize(); void Initialize();
#if ENABLE_VISUALS == 1 #if ENABLE_VISUALS
void Draw(); void Draw();
#endif #endif
void Move(); void Move();

View File

@ -0,0 +1,6 @@
target_sources(cathook PRIVATE
"${CMAKE_CURRENT_LIST_DIR}/aimbot.hpp"
"${CMAKE_CURRENT_LIST_DIR}/antiaim.hpp"
"${CMAKE_CURRENT_LIST_DIR}/bhop.hpp")
target_include_directories(cathook PRIVATE "${CMAKE_CURRENT_LIST_DIR}")

View File

@ -5,10 +5,11 @@
* Author: nullifiedcat * Author: nullifiedcat
*/ */
#ifndef HACKS_HACKLIST_HPP_ #pragma once
#define HACKS_HACKLIST_HPP_
#if ENABLE_VISUALS == 1 #include "config.h"
#if ENABLE_VISUALS
#include "ESP.hpp" #include "ESP.hpp"
#include "SkinChanger.hpp" #include "SkinChanger.hpp"
@ -45,5 +46,3 @@
#include "Announcer.hpp" #include "Announcer.hpp"
#include "Killstreak.hpp" #include "Killstreak.hpp"
#include "CatBot.hpp" #include "CatBot.hpp"
#endif /* HACKS_HACKLIST_HPP_ */

View File

@ -5,8 +5,7 @@
* Author: nullifiedcat * Author: nullifiedcat
*/ */
#ifndef HELPERS_HPP_ #pragma once
#define HELPERS_HPP_
class CachedEntity; class CachedEntity;
class IClientEntity; class IClientEntity;
@ -168,5 +167,3 @@ template <typename... Args> std::string format(const Args &... args)
extern const std::string classes[10]; extern const std::string classes[10];
extern const char *powerups[POWERUP_COUNT]; extern const char *powerups[POWERUP_COUNT];
#endif /* HELPERS_HPP_ */

View File

@ -5,8 +5,7 @@
* Author: nullifiedcat * Author: nullifiedcat
*/ */
#ifndef HOOKS_H_ #pragma once
#define HOOKS_H_
// Parts of copypasted code // Parts of copypasted code
// Credits: Casual_Hacker // Credits: Casual_Hacker
@ -66,5 +65,3 @@ extern VMTHook materialsystem;
extern VMTHook enginevgui; extern VMTHook enginevgui;
extern VMTHook vstd; extern VMTHook vstd;
} }
#endif /* HOOKS_H_ */

View File

@ -0,0 +1,11 @@
target_sources(cathook PRIVATE
"${CMAKE_CURRENT_LIST_DIR}/CreateMove.hpp"
"${CMAKE_CURRENT_LIST_DIR}/hookedmethods.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}")

View File

@ -5,12 +5,9 @@
* Author: nullifiedcat * Author: nullifiedcat
*/ */
#ifndef CREATEMOVE_H_ #pragma once
#define CREATEMOVE_H_
class CUserCmd; class CUserCmd;
extern bool *bSendPackets; extern bool *bSendPackets;
bool CreateMove_hook(void *, float, CUserCmd *); bool CreateMove_hook(void *, float, CUserCmd *);
#endif /* CREATEMOVE_H_ */

View File

@ -5,8 +5,7 @@
* Author: nullifiedcat * Author: nullifiedcat
*/ */
#ifndef PAINTTRAVERSE_H_ #pragma once
#define PAINTTRAVERSE_H_
class CatVar; class CatVar;
@ -14,5 +13,3 @@ extern CatVar no_zoom;
extern CatVar clean_screenshots; extern CatVar clean_screenshots;
extern CatVar disable_visuals; extern CatVar disable_visuals;
void PaintTraverse_hook(void *, unsigned int, bool, bool); void PaintTraverse_hook(void *, unsigned int, bool, bool);
#endif /* PAINTTRAVERSE_H_ */

View File

@ -5,8 +5,7 @@
* Author: nullifiedcat * Author: nullifiedcat
*/ */
#ifndef HOOKEDMETHODS_H_ #pragma once
#define HOOKEDMETHODS_H_
#include "common.hpp" #include "common.hpp"
@ -50,6 +49,7 @@ CUserCmd *GetUserCmd_hook(IInput *, int);
void DrawModelExecute_hook(IVModelRender *_this, const DrawModelState_t &state, void DrawModelExecute_hook(IVModelRender *_this, const DrawModelState_t &state,
const ModelRenderInfo_t &info, matrix3x4_t *matrix); const ModelRenderInfo_t &info, matrix3x4_t *matrix);
#if ENABLE_VISUALS
void Paint_hook(IEngineVGui *_this, PaintMode_t mode); void Paint_hook(IEngineVGui *_this, PaintMode_t mode);
/* SDL HOOKS */ /* SDL HOOKS */
@ -66,9 +66,8 @@ void SDL_GL_SwapWindow_hook(SDL_Window *window);
void DoSDLHooking(); void DoSDLHooking();
void DoSDLUnhooking(); void DoSDLUnhooking();
#endif
#include "CreateMove.hpp" #include "CreateMove.hpp"
#include "PaintTraverse.hpp" #include "PaintTraverse.hpp"
#include "others.hpp" #include "others.hpp"
#endif /* HOOKEDMETHODS_H_ */

View File

@ -5,8 +5,9 @@
* Author: nullifiedcat * Author: nullifiedcat
*/ */
#ifndef OTHERS_H_ #pragma once
#define OTHERS_H_
#include "config.h"
class INetMessage; class INetMessage;
class CViewSetup; class CViewSetup;
@ -15,7 +16,7 @@ class SDL_Window;
class CatVar; class CatVar;
extern CatVar disconnect_reason; extern CatVar disconnect_reason;
#if ENABLE_VISUALS == 1 #if ENABLE_VISUALS
extern int spectator_target; extern int spectator_target;
#endif #endif
@ -30,7 +31,7 @@ void LevelInit_hook(void *, const char *);
void LevelShutdown_hook(void *); void LevelShutdown_hook(void *);
int RandomInt_hook(void *, int, int); int RandomInt_hook(void *, int, int);
#if ENABLE_NULL_GRAPHICS == 1 #if ENABLE_NULL_GRAPHICS
typedef ITexture *(*FindTexture_t)(void *, const char *, const char *, bool, typedef ITexture *(*FindTexture_t)(void *, const char *, const char *, bool,
int); int);
typedef IMaterial *(*FindMaterialEx_t)(void *, const char *, const char *, int, typedef IMaterial *(*FindMaterialEx_t)(void *, const char *, const char *, int,
@ -60,5 +61,3 @@ typedef IMaterial *(*FindMaterial_t)(void *, const char *, const char *, bool,
// extern unsigned int* swapwindow_ptr; // extern unsigned int* swapwindow_ptr;
// extern unsigned int swapwindow_orig; // extern unsigned int swapwindow_orig;
#endif /* OTHERS_H_ */

View File

@ -5,10 +5,7 @@
* Author: nullifiedcat * Author: nullifiedcat
*/ */
#ifndef HOOVY_HPP_ #pragma once
#define HOOVY_HPP_
void UpdateHoovyList(); void UpdateHoovyList();
bool IsHoovy(CachedEntity *entity); bool IsHoovy(CachedEntity *entity);
#endif /* HOOVY_HPP_ */

View File

@ -5,8 +5,7 @@
* Author: nullifiedcat * Author: nullifiedcat
*/ */
#ifndef INTERFACES_HPP_ #pragma once
#define INTERFACES_HPP_
#include <sharedobj.hpp> #include <sharedobj.hpp>
#include <string> #include <string>
@ -88,5 +87,3 @@ extern IEngineVGui *g_IEngineVGui;
extern IUniformRandomStream *g_pUniformStream; extern IUniformRandomStream *g_pUniformStream;
void CreateInterfaces(); void CreateInterfaces();
#endif /* INTERFACES_HPP_ */

View File

@ -5,10 +5,11 @@
* Author: nullifiedcat * Author: nullifiedcat
*/ */
#if ENABLE_IPC == 1 #pragma once
#ifndef IPC_H_ #include "config.h"
#define IPC_H_
#if ENABLE_IPC
#include "ipcb.hpp" #include "ipcb.hpp"
#include "pthread.h" #include "pthread.h"
@ -112,6 +113,4 @@ void StoreClientData();
void UpdatePlayerlist(); void UpdatePlayerlist();
} }
#endif /* IPC_H_ */
#endif #endif

View File

@ -5,8 +5,7 @@
* Author: nullifiedcat * Author: nullifiedcat
*/ */
#ifndef ITEMTYPES_HPP_ #pragma once
#define ITEMTYPES_HPP_
#include <map> #include <map>
#include <string> #include <string>
@ -230,5 +229,3 @@ public:
}; };
extern ItemManager g_ItemManager; extern ItemManager g_ItemManager;
#endif /* ITEMTYPES_HPP_ */

View File

@ -5,8 +5,7 @@
* Author: nullifiedcat * Author: nullifiedcat
*/ */
#ifndef LOCALPLAYER_HPP_ #pragma once
#define LOCALPLAYER_HPP_
#include <mathlib/vector.h> #include <mathlib/vector.h>
@ -43,5 +42,3 @@ public:
#define LOCAL_W g_pLocalPlayer->weapon() #define LOCAL_W g_pLocalPlayer->weapon()
extern LocalPlayer *g_pLocalPlayer; extern LocalPlayer *g_pLocalPlayer;
#endif /* LOCALPLAYER_HPP_ */

View File

@ -5,8 +5,7 @@
* Author: nullifiedcat * Author: nullifiedcat
*/ */
#ifndef LOGGING_HPP_ #pragma once
#define LOGGING_HPP_
#include <stdio.h> #include <stdio.h>
@ -26,5 +25,3 @@ void Info(const char *fmt, ...);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* LOGGING_HPP_ */

View File

@ -23,9 +23,5 @@ constexpr int c_strcmp(char const *lhs, char const *rhs)
: c_strcmp(lhs + 1, rhs + 1); : c_strcmp(lhs + 1, rhs + 1);
} }
#ifndef DATA_PATH
#define DATA_PATH "/opt/cathook"
#endif
#define FEATURE_RADAR_DISABLED #define FEATURE_RADAR_DISABLED
#define FEATURE_FIDGET_SPINNER_DISABLED #define FEATURE_FIDGET_SPINNER_DISABLED

View File

@ -5,8 +5,7 @@
* Author: nullifiedcat * Author: nullifiedcat
*/ */
#ifndef NETMESSAGE_HPP_ #pragma once
#define NETMESSAGE_HPP_
#include <bitbuf.h> #include <bitbuf.h>
#include <utlvector.h> #include <utlvector.h>
@ -310,5 +309,3 @@ public:
private: private:
char m_szCommandBuffer[1024]; // buffer for received messages char m_szCommandBuffer[1024]; // buffer for received messages
}; };
#endif /* NETMESSAGE_HPP_ */

View File

@ -5,8 +5,7 @@
* Author: nullifiedcat * Author: nullifiedcat
*/ */
#ifndef NETVARS_HPP_ #pragma once
#define NETVARS_HPP_
#include <logging.hpp> #include <logging.hpp>
@ -146,5 +145,3 @@ public:
}; };
extern NetVars netvar; extern NetVars netvar;
#endif /* NETVARS_HPP_ */

View File

@ -5,8 +5,7 @@
* Author: nullifiedcat * Author: nullifiedcat
*/ */
#ifndef OFFSETS_HPP_ #pragma once
#define OFFSETS_HPP_
#include <stdint.h> #include <stdint.h>
#include <exception> #include <exception>
@ -166,5 +165,3 @@ struct offsets
return PlatformOffset(2, undefined, undefined); return PlatformOffset(2, undefined, undefined);
} }
}; };
#endif /* OFFSETS_HPP_ */

Some files were not shown because too many files have changed in this diff Show More