diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt index fb289fd6..e14e12a5 100644 --- a/include/CMakeLists.txt +++ b/include/CMakeLists.txt @@ -53,7 +53,8 @@ target_sources(cathook PRIVATE "${CMAKE_CURRENT_LIST_DIR}/velocity.hpp" "${CMAKE_CURRENT_LIST_DIR}/vfunc.hpp" "${CMAKE_CURRENT_LIST_DIR}/votelogger.hpp" - "${CMAKE_CURRENT_LIST_DIR}/xorstring.hpp") + "${CMAKE_CURRENT_LIST_DIR}/xorstring.hpp" + "${CMAKE_CURRENT_LIST_DIR}/MiscTemporary.hpp") target_include_directories(cathook PRIVATE "${CMAKE_CURRENT_LIST_DIR}") diff --git a/include/MiscTemporary.hpp b/include/MiscTemporary.hpp new file mode 100644 index 00000000..eeb9786d --- /dev/null +++ b/include/MiscTemporary.hpp @@ -0,0 +1,24 @@ +/* + Created by Jenny White on 29.04.18. + Copyright (c) 2018 nullworks. All rights reserved. +*/ + +#pragma once + +#include "common.hpp" + +// This is a temporary file to put code that needs moving/refactoring in. + +extern bool *bSendPackets; +extern CatVar no_zoom; +extern CatVar clean_screenshots; +extern CatVar disable_visuals; +extern CatVar disconnect_reason; +#if ENABLE_VISUALS +extern int spectator_target; +#endif + +extern SDL_Window *sdl_current_window; + +void DoSDLHooking(); +void DoSDLUnhooking(); \ No newline at end of file diff --git a/include/hooks/HookedMethods.hpp b/include/hooks/HookedMethods.hpp index 659e88ef..d45553fa 100644 --- a/include/hooks/HookedMethods.hpp +++ b/include/hooks/HookedMethods.hpp @@ -9,17 +9,9 @@ #include "common.hpp" -extern bool *bSendPackets; -extern CatVar no_zoom; -extern CatVar clean_screenshots; -extern CatVar disable_visuals; -extern CatVar disconnect_reason; -#if ENABLE_VISUALS -extern int spectator_target; -#endif - #if ENABLE_VISUALS union SDL_Event; +struct SDL_Window; #endif namespace hooked_methods @@ -42,10 +34,6 @@ using GetUserCmd = CUserCmd *(*)(IInput *, int); using SendNetMsg = bool(*)(INetChannel *, INetMessage &, bool, bool); using CanPacket = bool(*)(INetChannel *); using Shutdown = void(*)(INetChannel *, const char *); -// CBaseClientState -using GetClientName = const char *(*)(CBaseClientState *); -using ProcessSetConVar = bool(*)(CBaseClientState *, NET_SetConVar *); -using ProcessGetCvarValue = bool(*)(CBaseClientState *, SVC_GetCvarValue *); // ISteamFriends using GetFriendPersonaName = const char *(*)(ISteamFriends *, CSteamID); // IEngineVGui @@ -88,10 +76,6 @@ CUserCmd *GetUserCmd(IInput *, int); bool SendNetMsg(INetChannel *, INetMessage &, bool, bool); bool CanPacket(INetChannel *); void Shutdown(INetChannel *, const char *); -// CBaseClientState -const char *GetClientName(CBaseClientState *_this); -bool ProcessSetConVar(CBaseClientState *_this, NET_SetConVar *msg); -bool ProcessGetCvarValue(CBaseClientState *_this, SVC_GetCvarValue *msg); // ISteamFriends const char *GetFriendPersonaName(ISteamFriends *_this, CSteamID steamID); // IEngineVGui @@ -120,20 +104,6 @@ int RandomInt(void *, int, int); } -#if ENABLE_VISUALS - -/* SDL HOOKS */ -union SDL_Event; -class SDL_Window; - -extern SDL_Window *sdl_current_window; - - - -void DoSDLHooking(); -void DoSDLUnhooking(); -#endif - // TODO // wontfix.club diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 4b38b43f..e23bd60e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -39,7 +39,8 @@ target_sources(cathook PRIVATE "${CMAKE_CURRENT_LIST_DIR}/trace.cpp" "${CMAKE_CURRENT_LIST_DIR}/ucccccp_cmds.cpp" "${CMAKE_CURRENT_LIST_DIR}/velocity.cpp" - "${CMAKE_CURRENT_LIST_DIR}/votelogger.cpp") + "${CMAKE_CURRENT_LIST_DIR}/votelogger.cpp" + "${CMAKE_CURRENT_LIST_DIR}/MiscTemporary.cpp") add_subdirectory(classinfo) add_subdirectory(copypasted) diff --git a/src/MiscTemporary.cpp b/src/MiscTemporary.cpp new file mode 100644 index 00000000..b04eebc0 --- /dev/null +++ b/src/MiscTemporary.cpp @@ -0,0 +1,30 @@ +/* + Created by Jenny White on 29.04.18. + Copyright (c) 2018 nullworks. All rights reserved. +*/ + +#include "MiscTemporary.hpp" + +CatVar minigun_jump(CV_SWITCH, "minigun_jump", "0", "TF2C minigun jump", + "Allows jumping while shooting with minigun"); + +CatVar jointeam(CV_SWITCH, "fb_autoteam", "1", + "Joins player team automatically (NYI)"); +CatVar joinclass(CV_STRING, "fb_autoclass", "spy", + "Class that will be picked after joining a team (NYI)"); + +CatVar nolerp(CV_SWITCH, "nolerp", "0", "NoLerp mode (experimental)"); + +CatVar engine_pred(CV_SWITCH, "engine_prediction", "0", + "Engine Prediction"); +CatVar debug_projectiles(CV_SWITCH, "debug_projectiles", "0", + "Debug Projectiles"); + +CatVar fakelag_amount(CV_INT, "fakelag", "0", "Bad Fakelag"); +CatVar serverlag_amount( + CV_INT, "serverlag", "0", "serverlag", + "Lag the server by spamming this many voicecommands per tick"); +CatVar semiauto(CV_INT, "semiauto", "0", "Semiauto"); +CatVar servercrash(CV_SWITCH, "servercrash", "0", "crash servers", + "Crash servers by spamming signon net messages"); +bool *bSendPackets; \ No newline at end of file diff --git a/src/hooks/CanPacket.cpp b/src/hooks/CanPacket.cpp new file mode 100644 index 00000000..06767b3e --- /dev/null +++ b/src/hooks/CanPacket.cpp @@ -0,0 +1,6 @@ +/* + Created by Jenny White on 29.04.18. + Copyright (c) 2018 nullworks. All rights reserved. +*/ + +#include "HookedMethods.hpp" \ No newline at end of file diff --git a/src/hooks/CreateMove.cpp b/src/hooks/CreateMove.cpp index 6c045fae..2521db6e 100644 --- a/src/hooks/CreateMove.cpp +++ b/src/hooks/CreateMove.cpp @@ -10,16 +10,6 @@ #include -static CatVar minigun_jump(CV_SWITCH, "minigun_jump", "0", "TF2C minigun jump", - "Allows jumping while shooting with minigun"); - -CatVar jointeam(CV_SWITCH, "fb_autoteam", "1", - "Joins player team automatically (NYI)"); -CatVar joinclass(CV_STRING, "fb_autoclass", "spy", - "Class that will be picked after joining a team (NYI)"); - -CatVar nolerp(CV_SWITCH, "nolerp", "0", "NoLerp mode (experimental)"); - class CMoveData; namespace engine_prediction { @@ -105,19 +95,7 @@ void End() { }*/ } -static CatVar engine_pred(CV_SWITCH, "engine_prediction", "0", - "Engine Prediction"); -static CatVar debug_projectiles(CV_SWITCH, "debug_projectiles", "0", - "Debug Projectiles"); -static CatVar fakelag_amount(CV_INT, "fakelag", "0", "Bad Fakelag"); -static CatVar serverlag_amount( - CV_INT, "serverlag", "0", "serverlag", - "Lag the server by spamming this many voicecommands per tick"); -CatVar semiauto(CV_INT, "semiauto", "0", "Semiauto"); -CatVar servercrash(CV_SWITCH, "servercrash", "0", "crash servers", - "Crash servers by spamming signon net messages"); -bool *bSendPackets; bool CreateMove_hook(void *thisptr, float inputSample, CUserCmd *cmd) { uintptr_t **fp; diff --git a/src/hooks/DispatchUserMessage.cpp b/src/hooks/DispatchUserMessage.cpp new file mode 100644 index 00000000..06767b3e --- /dev/null +++ b/src/hooks/DispatchUserMessage.cpp @@ -0,0 +1,6 @@ +/* + Created by Jenny White on 29.04.18. + Copyright (c) 2018 nullworks. All rights reserved. +*/ + +#include "HookedMethods.hpp" \ No newline at end of file diff --git a/src/hooks/FireGameEvent.cpp b/src/hooks/FireGameEvent.cpp new file mode 100644 index 00000000..06767b3e --- /dev/null +++ b/src/hooks/FireGameEvent.cpp @@ -0,0 +1,6 @@ +/* + Created by Jenny White on 29.04.18. + Copyright (c) 2018 nullworks. All rights reserved. +*/ + +#include "HookedMethods.hpp" \ No newline at end of file diff --git a/src/hooks/GetFriendPersonaName.cpp b/src/hooks/GetFriendPersonaName.cpp new file mode 100644 index 00000000..06767b3e --- /dev/null +++ b/src/hooks/GetFriendPersonaName.cpp @@ -0,0 +1,6 @@ +/* + Created by Jenny White on 29.04.18. + Copyright (c) 2018 nullworks. All rights reserved. +*/ + +#include "HookedMethods.hpp" \ No newline at end of file diff --git a/src/hooks/GetUserCmd.cpp b/src/hooks/GetUserCmd.cpp new file mode 100644 index 00000000..06767b3e --- /dev/null +++ b/src/hooks/GetUserCmd.cpp @@ -0,0 +1,6 @@ +/* + Created by Jenny White on 29.04.18. + Copyright (c) 2018 nullworks. All rights reserved. +*/ + +#include "HookedMethods.hpp" \ No newline at end of file diff --git a/src/hooks/IN_KeyEvent.cpp b/src/hooks/IN_KeyEvent.cpp new file mode 100644 index 00000000..06767b3e --- /dev/null +++ b/src/hooks/IN_KeyEvent.cpp @@ -0,0 +1,6 @@ +/* + Created by Jenny White on 29.04.18. + Copyright (c) 2018 nullworks. All rights reserved. +*/ + +#include "HookedMethods.hpp" \ No newline at end of file diff --git a/src/hooks/LevelInit.cpp b/src/hooks/LevelInit.cpp new file mode 100644 index 00000000..06767b3e --- /dev/null +++ b/src/hooks/LevelInit.cpp @@ -0,0 +1,6 @@ +/* + Created by Jenny White on 29.04.18. + Copyright (c) 2018 nullworks. All rights reserved. +*/ + +#include "HookedMethods.hpp" \ No newline at end of file diff --git a/src/hooks/LevelShutdown.cpp b/src/hooks/LevelShutdown.cpp new file mode 100644 index 00000000..06767b3e --- /dev/null +++ b/src/hooks/LevelShutdown.cpp @@ -0,0 +1,6 @@ +/* + Created by Jenny White on 29.04.18. + Copyright (c) 2018 nullworks. All rights reserved. +*/ + +#include "HookedMethods.hpp" \ No newline at end of file diff --git a/src/hooks/SendNetMsg.cpp b/src/hooks/SendNetMsg.cpp new file mode 100644 index 00000000..06767b3e --- /dev/null +++ b/src/hooks/SendNetMsg.cpp @@ -0,0 +1,6 @@ +/* + Created by Jenny White on 29.04.18. + Copyright (c) 2018 nullworks. All rights reserved. +*/ + +#include "HookedMethods.hpp" \ No newline at end of file diff --git a/src/hooks/Shutdown.cpp b/src/hooks/Shutdown.cpp new file mode 100644 index 00000000..06767b3e --- /dev/null +++ b/src/hooks/Shutdown.cpp @@ -0,0 +1,6 @@ +/* + Created by Jenny White on 29.04.18. + Copyright (c) 2018 nullworks. All rights reserved. +*/ + +#include "HookedMethods.hpp" \ No newline at end of file diff --git a/src/hooks/visual/BeginFrame.cpp b/src/hooks/visual/BeginFrame.cpp new file mode 100644 index 00000000..06767b3e --- /dev/null +++ b/src/hooks/visual/BeginFrame.cpp @@ -0,0 +1,6 @@ +/* + Created by Jenny White on 29.04.18. + Copyright (c) 2018 nullworks. All rights reserved. +*/ + +#include "HookedMethods.hpp" \ No newline at end of file diff --git a/src/hooks/visual/DrawModelExecute.cpp b/src/hooks/visual/DrawModelExecute.cpp new file mode 100644 index 00000000..06767b3e --- /dev/null +++ b/src/hooks/visual/DrawModelExecute.cpp @@ -0,0 +1,6 @@ +/* + Created by Jenny White on 29.04.18. + Copyright (c) 2018 nullworks. All rights reserved. +*/ + +#include "HookedMethods.hpp" \ No newline at end of file diff --git a/src/hooks/visual/FrameStageNotify.cpp b/src/hooks/visual/FrameStageNotify.cpp new file mode 100644 index 00000000..06767b3e --- /dev/null +++ b/src/hooks/visual/FrameStageNotify.cpp @@ -0,0 +1,6 @@ +/* + Created by Jenny White on 29.04.18. + Copyright (c) 2018 nullworks. All rights reserved. +*/ + +#include "HookedMethods.hpp" \ No newline at end of file diff --git a/src/hooks/visual/OverrideView.cpp b/src/hooks/visual/OverrideView.cpp new file mode 100644 index 00000000..06767b3e --- /dev/null +++ b/src/hooks/visual/OverrideView.cpp @@ -0,0 +1,6 @@ +/* + Created by Jenny White on 29.04.18. + Copyright (c) 2018 nullworks. All rights reserved. +*/ + +#include "HookedMethods.hpp" \ No newline at end of file diff --git a/src/hooks/visual/PaintTraverse.cpp b/src/hooks/visual/PaintTraverse.cpp new file mode 100644 index 00000000..06767b3e --- /dev/null +++ b/src/hooks/visual/PaintTraverse.cpp @@ -0,0 +1,6 @@ +/* + Created by Jenny White on 29.04.18. + Copyright (c) 2018 nullworks. All rights reserved. +*/ + +#include "HookedMethods.hpp" \ No newline at end of file diff --git a/src/hooks/visual/RandomInt.cpp b/src/hooks/visual/RandomInt.cpp new file mode 100644 index 00000000..06767b3e --- /dev/null +++ b/src/hooks/visual/RandomInt.cpp @@ -0,0 +1,6 @@ +/* + Created by Jenny White on 29.04.18. + Copyright (c) 2018 nullworks. All rights reserved. +*/ + +#include "HookedMethods.hpp" \ No newline at end of file diff --git a/src/hooks/visual/SDL_GL_SwapWindow.cpp b/src/hooks/visual/SDL_GL_SwapWindow.cpp new file mode 100644 index 00000000..06767b3e --- /dev/null +++ b/src/hooks/visual/SDL_GL_SwapWindow.cpp @@ -0,0 +1,6 @@ +/* + Created by Jenny White on 29.04.18. + Copyright (c) 2018 nullworks. All rights reserved. +*/ + +#include "HookedMethods.hpp" \ No newline at end of file diff --git a/src/hooks/visual/SDL_PollEvent.cpp b/src/hooks/visual/SDL_PollEvent.cpp new file mode 100644 index 00000000..06767b3e --- /dev/null +++ b/src/hooks/visual/SDL_PollEvent.cpp @@ -0,0 +1,6 @@ +/* + Created by Jenny White on 29.04.18. + Copyright (c) 2018 nullworks. All rights reserved. +*/ + +#include "HookedMethods.hpp" \ No newline at end of file diff --git a/src/menu.tar.xz b/src/menu.tar.xz deleted file mode 100644 index d3cbc9b6..00000000 Binary files a/src/menu.tar.xz and /dev/null differ