commit
f8d0a5a361
31
src/hack.cpp
31
src/hack.cpp
@ -259,6 +259,24 @@ void hack::Initialize() {
|
|||||||
hooks::client.Set(g_IBaseClient);
|
hooks::client.Set(g_IBaseClient);
|
||||||
hooks::client.HookMethod((void*)FrameStageNotify_hook, offsets::FrameStageNotify());
|
hooks::client.HookMethod((void*)FrameStageNotify_hook, offsets::FrameStageNotify());
|
||||||
hooks::client.HookMethod((void*)DispatchUserMessage_hook, offsets::DispatchUserMessage());
|
hooks::client.HookMethod((void*)DispatchUserMessage_hook, offsets::DispatchUserMessage());
|
||||||
|
|
||||||
|
#if TEXTMODE
|
||||||
|
//g_IMaterialSystem->SetInStubMode(true);
|
||||||
|
/*IF_GAME(IsTF2()) {
|
||||||
|
logging::Info("Graphics Nullified");
|
||||||
|
// TODO offsets::()?
|
||||||
|
hooks::materialsystem.Set((void*)g_IMaterialSystem);
|
||||||
|
uintptr_t base = *(uintptr_t*)(g_IMaterialSystem);
|
||||||
|
hooks::materialsystem.HookMethod((void*)ReloadTextures_null_hook, 70);
|
||||||
|
hooks::materialsystem.HookMethod((void*)ReloadMaterials_null_hook, 71);
|
||||||
|
hooks::materialsystem.HookMethod((void*)FindMaterial_null_hook, 73);
|
||||||
|
hooks::materialsystem.HookMethod((void*)FindTexture_null_hook, 81);
|
||||||
|
hooks::materialsystem.HookMethod((void*)ReloadFilesInList_null_hook, 121);
|
||||||
|
hooks::materialsystem.HookMethod((void*)FindMaterialEx_null_hook, 123);
|
||||||
|
hooks::materialsystem.Apply();
|
||||||
|
//hooks::materialsystem.HookMethod();
|
||||||
|
}*/
|
||||||
|
#endif
|
||||||
#ifndef TEXTMODE
|
#ifndef TEXTMODE
|
||||||
hooks::client.HookMethod((void*)IN_KeyEvent_hook, offsets::IN_KeyEvent());
|
hooks::client.HookMethod((void*)IN_KeyEvent_hook, offsets::IN_KeyEvent());
|
||||||
#endif /* TEXTMODE */
|
#endif /* TEXTMODE */
|
||||||
@ -288,12 +306,6 @@ void hack::Initialize() {
|
|||||||
|
|
||||||
// FIXME [MP]
|
// FIXME [MP]
|
||||||
hacks::shared::killsay::Init();
|
hacks::shared::killsay::Init();
|
||||||
hack::command_stack().push("exec cat_autoexec");
|
|
||||||
#ifdef TEXTMODE
|
|
||||||
hack::command_stack().push("exec cat_autoexec_textmode");
|
|
||||||
#endif
|
|
||||||
hack::command_stack().push("cat_killsay_reload");
|
|
||||||
hack::command_stack().push("cat_spam_reload");
|
|
||||||
logging::Info("Hooked!");
|
logging::Info("Hooked!");
|
||||||
velocity::Init();
|
velocity::Init();
|
||||||
playerlist::Load();
|
playerlist::Load();
|
||||||
@ -338,6 +350,13 @@ void hack::Initialize() {
|
|||||||
init_stack().pop();
|
init_stack().pop();
|
||||||
}
|
}
|
||||||
logging::Info("Initializer stack done");
|
logging::Info("Initializer stack done");
|
||||||
|
|
||||||
|
#ifdef TEXTMODE
|
||||||
|
hack::command_stack().push("exec cat_autoexec_textmode");
|
||||||
|
#endif
|
||||||
|
hack::command_stack().push("exec cat_autoexec");
|
||||||
|
hack::command_stack().push("cat_killsay_reload");
|
||||||
|
hack::command_stack().push("cat_spam_reload");
|
||||||
}
|
}
|
||||||
|
|
||||||
void hack::Think() {
|
void hack::Think() {
|
||||||
|
@ -753,6 +753,9 @@ bool IsEntityVisiblePenetration(CachedEntity* entity, int hb) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void PrintChat(const char* fmt, ...) {
|
void PrintChat(const char* fmt, ...) {
|
||||||
|
#if TEXTMODE
|
||||||
|
return;
|
||||||
|
#endif
|
||||||
CHudBaseChat* chat = (CHudBaseChat*)g_CHUD->FindElement("CHudChat");
|
CHudBaseChat* chat = (CHudBaseChat*)g_CHUD->FindElement("CHudChat");
|
||||||
if (chat) {
|
if (chat) {
|
||||||
char* buf = new char[1024];
|
char* buf = new char[1024];
|
||||||
|
@ -87,5 +87,6 @@ VMTHook matsurface {};
|
|||||||
VMTHook studiorender {};
|
VMTHook studiorender {};
|
||||||
VMTHook modelrender {};
|
VMTHook modelrender {};
|
||||||
VMTHook clientmode4 {};
|
VMTHook clientmode4 {};
|
||||||
|
VMTHook materialsystem {};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -59,6 +59,7 @@ extern VMTHook modelrender;
|
|||||||
extern VMTHook baseclientstate;
|
extern VMTHook baseclientstate;
|
||||||
extern VMTHook baseclientstate8;
|
extern VMTHook baseclientstate8;
|
||||||
extern VMTHook steamfriends;
|
extern VMTHook steamfriends;
|
||||||
|
extern VMTHook materialsystem;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
31
src/hooks/nographics.cpp
Normal file
31
src/hooks/nographics.cpp
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
/*
|
||||||
|
* nographics.cpp
|
||||||
|
*
|
||||||
|
* Created on: Aug 1, 2017
|
||||||
|
* Author: nullifiedcat
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "../common.h"
|
||||||
|
|
||||||
|
/*// 81
|
||||||
|
ITexture *FindTexture_null_hook(void* this_, char const* pTextureName, const char *pTextureGroupName, bool complain, int nAdditionalCreationFlags) {
|
||||||
|
static ITexture *st = ((FindTexture_t)hooks::materialsystem.GetMethod(81))(this_, pTextureName, pTextureGroupName, complain, nAdditionalCreationFlags);
|
||||||
|
return st;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 123
|
||||||
|
IMaterial *FindMaterialEx_null_hook(void* this_, char const* pMaterialName, const char *pTextureGroupName, int nContext, bool complain, const char *pComplainPrefix) {
|
||||||
|
static IMaterial *st = ((FindMaterialEx_t)hooks::materialsystem.GetMethod(123))(this_, pMaterialName, pTextureGroupName, nContext, complain, pComplainPrefix);
|
||||||
|
return st;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 73
|
||||||
|
IMaterial *FindMaterial_null_hook(void* this_, char const* pMaterialName, const char *pTextureGroupName, bool complain, const char *pComplainPrefix) {
|
||||||
|
static IMaterial *st = ((FindMaterial_t)hooks::materialsystem.GetMethod(73))(this_, pMaterialName, pTextureGroupName, complain, pComplainPrefix);
|
||||||
|
return st;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ReloadTextures_null_hook(void* this_) {}
|
||||||
|
void ReloadMaterials_null_hook(void* this_, const char *pSubString) {}
|
||||||
|
void ReloadFilesInList_null_hook(void* this_, IFileList *pFilesToReload) {}
|
||||||
|
*/
|
@ -26,6 +26,20 @@ void FrameStageNotify_hook(void*, int);
|
|||||||
void LevelInit_hook(void*, const char*);
|
void LevelInit_hook(void*, const char*);
|
||||||
void LevelShutdown_hook(void*);
|
void LevelShutdown_hook(void*);
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef TEXTMODE
|
||||||
|
typedef ITexture*(*FindTexture_t)(void*, const char*, const char*, bool, int);
|
||||||
|
typedef IMaterial*(*FindMaterialEx_t)(void*, const char*, const char*, int, bool, const char*);
|
||||||
|
typedef IMaterial*(*FindMaterial_t)(void*, const char*, const char*, bool, const char*);
|
||||||
|
|
||||||
|
/* 70 */ void ReloadTextures_null_hook(void* this_);
|
||||||
|
/* 71 */ void ReloadMaterials_null_hook(void* this_, const char *pSubString);
|
||||||
|
/* 73 */ IMaterial *FindMaterial_null_hook(void* this_, char const* pMaterialName, const char *pTextureGroupName, bool complain, const char *pComplainPrefix);
|
||||||
|
/* 81 */ ITexture *FindTexture_null_hook(void* this_, char const* pTextureName, const char *pTextureGroupName, bool complain, int nAdditionalCreationFlags);
|
||||||
|
/* 121 */ void ReloadFilesInList_null_hook(void* this_, IFileList *pFilesToReload);
|
||||||
|
/* 123 */ IMaterial *FindMaterialEx_null_hook(void* this_, char const* pMaterialName, const char *pTextureGroupName, int nContext, bool complain, const char *pComplainPrefix);
|
||||||
|
#endif
|
||||||
|
|
||||||
//extern unsigned int* swapwindow_ptr;
|
//extern unsigned int* swapwindow_ptr;
|
||||||
//extern unsigned int swapwindow_orig;
|
//extern unsigned int swapwindow_orig;
|
||||||
|
|
||||||
|
@ -127,13 +127,13 @@ void CreateInterfaces() {
|
|||||||
logging::Info("GTFGCClientSystem() = 0x%08x", get_gc);
|
logging::Info("GTFGCClientSystem() = 0x%08x", get_gc);
|
||||||
g_TFGCClientSystem = get_gc();
|
g_TFGCClientSystem = get_gc();
|
||||||
}
|
}
|
||||||
|
g_IMaterialSystem = BruteforceInterface<IMaterialSystemFixed>("VMaterialSystem", sharedobj::materialsystem());
|
||||||
|
|
||||||
#ifndef TEXTMODE
|
#ifndef TEXTMODE
|
||||||
g_IVDebugOverlay = BruteforceInterface<IVDebugOverlay>("VDebugOverlay", sharedobj::engine());
|
g_IVDebugOverlay = BruteforceInterface<IVDebugOverlay>("VDebugOverlay", sharedobj::engine());
|
||||||
g_IPanel = BruteforceInterface<vgui::IPanel>("VGUI_Panel", sharedobj::vgui2());
|
g_IPanel = BruteforceInterface<vgui::IPanel>("VGUI_Panel", sharedobj::vgui2());
|
||||||
g_ISurface = BruteforceInterface<vgui::ISurface>("VGUI_Surface", sharedobj::vguimatsurface());
|
g_ISurface = BruteforceInterface<vgui::ISurface>("VGUI_Surface", sharedobj::vguimatsurface());
|
||||||
g_IStudioRender = BruteforceInterface<IStudioRender>("VStudioRender", sharedobj::studiorender());
|
g_IStudioRender = BruteforceInterface<IStudioRender>("VStudioRender", sharedobj::studiorender());
|
||||||
g_IMaterialSystem = BruteforceInterface<IMaterialSystemFixed>("VMaterialSystem", sharedobj::materialsystem());
|
|
||||||
g_IVRenderView = BruteforceInterface<IVRenderView>("VEngineRenderView", sharedobj::engine());
|
g_IVRenderView = BruteforceInterface<IVRenderView>("VEngineRenderView", sharedobj::engine());
|
||||||
g_IMaterialSystemHL = (IMaterialSystem*)g_IMaterialSystem;
|
g_IMaterialSystemHL = (IMaterialSystem*)g_IMaterialSystem;
|
||||||
IF_GAME (IsTF2()) {
|
IF_GAME (IsTF2()) {
|
||||||
|
@ -193,7 +193,7 @@ void StoreClientData() {
|
|||||||
UpdateServerAddress();
|
UpdateServerAddress();
|
||||||
user_data_s& data = peer->memory->peer_user_data[peer->client_id];
|
user_data_s& data = peer->memory->peer_user_data[peer->client_id];
|
||||||
data.friendid = g_ISteamUser->GetSteamID().GetAccountID();
|
data.friendid = g_ISteamUser->GetSteamID().GetAccountID();
|
||||||
strncpy(data.name, g_ISteamFriends->GetPersonaName(), sizeof(data.name));
|
strncpy(data.name, GetFriendPersonaName_hook(g_ISteamFriends, g_ISteamUser->GetSteamID()), sizeof(data.name));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -79,11 +79,11 @@ void LoadAllSharedObjects() {
|
|||||||
vstdlib().Load();
|
vstdlib().Load();
|
||||||
tier0().Load();
|
tier0().Load();
|
||||||
inputsystem().Load();
|
inputsystem().Load();
|
||||||
|
materialsystem().Load();
|
||||||
#ifndef TEXTMODE
|
#ifndef TEXTMODE
|
||||||
vguimatsurface().Load();
|
vguimatsurface().Load();
|
||||||
vgui2().Load();
|
vgui2().Load();
|
||||||
studiorender().Load();
|
studiorender().Load();
|
||||||
materialsystem().Load();
|
|
||||||
libsdl().Load();
|
libsdl().Load();
|
||||||
#endif
|
#endif
|
||||||
} catch (std::exception& ex) {
|
} catch (std::exception& ex) {
|
||||||
@ -115,6 +115,10 @@ SharedObject& inputsystem() {
|
|||||||
static SharedObject obj("inputsystem.so", true);
|
static SharedObject obj("inputsystem.so", true);
|
||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
|
SharedObject& materialsystem() {
|
||||||
|
static SharedObject obj("materialsystem.so", true);
|
||||||
|
return obj;
|
||||||
|
}
|
||||||
#ifndef TEXTMODE
|
#ifndef TEXTMODE
|
||||||
SharedObject& vguimatsurface() {
|
SharedObject& vguimatsurface() {
|
||||||
static SharedObject obj("vguimatsurface.so", true);
|
static SharedObject obj("vguimatsurface.so", true);
|
||||||
@ -128,10 +132,6 @@ SharedObject& studiorender() {
|
|||||||
static SharedObject obj("studiorender.so", true);
|
static SharedObject obj("studiorender.so", true);
|
||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
SharedObject& materialsystem() {
|
|
||||||
static SharedObject obj("materialsystem.so", true);
|
|
||||||
return obj;
|
|
||||||
}
|
|
||||||
SharedObject& libsdl() {
|
SharedObject& libsdl() {
|
||||||
static SharedObject obj("libSDL2-2.0.so.0", false);
|
static SharedObject obj("libSDL2-2.0.so.0", false);
|
||||||
return obj;
|
return obj;
|
||||||
|
@ -42,11 +42,11 @@ SharedObject& engine();
|
|||||||
SharedObject& vstdlib();
|
SharedObject& vstdlib();
|
||||||
SharedObject& tier0();
|
SharedObject& tier0();
|
||||||
SharedObject& inputsystem();
|
SharedObject& inputsystem();
|
||||||
|
SharedObject& materialsystem();
|
||||||
#ifndef TEXTMODE
|
#ifndef TEXTMODE
|
||||||
SharedObject& vguimatsurface();
|
SharedObject& vguimatsurface();
|
||||||
SharedObject& vgui2();
|
SharedObject& vgui2();
|
||||||
SharedObject& studiorender();
|
SharedObject& studiorender();
|
||||||
SharedObject& materialsystem();
|
|
||||||
SharedObject& libsdl();
|
SharedObject& libsdl();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user