diff --git a/src/cvarspoof.h b/src/cvarspoof.h deleted file mode 100644 index f46eff91..00000000 --- a/src/cvarspoof.h +++ /dev/null @@ -1,18 +0,0 @@ -/* - * cvarspoof.h - * - * Created on: Dec 3, 2016 - * Author: nullifiedcat - */ - -#ifndef CVARSPOOF_H_ -#define CVARSPOOF_H_ - -// TODO - -class SpoofedConVar { -public: - SpoofedConVar(const char* name); -}; - -#endif /* CVARSPOOF_H_ */ diff --git a/src/gui/ncc/Menu.cpp b/src/gui/ncc/Menu.cpp index e4d9ce28..eb879bed 100644 --- a/src/gui/ncc/Menu.cpp +++ b/src/gui/ncc/Menu.cpp @@ -458,6 +458,7 @@ static const std::string list_tf2 = R"( ] "Miscellaneous" [ "Miscellaneous" + "pure_bypass" "antidisguise" "no_arms" "no_hats" diff --git a/src/hooks/PaintTraverse.cpp b/src/hooks/PaintTraverse.cpp index c6241978..0c7f4e89 100644 --- a/src/hooks/PaintTraverse.cpp +++ b/src/hooks/PaintTraverse.cpp @@ -11,12 +11,16 @@ #include "hookedmethods.h" #include "../gui/GUI.h" #include "../segvcatch/segvcatch.h" +#include "../copypasted/CSignature.h" #include "../profiler.h" CatVar clean_screenshots(CV_SWITCH, "clean_screenshots", "1", "Clean screenshots", "Don't draw visuals while taking a screenshot"); CatVar disable_visuals(CV_SWITCH, "no_visuals", "0", "Disable ALL drawing", "Completely hides cathook"); CatVar no_zoom(CV_SWITCH, "no_zoom", "0", "Disable scope", "Disables black scope overlay"); CatVar info_text(CV_SWITCH, "info", "1", "Show info", "Show cathook version in top left corner"); +CatVar pure_bypass(CV_SWITCH, "pure_bypass", "0", "Pure Bypass", "Bypass sv_pure"); +void* pure_orig = nullptr; +void** pure_addr = nullptr; void PaintTraverse_hook(void* p, unsigned int vp, bool fr, bool ar) { #if DEBUG_SEGV == true @@ -31,7 +35,17 @@ void PaintTraverse_hook(void* p, unsigned int vp, bool fr, bool ar) { textures_loaded = true; hacks::tf::radar::Init(); } - + if (pure_bypass) { + if (!pure_addr) { + pure_addr = *reinterpret_cast(gSignatures.GetEngineSignature("55 89 E5 83 EC 18 A1 ? ? ? ? 89 04 24 E8 0D FF FF FF A1 ? ? ? ? 85 C0 74 08 89 04 24 E8 ? ? ? ? C9 C3") + 7); + } + if (*pure_addr) + pure_orig = *pure_addr; + *pure_addr = (void*)0; + } else if (pure_orig) { + *pure_addr = pure_orig; + pure_orig = (void*)0; + } static unsigned long panel_focus = 0; static unsigned long panel_scope = 0; static unsigned long panel_top = 0; diff --git a/src/sconvars.cpp b/src/sconvars.cpp new file mode 100644 index 00000000..903c64b7 --- /dev/null +++ b/src/sconvars.cpp @@ -0,0 +1,38 @@ +/* + * sconvars.cpp + * + * Created on: May 1, 2017 + * Author: nullifiedcat + */ + +#include "sconvars.hpp" + +namespace sconvar { + +std::vector convars; + +SpoofedConVar::SpoofedConVar(ConVar* var) : original(var) { + int flags = var->m_nFlags; + const char* name = var->m_pszName; + char* s_name = strfmt("q_%s", name); + var->m_pszName = s_name; + var->m_nFlags = 0; + ConVar* svar = new ConVar(name, var->m_pszDefaultValue, flags, var->m_pszHelpString, var->m_bHasMin, var->m_fMinVal, var->m_bHasMax, var->m_fMaxVal, var->m_fnChangeCallback); + g_ICvar->RegisterConCommand(svar); + spoof = svar; +} + +CatCommand spoof_convar("spoof", "Spoof ConVar", [](const CCommand& args) { + if (args.ArgC() < 2) { + logging::Info("Invalid call"); + return; + } + ConVar* var = g_ICvar->FindVar(args.Arg(1)); + if (!var) { + logging::Info("Not found"); + return; + } + convars.push_back(new SpoofedConVar(var)); +}); + +} diff --git a/src/sconvars.hpp b/src/sconvars.hpp new file mode 100644 index 00000000..e4338185 --- /dev/null +++ b/src/sconvars.hpp @@ -0,0 +1,30 @@ +/* + * sconvars.hpp + * + * Created on: May 1, 2017 + * Author: nullifiedcat + */ + +#ifndef SCONVARS_HPP_ +#define SCONVARS_HPP_ + +#include "common.h" + +/* + * HECK off F1ssi0N + * I won't make NETWORK HOOKS to deal with this SHIT + */ + +namespace sconvar { + +class SpoofedConVar { +public: + SpoofedConVar(ConVar* var); +public: + ConVar* original; + ConVar* spoof; +}; + +} + +#endif /* SCONVARS_HPP_ */