From a1416f6e7555fd0ef0813b762671a49d728a7200 Mon Sep 17 00:00:00 2001 From: nullifiedcat Date: Fri, 24 Feb 2017 18:34:48 +0300 Subject: [PATCH] Fixed crash??? --- .cproject | 18 ++++++++---------- README.md | 1 + makefile | 6 +++--- src/gui/RootWindow.cpp | 8 +------- src/gui/RootWindow.h | 1 - src/hack.cpp | 10 +--------- src/sdk/convar.cpp | 1 + 7 files changed, 15 insertions(+), 30 deletions(-) diff --git a/.cproject b/.cproject index adadfb801..18978d9b0 100644 --- a/.cproject +++ b/.cproject @@ -22,8 +22,6 @@ - - @@ -31,7 +29,7 @@ - + - + diff --git a/README.md b/README.md index 9bc415067..531779026 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ I know that the style sucks. There is a lot of design errors and cancerous patterns. Most of the code was intended to be *temporary*. # Compilation +`git submodule update --init --recursive` after cloning, then `make` # Injection diff --git a/makefile b/makefile index de0ec3a80..0c9c58420 100644 --- a/makefile +++ b/makefile @@ -1,8 +1,8 @@ CC=g++ CFLAGS=-std=gnu++11 -D_POSIX=1 -DRAD_TELEMETRY_DISABLED -DLINUX=1 -D_LINUX=1 -DPOSIX=1 -DGNUC=1 -DNO_MALLOC_OVERRIDE -O3 -w -c -shared -Wall -Wno-unknown-pragmas -fmessage-length=0 -m32 -fvisibility=hidden -fPIC SDKFOLDER=source-sdk-2013/mp/src -CFLAGS+=-D__DRM_HWID_0='$(HWID_0)' -D__DRM_HWID_1='$(HWID_1)' -D__DRM_HWID_2='$(HWID_2)' -D__DRM_HWID_3='$(HWID_3)' -D__DRM_NAME='"$(DRM_NAME)"' -D__DRM_EXPIRES='$(DRM_EXPIRES)' -DCATHOOK_BUILD_NUMBER='"$(COUNTER)"' -CINCLUDES=-I$(SDKFOLDER)/public -I$(SDKFOLDER)/mathlib -I$(SDKFOLDER)/common -I$(SDKFOLDER)/public/tier1 -I$(SDKFOLDER)/public/tier0 +CFLAGS+=-D_DEVELOPER +CINCLUDES=-I$(SDKFOLDER)/public -I$(SDKFOLDER)/mathlib -I$(SDKFOLDER)/common -I$(SDKFOLDER)/public/tier1 -I$(SDKFOLDER)/public/tier0 -I$(SDKFOLDER) LDFLAGS=-m32 -fno-gnu-unique -D_GLIBCXX_USE_CXX11_ABI=0 -shared LDLIBS=-Bstatic -lvstdlib -lstdc++ -lc -ltier0 OBJ_DIR := obj @@ -24,7 +24,7 @@ OBJECTS := $(patsubst $(SRC_DIR)/%,$(OBJ_DIR)/%,$(patsubst %.cpp,%.o,$(SOURCES)) .PHONY: clean directories -all: directories cathook +all: clean directories cathook directories: mkdir -p bin diff --git a/src/gui/RootWindow.cpp b/src/gui/RootWindow.cpp index 6652bfb25..55487bdde 100644 --- a/src/gui/RootWindow.cpp +++ b/src/gui/RootWindow.cpp @@ -42,9 +42,7 @@ void TICallback(CTextInput* thisptr, std::string olds, std::string news) { } } -RootWindow::RootWindow() : CBaseWindow("root") { - -} +RootWindow::RootWindow() : CBaseWindow("root") {} void RootWindow::Setup() { g_pGUI->m_pTooltip = new CTooltip(); @@ -143,7 +141,3 @@ void RootWindow::Setup() { td->SetPositionMode(INLINE); this->AddChild(wgt);*/ } - -RootWindow::~RootWindow() { - -} diff --git a/src/gui/RootWindow.h b/src/gui/RootWindow.h index 9c7ad05e2..3515c0981 100644 --- a/src/gui/RootWindow.h +++ b/src/gui/RootWindow.h @@ -13,7 +13,6 @@ class RootWindow : public CBaseWindow { public: RootWindow(); - ~RootWindow(); void Setup(); diff --git a/src/hack.cpp b/src/hack.cpp index 4b448a572..5f845df90 100644 --- a/src/hack.cpp +++ b/src/hack.cpp @@ -120,7 +120,6 @@ void hack::Initialize() { else if (TF2C) g_pClassID = new ClassIDTF2C(); else if (HL2DM) g_pClassID = new ClassIDHL2DM(); g_pClassID->Init(); - draw::Initialize(); colors::Init(); if (TF2) { @@ -141,20 +140,13 @@ void hack::Initialize() { hack::c_Cat = CreateConCommand(CON_NAME, &hack::CC_Cat, "Info"); hack::InitHacks(); g_Settings.Init(); -#if ENTITY_CACHE_PROFILER == true - if (!g_vEntityCacheProfiling) { - g_vEntityCacheProfiling = CREATE_CV(CV_SWITCH, "entity_cache_profiling", "0", "Entity cache profiling"); - } -#endif g_pGUI = new CatGUI(); g_pGUI->Setup(); EndConVars(); gNetvars.init(); InitNetVars(); - g_pLocalPlayer = new LocalPlayer(); g_pPlayerResource = new TFPlayerResource(); - hooks::hkPanel = new hooks::VMTHook(); hooks::hkPanel->Init(interfaces::panel, 0); //hooks::hkPanel->HookMethod((void*)&hack::Hk_PaintTraverse, hooks::offPaintTraverse); @@ -179,7 +171,6 @@ void hack::Initialize() { hooks::hkStudioRender->Init((void*)interfaces::render, 0); hooks::hkStudioRender->HookMethod((void*)BeginFrame_hook, hooks::offBeginFrame); hooks::hkStudioRender->Apply(); - hooks::hkClient = new hooks::VMTHook(); hooks::hkClient->Init((void*)interfaces::baseClient, 0); hooks::hkClient->HookMethod((void*)FrameStageNotify_hook, hooks::offFrameStageNotify); @@ -188,6 +179,7 @@ void hack::Initialize() { hooks::hkClient->Apply(); if (TF2) g_GlowObjectManager = *reinterpret_cast(gSignatures.GetClientSignature("C1 E0 05 03 05") + 5); InitStrings(); + logging::Info("Init done."); g_pChatStack = new ChatStack(); } diff --git a/src/sdk/convar.cpp b/src/sdk/convar.cpp index 59f83c916..fb6536929 100644 --- a/src/sdk/convar.cpp +++ b/src/sdk/convar.cpp @@ -48,6 +48,7 @@ static bool s_bRegistered = false; void SetCVarInterface(ICvar* iface) { g_pCVar = iface; + logging::Info("Set interface to 0x%08x", iface); } class CDefaultAccessor : public IConCommandBaseAccessor