Add skybox changer

This commit is contained in:
BenCat07 2018-04-06 12:43:29 +02:00
parent 2a5f063aba
commit f7f8a1ad9f
15 changed files with 130 additions and 43 deletions

1
include/hooks/hookedmethods.hpp Executable file → Normal file
View File

@ -21,6 +21,7 @@ typedef bool (*DispatchUserMessage_t)(void *, int, bf_read &);
typedef void (*FrameStageNotify_t)(void *, int); typedef void (*FrameStageNotify_t)(void *, int);
typedef void (*LevelInit_t)(void *, const char *); typedef void (*LevelInit_t)(void *, const char *);
typedef void (*LevelShutdown_t)(void *); typedef void (*LevelShutdown_t)(void *);
typedef void (*BeginFrame_t)(IStudioRender *); typedef void (*BeginFrame_t)(IStudioRender *);
typedef bool (*CanInspect_t)(IClientEntity *); typedef bool (*CanInspect_t)(IClientEntity *);
typedef void (*DrawModelExecute_t)(IVModelRender *, const DrawModelState_t &, typedef void (*DrawModelExecute_t)(IVModelRender *, const DrawModelState_t &,

View File

@ -21,6 +21,7 @@ public:
static bool BCanQueueForStandby(CTFPartyClient *this_); static bool BCanQueueForStandby(CTFPartyClient *this_);
char RequestQueueForMatch(int type); char RequestQueueForMatch(int type);
char RequestLeaveForMatch(int type); char RequestLeaveForMatch(int type);
int BInvitePlayerToParty(int steamid);
static bool BInQueue(CTFPartyClient *this_); static bool BInQueue(CTFPartyClient *this_);
}; };
} }

18
include/reclasses/ITFGroupMatchCriteria.hpp Executable file → Normal file
View File

@ -17,15 +17,15 @@ class ITFGroupMatchCriteria
public: public:
enum group enum group
{ {
MvmPractice = 0, MvmPractice = 0,
MvmMannup = 1, MvmMannup = 1,
LadderMatch6v6 = 2, LadderMatch6v6 = 2,
LadderMatch9v9 = 3, LadderMatch9v9 = 3,
LadderMatch12v12 = 4, LadderMatch12v12 = 4,
CasualMatch6v6 = 5, CasualMatch6v6 = 5,
CasualMatch9v9 = 6, CasualMatch9v9 = 6,
CasualMatch12v12 = 7, CasualMatch12v12 = 7,
CompetitiveEventMatch12v12 = 8 CompetitiveEventMatch12v12 = 8
}; };
public: public:

View File

@ -14,7 +14,8 @@
CatVar enable_spinner(CV_SWITCH, "fidgetspinner", "0", "Fidget Spinner", CatVar enable_spinner(CV_SWITCH, "fidgetspinner", "0", "Fidget Spinner",
"Part of Cathook Autism Awareness program"); "Part of Cathook Autism Awareness program");
CatVar v9mode(CV_SWITCH, "nullcore_mode", "0", "Nullcore mode", "Part of Cathook Autism Awareness program"); CatVar v9mode(CV_SWITCH, "nullcore_mode", "0", "Nullcore mode",
"Part of Cathook Autism Awareness program");
float spinning_speed = 0.0f; float spinning_speed = 0.0f;
float angle = 0; float angle = 0;
@ -96,7 +97,8 @@ void DrawSpinner()
while (!tex) while (!tex)
tex = glez_texture_load_png_rgba("/opt/cathook/data/res/atlas.png"); tex = glez_texture_load_png_rgba("/opt/cathook/data/res/atlas.png");
glez_rect_textured(draw::width / 2, draw::height / 2, size, size, color, glez_rect_textured(draw::width / 2, draw::height / 2, size, size, color,
tex, 0 + 64 * state, (3 + (v9mode ? 1 : 0)) * 64, 64, 64, angle); tex, 0 + 64 * state, (3 + (v9mode ? 1 : 0)) * 64, 64, 64,
angle);
if (angle > PI * 4) if (angle > PI * 4)
angle -= PI * 4; angle -= PI * 4;
} }

View File

@ -211,7 +211,6 @@ free(logname);*/
EndConVars(); EndConVars();
#if ENABLE_VISUALS == 1 #if ENABLE_VISUALS == 1
draw::Initialize(); draw::Initialize();
#if ENABLE_GUI #if ENABLE_GUI

5
src/hacks/AutoJoin.cpp Executable file → Normal file
View File

@ -28,6 +28,8 @@ CatVar preferred_class(classes_enum, "autojoin_class", "0", "AutoJoin class",
CatVar auto_queue(CV_SWITCH, "autoqueue", "0", "AutoQueue", CatVar auto_queue(CV_SWITCH, "autoqueue", "0", "AutoQueue",
"Automatically queue in casual matches"); "Automatically queue in casual matches");
CatVar party_bypass(CV_SWITCH, "party_bypass", "1", "Party bypass",
"Bypass Join block when not friended");
const std::string classnames[] = { "scout", "sniper", "soldier", const std::string classnames[] = { "scout", "sniper", "soldier",
"demoman", "medic", "heavyweapons", "demoman", "medic", "heavyweapons",
@ -53,7 +55,7 @@ void UpdateSearch()
return; return;
if (g_pUserCmd) if (g_pUserCmd)
tfmm::queue_leave(); tfmm::queue_leave();
if (autoqueue_timer.test_and_set(30000)) if (autoqueue_timer.test_and_set(30000))
{ {
re::CTFGCClientSystem *gc = re::CTFGCClientSystem::GTFGCClientSystem(); re::CTFGCClientSystem *gc = re::CTFGCClientSystem::GTFGCClientSystem();
@ -66,7 +68,6 @@ void UpdateSearch()
} }
Timer timer{}; Timer timer{};
void Update() void Update()
{ {
if (timer.test_and_set(500)) if (timer.test_and_set(500))

20
src/hacks/ESP.cpp Executable file → Normal file
View File

@ -393,7 +393,7 @@ void _FASTCALL emoji(CachedEntity *ent)
float size = emoji_esp_scaling ? fabs(hbm.y - hbx.y) float size = emoji_esp_scaling ? fabs(hbm.y - hbx.y)
: float(emoji_esp_size); : float(emoji_esp_size);
if (v9mode) if (v9mode)
size *= 1.4; size *= 1.4;
if (!size || !float(emoji_min_size)) if (!size || !float(emoji_min_size))
return; return;
if (emoji_esp_scaling && (size < float(emoji_min_size))) if (emoji_esp_scaling && (size < float(emoji_min_size)))
@ -401,7 +401,7 @@ void _FASTCALL emoji(CachedEntity *ent)
size = float(emoji_min_size); size = float(emoji_min_size);
} }
glez_rgba_t white = glez_rgba(255, 255, 255, 255); glez_rgba_t white = glez_rgba(255, 255, 255, 255);
while (!textur) while (!textur)
textur = glez_texture_load_png_rgba( textur = glez_texture_load_png_rgba(
"/opt/cathook/data/res/atlas.png"); "/opt/cathook/data/res/atlas.png");
player_info_s info; player_info_s info;
@ -432,18 +432,18 @@ void _FASTCALL emoji(CachedEntity *ent)
"/opt/cathook/data/res/idspec.png"); "/opt/cathook/data/res/idspec.png");
if (idspecific) if (idspecific)
glez_rect_textured(head_scr.x - size / 2, glez_rect_textured(head_scr.x - size / 2,
head_scr.y - size / 2, head_scr.y - size / 2, size,
size, size, white, size, white, idspecific,
idspecific, i * 64, i * 64, 1 * 64, 64, 64, 0);
1 * 64, 64, 64, 0);
hascall = true; hascall = true;
} }
} }
if (textur && !hascall) if (textur && !hascall)
draw_api::draw_rect_textured(head_scr.x - size / 2, draw_api::draw_rect_textured(
head_scr.y - size / 2, size, head_scr.x - size / 2, head_scr.y - size / 2, size,
size, colors::white, {textur}, (3 + (v9mode ? 3 : (int)emoji_esp)) * 64, size, colors::white, { textur },
3 * 64, 64, 64, 0); (3 + (v9mode ? 3 : (int) emoji_esp)) * 64, 3 * 64,
64, 64, 0);
} }
} }
} }

View File

@ -96,6 +96,7 @@ VMTHook baseclientstate8{};
VMTHook clientmode{}; VMTHook clientmode{};
VMTHook panel{}; VMTHook panel{};
VMTHook client{}; VMTHook client{};
VMTHook ctfpartyclient;
VMTHook netchannel{}; VMTHook netchannel{};
VMTHook clientdll{}; VMTHook clientdll{};
VMTHook matsurface{}; VMTHook matsurface{};

0
src/hooks/PaintTraverse.cpp Executable file → Normal file
View File

73
src/hooks/others.cpp Executable file → Normal file
View File

