add cat_spoof + cat_pure_bypass
This commit is contained in:
parent
aaff2a3d8c
commit
d77556d5c9
@ -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_ */
|
@ -458,6 +458,7 @@ static const std::string list_tf2 = R"(
|
||||
]
|
||||
"Miscellaneous" [
|
||||
"Miscellaneous"
|
||||
"pure_bypass"
|
||||
"antidisguise"
|
||||
"no_arms"
|
||||
"no_hats"
|
||||
|
@ -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<void***>(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;
|
||||
|
38
src/sconvars.cpp
Normal file
38
src/sconvars.cpp
Normal file
@ -0,0 +1,38 @@
|
||||
/*
|
||||
* sconvars.cpp
|
||||
*
|
||||
* Created on: May 1, 2017
|
||||
* Author: nullifiedcat
|
||||
*/
|
||||
|
||||
#include "sconvars.hpp"
|
||||
|
||||
namespace sconvar {
|
||||
|
||||
std::vector<SpoofedConVar*> 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));
|
||||
});
|
||||
|
||||
}
|
30
src/sconvars.hpp
Normal file
30
src/sconvars.hpp
Normal file
@ -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_ */
|
Reference in New Issue
Block a user