Merge pull request #9 from nullifiedcat/master

Update fork for push
This commit is contained in:
julianacat 2017-07-20 01:19:16 -05:00 committed by GitHub
commit eca4f5d971
14 changed files with 125 additions and 35 deletions

View File

@ -66,7 +66,7 @@ You will want to update these files if you wish to have an updated menu.
## Followbots ## Followbots
`cathook-ipc-server` allows you to run and control Followbots to do your evil bidding in-game. The installation for Followbots is quite complex, and will not be covered on this page. Obviously, you must have several user accounts ready to run TF2. `cathook-ipc-server` allows you to run and control Followbots to do your evil bidding in-game. The installation for Followbots is quite complex, and will not be covered on this page. Obviously, you must have several user accounts ready to run TF2.
A guide for Followbots can be found here: [How to setup and use followbots.](https://www.youtube.com/watch?v=kns5-nw7xUg) A guide for Followbots can be found here: [How to setup followbots.](https://github.com/nullifiedcat/cathook/wiki/Setting-up-Followbots) [How to use followbots.](https://github.com/nullifiedcat/cathook/wiki/Using-Followbots)
You may also ask someone in our discord server to help you out. You may also ask someone in our discord server to help you out.
The installation script is as followed: The installation script is as followed:

View File

@ -1,19 +1,32 @@
ifndef CLANG
CXX=$(shell sh -c "which g++-6 || which g++") CXX=$(shell sh -c "which g++-6 || which g++")
CC=$(shell sh -c "which gcc-6 || which gcc") CC=$(shell sh -c "which gcc-6 || which gcc")
LD=$(CXX)
else
CXX=clang++
CC=clang
LD=ld.lld
endif
DEFINES=_GLIBCXX_USE_CXX11_ABI=0 _POSIX=1 FREETYPE_GL_USE_VAO RAD_TELEMETRY_DISABLED LINUX=1 USE_SDL _LINUX=1 POSIX=1 GNUC=1 NO_MALLOC_OVERRIDE DEFINES=_GLIBCXX_USE_CXX11_ABI=0 _POSIX=1 FREETYPE_GL_USE_VAO RAD_TELEMETRY_DISABLED LINUX=1 USE_SDL _LINUX=1 POSIX=1 GNUC=1 NO_MALLOC_OVERRIDE
WARNING_FLAGS=-pedantic -Wall -Wextra -Wcast-align -Wcast-qual -Wctor-dtor-privacy -Wdisabled-optimization -Wformat=2 -Winit-self -Wlogical-op -Wmissing-declarations -Wmissing-include-dirs -Wnoexcept -Wold-style-cast -Woverloaded-virtual -Wredundant-decls -Wshadow -Wsign-conversion -Wsign-promo -Wstrict-null-sentinel -Wstrict-overflow=5 -Wswitch-default -Wundef WARNING_FLAGS=-pedantic -Wall -Wextra -Wcast-align -Wcast-qual -Wctor-dtor-privacy -Wdisabled-optimization -Wformat=2 -Winit-self -Wlogical-op -Wmissing-declarations -Wmissing-include-dirs -Wnoexcept -Wold-style-cast -Woverloaded-virtual -Wredundant-decls -Wshadow -Wsign-conversion -Wsign-promo -Wstrict-null-sentinel -Wstrict-overflow=5 -Wswitch-default -Wundef
COMMON_FLAGS=-fpermissive -O3 -shared -Wno-unknown-pragmas -fmessage-length=0 -m32 -fvisibility=hidden -fPIC -march=native COMMON_FLAGS=-fpermissive -O3 -shared -Wno-unknown-pragmas -fmessage-length=0 -m32 -fvisibility=hidden -fPIC -march=native -mtune=native
ifdef CLANG
COMMON_FLAGS+=-Wno-c++11-narrowing
endif
ifdef BUILD_DEBUG ifdef BUILD_DEBUG
COMMON_FLAGS+=-g3 -ggdb COMMON_FLAGS+=-g3 -ggdb
else else
ifndef CLANG
COMMON_FLAGS+=-flto COMMON_FLAGS+=-flto
endif endif
endif
CFLAGS=$(COMMON_FLAGS) CFLAGS=$(COMMON_FLAGS)
CXXFLAGS=-std=gnu++1z $(COMMON_FLAGS) CXXFLAGS=-std=gnu++14 $(COMMON_FLAGS)
ifndef NO_WARNINGS ifndef NO_WARNINGS
CFLAGS+=$(WARNING_FLAGS) CFLAGS+=$(WARNING_FLAGS)
@ -27,11 +40,19 @@ SDKFOLDER=$(realpath source-sdk-2013/mp/src)
SIMPLE_IPC_DIR = $(realpath simple-ipc/src/include) SIMPLE_IPC_DIR = $(realpath simple-ipc/src/include)
INCLUDES=-Iucccccp -isystemsrc/freetype-gl -isystemsrc/imgui -isystem/usr/local/include/freetype2 -isystem/usr/include/freetype2 -I$(SIMPLE_IPC_DIR) -isystem$(SDKFOLDER)/public -isystem$(SDKFOLDER)/mathlib -isystem$(SDKFOLDER)/common -isystem$(SDKFOLDER)/public/tier1 -isystem$(SDKFOLDER)/public/tier0 -isystem$(SDKFOLDER) INCLUDES=-Iucccccp -isystemsrc/freetype-gl -isystemsrc/imgui -isystem/usr/local/include/freetype2 -isystem/usr/include/freetype2 -I$(SIMPLE_IPC_DIR) -isystem$(SDKFOLDER)/public -isystem$(SDKFOLDER)/mathlib -isystem$(SDKFOLDER)/common -isystem$(SDKFOLDER)/public/tier1 -isystem$(SDKFOLDER)/public/tier0 -isystem$(SDKFOLDER)
LIB_DIR=lib LIB_DIR=lib
LDFLAGS=-m32 -fno-gnu-unique -D_GLIBCXX_USE_CXX11_ABI=0 -shared -L$(realpath $(LIB_DIR)) LDFLAGS=-shared -L$(realpath $(LIB_DIR))
ifdef CLANG
LDFLAGS+=-melf_i386
else
LDFLAGS+=-m32 -fno-gnu-unique
endif
ifndef BUILD_DEBUG ifndef BUILD_DEBUG
ifndef CLANG
LDFLAGS+=-flto LDFLAGS+=-flto
endif endif
LDLIBS=-static -lc -lstdc++ -ltier0 -lvstdlib -l:libSDL2-2.0.so.0 -static -lGLEW -lfreetype -lpthread endif
LDLIBS=-l:libSDL2-2.0.so.0 -static -l:libc.so.6 -static -l:libstdc++.so.6 -l:libtier0.so -l:libvstdlib.so -static -l:libGLEW.so -l:libfreetype.so
SRC_DIR = src SRC_DIR = src
RES_DIR = res RES_DIR = res
OUT_NAME = libcathook.so OUT_NAME = libcathook.so
@ -126,7 +147,7 @@ src/sdk/utlbuffer.o : CFLAGS+=-w
$(TARGET): $(OBJECTS) $(TARGET): $(OBJECTS)
@echo Building cathook @echo Building cathook
@$(CXX) $(LDFLAGS) $(OBJECTS) $(LDLIBS) -o $(TARGET) $(LD) -o $(TARGET) $(LDFLAGS) $(OBJECTS) $(LDLIBS)
clean: clean:
find src -type f -name '*.o' -delete find src -type f -name '*.o' -delete

@ -1 +1 @@
Subproject commit e532876ffd707a48389d54ff904dcc40a84f2839 Subproject commit 94a287d6faa00d44e1084b04e602842849858443

View File

@ -12,6 +12,74 @@
int CatVar::last_id { 0 }; int CatVar::last_id { 0 };
int rebased_count { 0 };
int GetRebasedCatVarCount() {
return rebased_count;
}
static CatCommand cfg_rebase("cfg_setbase", "Rebase config", []() {
for (auto& cv : CatVarList()) {
std::string value(cv->GetString());
if (value != cv->defaults) {
cv->current_base = value;
rebased_count++;
}
}
logging::Info("Successfully rebased %d variables", rebased_count);
});
static CatCommand cfg_resetbase("cfg_resetbase", "Reset config base", []() {
for (auto& cv : CatVarList()) {
cv->current_base = cv->defaults;
}
rebased_count = 0;
});
static CatCommand save_settings("save", "Save settings (optional filename)", [](const CCommand& args) {
std::string filename("lastcfg");
if (args.ArgC() > 1) {
filename = std::string(args.Arg(1));
}
std::string path = format("tf/cfg/cat_", filename, ".cfg");
logging::Info("Saving settings to %s", path.c_str());
if (GetRebasedCatVarCount()) {
logging::Info("[Warning] %d CatVars are rebased!", GetRebasedCatVarCount());
}
std::ofstream file(path, std::ios::out);
if (file.bad()) {
logging::Info("Couldn't open the file!");
return;
}
for (const auto& i : CatVarList()) {
if (i->GetBase() != std::string(i->GetString())) {
file << CON_PREFIX << i->name << " \"" << i->GetString() << "\"\n";
}
}
file.close();
});
static CatCommand save_settings_complete("save_complete", "Save all settings (optional filename)", [](const CCommand& args) {
std::string filename("lastcfg");
if (args.ArgC() > 1) {
filename = std::string(args.Arg(1));
}
std::string path = format("tf/cfg/cat_", filename, ".cfg");
logging::Info("Saving settings to %s", path.c_str());
if (GetRebasedCatVarCount()) {
logging::Info("[Warning] %d CatVars are rebased!", GetRebasedCatVarCount());
}
std::ofstream file(path, std::ios::out);
if (file.bad()) {
logging::Info("Couldn't open the file!");
return;
}
for (const auto& i : CatVarList()) {
file << CON_PREFIX << i->name << " \"" << i->GetString() << "\"\n";
}
file.close();
});
// Prevent initialization errors. // Prevent initialization errors.
std::vector<CatVar*>& registrationArray() { std::vector<CatVar*>& registrationArray() {
static std::vector<CatVar*> vector; static std::vector<CatVar*> vector;
@ -94,6 +162,7 @@ void CatVar::Register() {
id = last_id++; id = last_id++;
convar = CreateConVar(CON_PREFIX + name, defaults, desc_short); convar = CreateConVar(CON_PREFIX + name, defaults, desc_short);
convar_parent = convar->m_pParent; convar_parent = convar->m_pParent;
current_base = defaults;
while (!callbacks.empty()) { while (!callbacks.empty()) {
callbacks.back()(this); callbacks.back()(this);
callbacks.pop_back(); callbacks.pop_back();

View File

@ -94,6 +94,10 @@ public:
return g_IInputSystem->IsButtonDown(static_cast<ButtonCode_t>(static_cast<int>(*this))); return g_IInputSystem->IsButtonDown(static_cast<ButtonCode_t>(static_cast<int>(*this)));
} }
inline const std::string& GetBase() const {
return current_base;
}
public: public:
const CatVar_t type; const CatVar_t type;
const std::string name; const std::string name;
@ -102,6 +106,8 @@ public:
const std::string desc_long { "" }; const std::string desc_long { "" };
const CatEnum* const enum_type { nullptr }; const CatEnum* const enum_type { nullptr };
std::string current_base { "0" };
bool restricted { false }; bool restricted { false };
float min { 0.0f }; float min { 0.0f };
float max { 0.0f }; float max { 0.0f };
@ -121,5 +127,6 @@ std::vector<CatCommand*>& commandRegistrationArray();
std::vector<CatVar*>& CatVarList(); std::vector<CatVar*>& CatVarList();
void RegisterCatVars(); void RegisterCatVars();
int GetRebasedCatVarCount();
#endif /* CVWRAPPER_H_ */ #endif /* CVWRAPPER_H_ */

View File

@ -7,6 +7,8 @@
#include "Schema.hpp" #include "Schema.hpp"
#include "../../helpers.h"
#include "../../cvwrapper.h" #include "../../cvwrapper.h"
#include "../../logging.h" #include "../../logging.h"
@ -23,13 +25,12 @@ CatVar* FindCatVar(const std::string name) {
ListEntry_Dummy* FromJson(nlohmann::json json) { ListEntry_Dummy* FromJson(nlohmann::json json) {
if (json.is_string()) { if (json.is_string()) {
const std::string var_name = json; const std::string var_name = json;
logging::Info("[Debug] Variable: %s", var_name.c_str());
ListEntry_Dummy* cv; ListEntry_Dummy* cv;
try { try {
cv = (ListEntry_Dummy*)(new ListEntry_Variable(*FindCatVar(var_name))); cv = (ListEntry_Dummy*)(new ListEntry_Variable(*FindCatVar(var_name)));
} catch (std::runtime_error& er) { } catch (std::runtime_error& er) {
logging::Info("[Error] %s", er.what()); logging::Info("[Error] %s", er.what());
cv = (ListEntry_Dummy*)(new ListEntry_Label("malformed object")); cv = (ListEntry_Dummy*)(new ListEntry_Label(format("[", var_name, "]")));
} }
return cv; return cv;
} else if (json.is_object()) { } else if (json.is_object()) {
@ -129,7 +130,7 @@ CatCommand reloadscheme("reloadscheme", "Reload Scheme", []() {
} }
for (const auto& v : CatVarList()) { for (const auto& v : CatVarList()) {
if (map_present.find(v) == map_present.end()) { if (map_present.find(v) == map_present.end()) {
logging::Info("%s is not in any list!", v->name.c_str()); logging::Info("%s is not present in the GUI!", v->name.c_str());
} }
} }
//TraverseList(&main_list); //TraverseList(&main_list);

View File

@ -98,6 +98,8 @@ static CatVar engine_projpred(CV_SWITCH, "debug_aimbot_engine_pp", "0", "Engine
static CatVar auto_spin_up(CV_SWITCH, "aimbot_spin_up", "0", "Auto Spin Up", "Spin up minigun if you can see target, useful for followbots"); static CatVar auto_spin_up(CV_SWITCH, "aimbot_spin_up", "0", "Auto Spin Up", "Spin up minigun if you can see target, useful for followbots");
static CatVar auto_zoom(CV_SWITCH, "aimbot_auto_zoom", "0", "Auto Zoom", "Automatically zoom in if you can see target, useful for followbots"); static CatVar auto_zoom(CV_SWITCH, "aimbot_auto_zoom", "0", "Auto Zoom", "Automatically zoom in if you can see target, useful for followbots");
static CatVar rageonly(CV_SWITCH, "aimbot_rage_only", "0", "Ignore non-rage targets", "Use playerlist to set up rage targets");
// Current Entity // Current Entity
int target_eid { 0 }; int target_eid { 0 };
CachedEntity* target = 0; CachedEntity* target = 0;
@ -357,6 +359,11 @@ bool IsTargetStateGood(CachedEntity* entity) {
if (EffectiveTargetingRange()) { if (EffectiveTargetingRange()) {
if (entity->m_flDistance > EffectiveTargetingRange()) return false; if (entity->m_flDistance > EffectiveTargetingRange()) return false;
} }
if (rageonly) {
if (playerlist::AccessData(entity).state != playerlist::k_EState::RAGE) {
return false;
}
}
IF_GAME (IsTF()) { IF_GAME (IsTF()) {
// If settings allow waiting for charge, and current charge cant kill target, dont aim // If settings allow waiting for charge, and current charge cant kill target, dont aim
if (wait_for_charge && g_pLocalPlayer->holding_sniper_rifle) { if (wait_for_charge && g_pLocalPlayer->holding_sniper_rifle) {

View File

@ -401,6 +401,7 @@ void _FASTCALL ProcessEntity(CachedEntity* ent) {
// only if bTeammatePowerup or bTeammates is true // only if bTeammatePowerup or bTeammates is true
if (legit && ent->m_iTeam != g_pLocalPlayer->team && playerlist::IsDefault(info.friendsID)) { if (legit && ent->m_iTeam != g_pLocalPlayer->team && playerlist::IsDefault(info.friendsID)) {
if (IsPlayerInvisible(ent)) return; if (IsPlayerInvisible(ent)) return;
if (vischeck && !ent->IsVisible()) return;
/*if (ent->m_lLastSeen > (unsigned)v_iLegitSeenTicks->GetInt()) { /*if (ent->m_lLastSeen > (unsigned)v_iLegitSeenTicks->GetInt()) {
return; return;
}*/ }*/

View File

@ -12,7 +12,7 @@ namespace hacks { namespace shared { namespace lagexploit {
CatVar toggle(CV_SWITCH, "removecond_toggle", "0", "Toggle Lag Exploit", "Toggle lag exploit (RemoveCond)"); CatVar toggle(CV_SWITCH, "removecond_toggle", "0", "Toggle Lag Exploit", "Toggle lag exploit (RemoveCond)");
CatVar key(CV_KEY, "removecond_key", "0", "RemoveCond Key"); CatVar key(CV_KEY, "removecond_key", "0", "RemoveCond Key");
CatVar lagMasterSwitch(CV_SWITCH, "removecond_master", "1", "Master Lag Exploit Switch", "Master switch for the lag exploit\nDisabling this disables everything else that uses remove conds"); CatVar lagMasterSwitch(CV_SWITCH, "removecond_master", "1", "Master Lag Exploit Switch", "Master switch for the lag exploit\nDisabling this disables everything else that uses remove conds");
CatVar lagValue(CV_INT, "removecond_value", "450", "RemoveCond Value", "Value of user cmds to spam with"); CatVar lagValue(CV_INT, "removecond_value", "900", "RemoveCond Value", "Value of user cmds to spam with");
CatCommand do_lagexploit("removecond", "RemoveCond (for use in scripts)", []() { CatCommand do_lagexploit("removecond", "RemoveCond (for use in scripts)", []() {
AddExploitTicks(6); AddExploitTicks(6);

View File

@ -491,27 +491,6 @@ CatCommand name("name_set", "Immediate name change", [](const CCommand& args) {
ch->SendNetMsg(setname, false); ch->SendNetMsg(setname, false);
} }
}); });
CatCommand save_settings("save", "Save settings (optional filename)", [](const CCommand& args) {
std::string filename("lastcfg");
if (args.ArgC() > 1) {
filename = std::string(args.Arg(1));
}
std::string path = format("tf/cfg/cat_", filename, ".cfg");
logging::Info("Saving settings to %s", path.c_str());
std::ofstream file(path, std::ios::out);
if (file.bad()) {
logging::Info("Couldn't open the file!");
return;
}
for (const auto& i : RegisteredVarsList()) {
if (i) {
if (strcmp(i->GetString(), i->GetDefault())) {
file << i->GetName() << " \"" << i->GetString() << "\"\n";
}
}
}
file.close();
});
CatCommand say_lines("say_lines", "Say with newlines (\\n)", [](const CCommand& args) { CatCommand say_lines("say_lines", "Say with newlines (\\n)", [](const CCommand& args) {
std::string message(args.ArgS()); std::string message(args.ArgS());
ReplaceString(message, "\\n", "\n"); ReplaceString(message, "\\n", "\n");

View File

@ -27,7 +27,7 @@ static CatVar trigger_key_mode(trigger_key_modes_enum, "trigger_key_mode", "1",
static CatEnum hitbox_mode_enum({ "AUTO-HEAD", "AUTO-CLOSEST", "Head only" }); static CatEnum hitbox_mode_enum({ "AUTO-HEAD", "AUTO-CLOSEST", "Head only" });
static CatVar hitbox_mode(hitbox_mode_enum, "trigger_hitboxmode", "0", "Hitbox Mode", "Defines hitbox selection mode"); static CatVar hitbox_mode(hitbox_mode_enum, "trigger_hitboxmode", "0", "Hitbox Mode", "Defines hitbox selection mode");
static CatVar accuracy(CV_INT, "trigger_accuracy", "0", "Improve accuracy", "Improves triggerbot accuracy when aiming for specific hitbox"); static CatVar accuracy(CV_INT, "trigger_accuracy", "0", "Improve accuracy", "Improves triggerbot accuracy when aiming for specific hitbox. Recommended to use with sniper rifle/ambassador");
static CatVar ignore_vaccinator(CV_SWITCH, "trigger_ignore_vaccinator", "1", "Ignore Vaccinator", "Hitscan weapons won't fire if enemy is vaccinated against bullets"); static CatVar ignore_vaccinator(CV_SWITCH, "trigger_ignore_vaccinator", "1", "Ignore Vaccinator", "Hitscan weapons won't fire if enemy is vaccinated against bullets");
static CatVar ignore_hoovy(CV_SWITCH, "trigger_ignore_hoovy", "1", "Ignore Hoovies", "Triggerbot won't attack hoovies"); static CatVar ignore_hoovy(CV_SWITCH, "trigger_ignore_hoovy", "1", "Ignore Hoovies", "Triggerbot won't attack hoovies");

View File

@ -726,7 +726,10 @@ void PrintChat(const char* fmt, ...) {
vsprintf(buf, fmt, list); vsprintf(buf, fmt, list);
va_end(list); va_end(list);
std::unique_ptr<char> str(strfmt("\x07%06X[\x07%06XCAT\x07%06X]\x01 %s", 0x5e3252, 0xba3d9a, 0x5e3252, buf)); std::unique_ptr<char> str(strfmt("\x07%06X[\x07%06XCAT\x07%06X]\x01 %s", 0x5e3252, 0xba3d9a, 0x5e3252, buf));
// FIXME DEBUG LOG
logging::Info("%s", str.get());
chat->Printf(str.get()); chat->Printf(str.get());
} else {
} }
} }

View File

@ -297,7 +297,8 @@ const char* GetFriendPersonaName_hook(ISteamFriends* _this, CSteamID steamID) {
} }
} }
if ((force_name.convar->m_StringLength > 3) && steamID == g_ISteamUser->GetSteamID()) { if ((strlen(force_name.GetString()) > 1) && steamID == g_ISteamUser->GetSteamID()) {
return force_name_newlined; return force_name_newlined;
} }
return original(_this, steamID); return original(_this, steamID);

View File

@ -135,6 +135,7 @@
"type": "list", "type": "list",
"name": "Triggerbot Preferences", "name": "Triggerbot Preferences",
"list": [ "list": [
"trigger_accuracy",
"trigger_zoomed", "trigger_zoomed",
"trigger_maxrange", "trigger_maxrange",
"trigger_charge", "trigger_charge",