HelpTF2 Injection Crash

Posts 1–6 of 6 · Page 1 of 1
TF2 Injection Crash
HAI. My TF2 crashing when I inject my dll. I used this tutorial to hook. My game crashes because of -> operator. When I remove
Code:
g_pIGameConsole->Show();
command everything becomes great. PLEASE HALP YOU WILL HELP ME SO MUCH.

Note: Google didn't help me.
Note 2: I am c++ noob.
Are you using the exact same code as in the tut? if so, it doesn't crash on the g_pIGameConsole->IsShown() right above it? if it doesn't crash on that then they've probably modified the vtable layout or Show needs a boolean as argument now to indicate wether to show or hide it.

If it's not that then g_pIGameConsole is probably(most likely) a NULL pointer, probably caused by TF2 not using GameConsole003 anymore, which means the VTable layout probably changed as well. Open up gameui.dll in ollydbg and do a string scan for GameConsole, see what number they use and try to use that with your code.
Yeah I found the problem. I have changed #define GAMECONSOLE_INTERFACE_VERSION "GameConsole003" to #define GAMECONSOLE_INTERFACE_VERSION "GameConsole004".
But now I have same problem with materialsystem. crap.
OK thanks
Quote Originally Posted by yyyt View Post
Yeah I found the problem. I have changed #define GAMECONSOLE_INTERFACE_VERSION "GameConsole003" to #define GAMECONSOLE_INTERFACE_VERSION "GameConsole004".
But now I have same problem with materialsystem. crap.
OK thanks
Get the SDK from here: Mercurial repositories index

you'll want hl2sdk-ob-valve
Quote Originally Posted by Hell_Demon View Post
Get the SDK from here: Mercurial repositories index

you'll want hl2sdk-ob-valve
It has same materialsysteam version with original source sdk
MATERIAL_SYSTEM_INTERFACE_VERSION "VMaterialSystem079"
but still crashing...

virtual IMaterial * FindMaterial( char const* pMaterialName, const char *pTextureGroupName, bool complain = true, const char *pComplainPrefix = NULL ) = 0;

My code is
Code:
IMaterial* Sniperdot_blue = g_pMaterialSystem->FindMaterial("Effects//sniperdot_blue", "ClientEffect textures");
Sniperdot_blue->SetMaterialVarFlag( MATERIAL_VAR_NO_DRAW, true );
It's probably crashing because Sniperdot_blue is a null pointer, you want to find "Effects\\sniperdot_blue" instead of "Effects//sniperdot_blue" I think :3
Posts 1–6 of 6 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us