@ -895,12 +895,83 @@ bool DispatchUserMessage_hook(void *_this, int type, bf_read &buf)
votelogger::user_message(buf, type); votelogger::user_message(buf, type);
return original(_this, type, buf); return original(_this, type, buf);
} }
const char *skynum[] = { "sky_tf2_04",
"sky_upward",
"sky_dustbowl_01",
"sky_goldrush_01",
"sky_granary_01",
"sky_well_01",
"sky_gravel_01",
"sky_badlands_01",
"sky_hydro_01",
"sky_night_01",
"sky_nightfall_01",
"sky_trainyard_01",
"sky_stormfront_01",
"sky_morningsnow_01",
"sky_alpinestorm_01",
"sky_harvest_01",
"sky_harvest_night_01",
"sky_halloween",
"sky_halloween_night_01",
"sky_halloween_night2014_01",
"sky_island_01",
"sky_jungle_01",
"sky_invasion2fort_01",
"sky_well_02",
"sky_outpost_01",
"sky_coastal_01",
"sky_rainbow_01",
"sky_badlands_pyroland_01",
"sky_pyroland_01",
"sky_pyroland_02",
"sky_pyroland_03" };
CatEnum skys({ "sky_tf2_04",
"sky_upward",
"sky_dustbowl_01",
"sky_goldrush_01",
"sky_granary_01",
"sky_well_01",
"sky_gravel_01",
"sky_badlands_01",
"sky_hydro_01",
"sky_night_01",
"sky_nightfall_01",
"sky_trainyard_01",
"sky_stormfront_01",
"sky_morningsnow_01",
"sky_alpinestorm_01",
"sky_harvest_01",
"sky_harvest_night_01",
"sky_halloween",
"sky_halloween_night_01",
"sky_halloween_night2014_01",
"sky_island_01",
"sky_jungle_01",
"sky_invasion2fort_01",
"sky_well_02",
"sky_outpost_01",
"sky_coastal_01",
"sky_rainbow_01",
"sky_badlands_pyroland_01",
"sky_pyroland_01",
"sky_pyroland_02",
"sky_pyroland_03" });
static CatVar skybox_changer(skys, "skybox_changer", "0", "Change Skybox to this skybox",
"Change Skybox to this skybox, only changes on map load");
void LevelInit_hook(void *_this, const char *newmap) void LevelInit_hook(void *_this, const char *newmap)
{ {
static const LevelInit_t original = static const LevelInit_t original =
(LevelInit_t) hooks::clientmode.GetMethod(offsets::LevelInit()); (LevelInit_t) hooks::clientmode.GetMethod(offsets::LevelInit());
playerlist::Save(); playerlist::Save();
typedef bool *(*LoadNamedSkys_Fn)(const char *);
uintptr_t addr =
gSignatures.GetEngineSignature("55 89 E5 57 31 FF 56 8D B5 ? ? ? ? 53 "
"81 EC ? ? ? ? C7 85 ? ? ? ? ? ? ? ?");
static LoadNamedSkys_Fn LoadNamedSkys = LoadNamedSkys_Fn(addr);
bool load_success = LoadNamedSkys(skynum[(int)skybox_changer]);
logging::Info("Skybox Loading successful: %s",
load_success ? "true" : "false");
g_IEngine->ClientCmd_Unrestricted("exec cat_matchexec"); g_IEngine->ClientCmd_Unrestricted("exec cat_matchexec");
hacks::shared::aimbot::Reset(); hacks::shared::aimbot::Reset();
chat_stack::Reset(); chat_stack::Reset();

View File

@ -653,6 +653,7 @@ static const std::string list_tf2 = R"(
] ]
"Misc" [ "Misc" [
"Misc Menu" "Misc Menu"
"skybox_changer"
"name" "name"
"disconnect_reason" "disconnect_reason"
"pure_bypass" "pure_bypass"
@ -725,6 +726,7 @@ static const std::string list_tf2 = R"(
"Automated" [ "Automated" [
"Automated Menu" "Automated Menu"
"autoqueue" "autoqueue"
"autoqueue_mode"
"autojoin_team" "autojoin_team"
"autojoin_class" "autojoin_class"
"autotaunt" "autotaunt"

10
src/reclasses/CTFGCClientSystem.cpp Executable file → Normal file
View File

@ -14,7 +14,8 @@ CTFGCClientSystem *CTFGCClientSystem::GTFGCClientSystem()
{ {
typedef CTFGCClientSystem *(*GTFGCClientSystem_t)(); typedef CTFGCClientSystem *(*GTFGCClientSystem_t)();
static uintptr_t addr1 = gSignatures.GetClientSignature( static uintptr_t addr1 = gSignatures.GetClientSignature(
"55 B8 ? ? ? ? 89 E5 5D C3 8D B6 00 00 00 00 55 A1 ? ? ? ? 89 E5 5D C3 8D B6 00 00 00 00 A1 ? ? ? ?"); "55 B8 ? ? ? ? 89 E5 5D C3 8D B6 00 00 00 00 55 A1 ? ? ? ? 89 E5 5D C3 "
"8D B6 00 00 00 00 A1 ? ? ? ?");
static GTFGCClientSystem_t GTFGCClientSystem_fn = static GTFGCClientSystem_t GTFGCClientSystem_fn =
GTFGCClientSystem_t(addr1); GTFGCClientSystem_t(addr1);
@ -38,8 +39,8 @@ void CTFGCClientSystem::AbandonCurrentMatch()
bool CTFGCClientSystem::BConnectedToMatchServer(bool flag) bool CTFGCClientSystem::BConnectedToMatchServer(bool flag)
{ {
typedef bool (*BConnectedToMatchServer_t)(CTFGCClientSystem *, bool); typedef bool (*BConnectedToMatchServer_t)(CTFGCClientSystem *, bool);
static uintptr_t addr = gSignatures.GetClientSignature( static uintptr_t addr =
"55 89 E5 53 80 7D ? ? 8B 55 ? 75 ?"); gSignatures.GetClientSignature("55 89 E5 53 80 7D ? ? 8B 55 ? 75 ?");
static BConnectedToMatchServer_t BConnectedToMatchServer_fn = static BConnectedToMatchServer_t BConnectedToMatchServer_fn =
BConnectedToMatchServer_t(addr); BConnectedToMatchServer_t(addr);
@ -49,7 +50,8 @@ bool CTFGCClientSystem::BConnectedToMatchServer(bool flag)
bool CTFGCClientSystem::BHaveLiveMatch() bool CTFGCClientSystem::BHaveLiveMatch()
{ {
typedef int (*BHaveLiveMatch_t)(CTFGCClientSystem *); typedef int (*BHaveLiveMatch_t)(CTFGCClientSystem *);
static uintptr_t addr = gSignatures.GetClientSignature("55 31 C0 89 E5 53 8B 4D ? 0F B6 91 ? ? ? ?"); static uintptr_t addr = gSignatures.GetClientSignature(
"55 31 C0 89 E5 53 8B 4D ? 0F B6 91 ? ? ? ?");
static BHaveLiveMatch_t BHaveLiveMatch_fn = BHaveLiveMatch_t(addr); static BHaveLiveMatch_t BHaveLiveMatch_fn = BHaveLiveMatch_t(addr);
if (BHaveLiveMatch_fn == nullptr) if (BHaveLiveMatch_fn == nullptr)
{ {

View File

@ -11,10 +11,9 @@
re::CTFPartyClient *re::CTFPartyClient::GTFPartyClient() re::CTFPartyClient *re::CTFPartyClient::GTFPartyClient()
{ {
typedef re::CTFPartyClient *(*GTFPartyClient_t)(void); typedef re::CTFPartyClient *(*GTFPartyClient_t)(void);
uintptr_t addr = uintptr_t addr = gSignatures.GetClientSignature(
gSignatures.GetClientSignature("55 A1 ? ? ? ? 89 E5 5D C3 8D B6 00 00 00 00 A1 ? ? ? ? 85 C0"); "55 A1 ? ? ? ? 89 E5 5D C3 8D B6 00 00 00 00 A1 ? ? ? ? 85 C0");
GTFPartyClient_t GTFPartyClient_fn = GTFPartyClient_t GTFPartyClient_fn = GTFPartyClient_t(addr);
GTFPartyClient_t(addr);
return GTFPartyClient_fn(); return GTFPartyClient_fn();
} }
@ -59,7 +58,7 @@ int re::CTFPartyClient::LoadSavedCasualCriteria()
{ {
typedef int (*LoadSavedCasualCriteria_t)(re::CTFPartyClient *); typedef int (*LoadSavedCasualCriteria_t)(re::CTFPartyClient *);
uintptr_t addr = gSignatures.GetClientSignature( uintptr_t addr = gSignatures.GetClientSignature(
"55 89 E5 83 EC ? 8B 45 ? 8B 50 ? C6 80 ? ? ? ? ?"); "55 89 E5 83 EC ? 8B 45 ? 8B 50 ? C6 80 ? ? ? ? ?");
LoadSavedCasualCriteria_t LoadSavedCasualCriteria_fn = LoadSavedCasualCriteria_t LoadSavedCasualCriteria_fn =
LoadSavedCasualCriteria_t(addr); LoadSavedCasualCriteria_t(addr);
@ -80,7 +79,8 @@ char re::CTFPartyClient::RequestLeaveForMatch(int type)
{ {
typedef char (*RequestLeaveForMatch_t)(re::CTFPartyClient *, int); typedef char (*RequestLeaveForMatch_t)(re::CTFPartyClient *, int);
uintptr_t addr = gSignatures.GetClientSignature( uintptr_t addr = gSignatures.GetClientSignature(
"55 89 E5 57 56 53 83 EC ? 8B 45 ? 89 44 24 ? 8B 45 ? 89 04 24 E8 ? ? ? ? 84 C0 89 C6 75 ?"); "55 89 E5 57 56 53 83 EC ? 8B 45 ? 89 44 24 ? 8B 45 ? 89 04 24 E8 ? ? "
"? ? 84 C0 89 C6 75 ?");
RequestLeaveForMatch_t RequestLeaveForMatch_fn = RequestLeaveForMatch_t RequestLeaveForMatch_fn =
RequestLeaveForMatch_t(addr); RequestLeaveForMatch_t(addr);

20
src/tfmm.cpp Executable file → Normal file
View File

@ -12,8 +12,12 @@ CatCommand cmd_queue_start("mm_queue_casual", "Start casual queue",
CatCommand cmd_abandon("mm_abandon", "Abandon match", CatCommand cmd_abandon("mm_abandon", "Abandon match",
[]() { tfmm::abandon(); }); []() { tfmm::abandon(); });
static CatEnum queue_mode({ "MvmPractice", "MvmMannup", "LadderMatch6v6", "LadderMatch9v9", "LadderMatch12v12", "CasualMatch6v6", "CasualMatch9v9", "CasualMatch12v12", "CompetitiveEventMatch12v12"}); static CatEnum queue_mode({ "MvmPractice", "MvmMannup", "LadderMatch6v6",
static CatVar queue(queue_mode, "autoqueue_mode", "7", "Autoqueue for this mode", ""); "LadderMatch9v9", "LadderMatch12v12",
"CasualMatch6v6", "CasualMatch9v9",
"CasualMatch12v12", "CompetitiveEventMatch12v12" });
static CatVar queue(queue_mode, "autoqueue_mode", "7",
"Autoqueue for this mode", "");
CatCommand get_state("mm_state", "Get party state", []() { CatCommand get_state("mm_state", "Get party state", []() {
re::CTFParty *party = re::CTFParty::GetParty(); re::CTFParty *party = re::CTFParty::GetParty();
@ -28,20 +32,22 @@ CatCommand get_state("mm_state", "Get party state", []() {
namespace tfmm namespace tfmm
{ {
void queue_start() { void queue_start()
{
re::CTFPartyClient *client = re::CTFPartyClient::GTFPartyClient(); re::CTFPartyClient *client = re::CTFPartyClient::GTFPartyClient();
if (client) if (client)
{ {
client->LoadSavedCasualCriteria(); client->LoadSavedCasualCriteria();
client->RequestQueueForMatch((int)queue); client->RequestQueueForMatch((int) queue);
} }
else else
logging::Info("queue_start: CTFPartyClient == null!"); logging::Info("queue_start: CTFPartyClient == null!");
} }
void queue_leave() { void queue_leave()
{
re::CTFPartyClient *client = re::CTFPartyClient::GTFPartyClient(); re::CTFPartyClient *client = re::CTFPartyClient::GTFPartyClient();
if (client) if (client)
client->RequestLeaveForMatch((int)queue); client->RequestLeaveForMatch((int) queue);
else else
logging::Info("queue_start: CTFPartyClient == null!"); logging::Info("queue_start: CTFPartyClient == null!");
} }

3
src/visual/drawmgr.cpp Executable file → Normal file
View File

@ -40,7 +40,8 @@ CatVar info_text(CV_SWITCH, "info", "1", "Show info",
"Show cathook version in top left corner"); "Show cathook version in top left corner");
CatVar info_text_min(CV_SWITCH, "info_min", "0", "Show minimal info", CatVar info_text_min(CV_SWITCH, "info_min", "0", "Show minimal info",
"Only show cathook title in top left corner"); "Only show cathook title in top left corner");
CatVar enable_logo(CV_SWITCH, "nullcore_mode_logo", "1", "Enable Nullcore watermark", ""); CatVar enable_logo(CV_SWITCH, "nullcore_mode_logo", "1",
"Enable Nullcore watermark", "");
void DrawCheatVisuals() void DrawCheatVisuals()
{ {