Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DWORD WINAPI dwMainThread( LPVOID lpArguments )
- {
- if (gInts.Client == NULL) //Prevent repeat callings.
- {
- //Gottammove those factorys up.
- //Grab the factorys from their resptive module's EAT.
- ClientFactory = ( CreateInterfaceFn ) GetProcAddress( gBaseAPI.GetModuleHandleSafe( "client.dll" ), "CreateInterface" );
- EngineFactory = ( CreateInterfaceFn ) GetProcAddress( gBaseAPI.GetModuleHandleSafe( "engine.dll" ), "CreateInterface" );
- VGUIFactory = ( CreateInterfaceFn ) GetProcAddress( gBaseAPI.GetModuleHandleSafe( "vguimatsurface.dll" ), "CreateInterface" );
- VGUI2Factory = ( CreateInterfaceFn ) GetProcAddress( gBaseAPI.GetModuleHandleSafe( "vgui2.dll" ), "CreateInterface" );
- gInts.Client = (CHLClient*)ClientFactory("VClient016", NULL);
- gInts.EntList = (CEntList*)ClientFactory("VClientEntityList003", NULL);
- gInts.Engine = (EngineClient*)EngineFactory("VEngineClient015", NULL);
- gInts.ModelInfo = (CModelInfo*)EngineFactory("VModelInfoClient004", NULL);
- gInts.Surface = (ISurface*)VGUIFactory("VGUI_Surface031", NULL);
- gInts.MdlRender = (CModelRender*)EngineFactory("VEngineModel016", NULL);
- XASSERT(gInts.Client);
- XASSERT(gInts.Engine);
- XASSERT(gInts.ModelInfo);
- XASSERT(gInts.Surface);
- //Setup the ClientMode hooks.
- VMTBaseManager* clientMode = new VMTBaseManager(); //Setup our VMTBaseManager for Panels.
- VMTBaseManager* defRenderHook = new VMTBaseManager();
- gInts.ClientMode = GetClientMode();
- clientMode->Init(gInts.ClientMode);
- clientMode->HookMethod(&Hooked_CreateMove, gOffsets.iCreateMoveOffset); //ClientMode create move is called inside of CHLClient::CreateMove, and thus no need for hooking WriteUserCmdDelta.
- clientMode->Rehook();
- //Setup the Panel hook so we can draw.
- if( !gInts.Panels )
- {
- gInts.Panels = ( IPanel* ) VGUI2Factory( "VGUI_Panel009", NULL );
- XASSERT( gInts.Panels );
- if( gInts.Panels )
- {
- VMTBaseManager* panelHook = new VMTBaseManager(); //Setup our VMTBaseManager for Panels.
- panelHook->Init(gInts.Panels);
- panelHook->HookMethod(&Hooked_PaintTraverse, gOffsets.iPaintTraverseOffset);
- panelHook->Rehook();
- }
- }
- }
- return 0; //The thread has been completed, and we do not need to call anything once we're done. The call to Hooked_PaintTraverse is now our main thread.
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement