float csgo_CSkyBoxView_GetScale(void) { if(AFXADDR_GET(csgo_pLocalPlayer) && 0 != *(unsigned char **)AFXADDR_GET(csgo_pLocalPlayer)) { int skyBoxScale = *(int *)(*(unsigned char **)AFXADDR_GET(csgo_pLocalPlayer) +AFXADDR_GET(csgo_C_BasePlayer_OFS_m_skybox3d_scale)); if(skyBoxScale) return 1.0f / skyBoxScale; } return 1.0f; }
bool csgo_CSkyBoxView_Draw_Install(void) { static bool firstResult = false; static bool firstRun = true; if(!firstRun) return firstResult; firstRun = false; if(AFXADDR_GET(csgo_CSkyboxView_Draw)) { detoured_csgo_CSkyBoxView_Draw = (csgo_CSkyBoxView_Draw_t)DetourClassFunc((BYTE *)AFXADDR_GET(csgo_CSkyboxView_Draw), (BYTE *)touring_csgo_CSkyBoxView_Draw, (int)AFXADDR_GET(csgo_CSkyboxView_Draw_DSZ)); firstResult = true; } return firstResult; }
bool Hook_R_DrawViewModel() { static bool firstRun = true; static bool firstResult = true; if (!firstRun) return firstResult; firstRun = false; if (HL_ADDR_GET(R_DrawViewModel)) { LONG error = NO_ERROR; g_Old_R_DrawViewModel = (R_DrawViewModel_t)AFXADDR_GET(R_DrawViewModel); DetourTransactionBegin(); DetourUpdateThread(GetCurrentThread()); DetourAttach(&(PVOID&)g_Old_R_DrawViewModel, New_R_DrawViewModel); error = DetourTransactionCommit(); if (NO_ERROR != error) { firstResult = false; ErrorBox("Interception failed:\nHook_R_DrawViewModel"); } } else firstResult = false; return firstResult; }
bool Hook_Mod_LeafPvs() { static bool firstRun = true; static bool firstResult = true; if (!firstRun) return firstResult; firstRun = false; if (HL_ADDR_GET(Mod_LeafPVS) != NULL) { LONG error = NO_ERROR; g_Old_Mod_LeafPVS = (Mod_LeafPVS_t)AFXADDR_GET(Mod_LeafPVS); DetourTransactionBegin(); DetourUpdateThread(GetCurrentThread()); DetourAttach(&(PVOID&)g_Old_Mod_LeafPVS, New_Mod_LeafPVS); error = DetourTransactionCommit(); if (NO_ERROR != error) { firstResult = false; ErrorBox("Interception failed:\nHook_Mod_LeafPvs"); } } else firstResult = false; return firstResult; }
bool Hook_csgo_PlayerAnimStateFix(void) { static bool firstResult = false; static bool firstRun = true; if (!firstRun) return firstResult; firstRun = false; if (AFXADDR_GET(csgo_DT_Animationlayer_m_flCycle_fn) //&& AFXADDR_GET(csgo_DT_Animationlayer_m_flPrevCycle_fn) //&& AFXADDR_GET(csgo_mystique_animation) ) { //MdtMemBlockInfos mbis; csgo_C_BasePlayer_RecvProxy_t * pMovArgFn; pMovArgFn = *(csgo_C_BasePlayer_RecvProxy_t **)AFXADDR_GET(csgo_DT_Animationlayer_m_flCycle_fn); //MdtMemAccessBegin(pMovArgFn, sizeof(void *), &mbis); detoured_csgo_RecvProxy_m_flCycle = *pMovArgFn; *pMovArgFn = touring_csgo__RecvProxy_m_flCycle; //MdtMemAccessEnd(&mbis); /* pMovArgFn = *(csgo_C_BasePlayer_RecvProxy_t **)AFXADDR_GET(csgo_DT_Animationlayer_m_flPrevCycle_fn); //MdtMemAccessBegin(pMovArgFn, sizeof(void *), &mbis); detoured_csgo_RecvProxy_m_flPrevCycle = *pMovArgFn; *pMovArgFn = touring_csgo__RecvProxy_m_flPrevCycle; //MdtMemAccessEnd(&mbis); */ //detoured_csgo_mystique_animation = DetourApply((BYTE *)AFXADDR_GET(csgo_mystique_animation), (BYTE *)naked_touring_csgo_mystique_animation, 0x0a); firstResult = true; } return firstResult; }
bool csgo_ScaleFormDll_Hooks_Init(void) { static bool firstResult = false; static bool firstRun = true; if(!firstRun) return firstResult; firstRun = false; if(AFXADDR_GET(csgo_Scaleformui_CUnkown_Loader)) { detoured_csgo_Scaleformui_CUnkown_Loader = (csgo_Scaleformui_CUnkown_Loader_t)DetourClassFunc((BYTE *)AFXADDR_GET(csgo_Scaleformui_CUnkown_Loader), (BYTE *)touring_csgo_Scaleformui_CUnkown_Loader, (int)AFXADDR_GET(csgo_Scaleformui_CUnkown_Loader_DSZ)); firstResult = true; } return firstResult; }
bool Hook_csgo_RecvProxy_Int32ToInt8(void) { static bool firstResult = false; static bool firstRun = true; if (!firstRun) return firstResult; firstRun = false; if (AFXADDR_GET(csgo_RecvProxy_Int32ToInt8)) { detoured_csgo_RecvProxy_Int32ToInt8 = (csgo_RecvProxy_Int32ToInt8_t)DetourApply((BYTE *)AFXADDR_GET(csgo_RecvProxy_Int32ToInt8), (BYTE *)touring_csgo_RecvProxy_Int32ToInt8, (int)0x06); firstResult = true; } return firstResult; }
bool Hook_csgo_C_BasePlayer_RecvProxy_ObserverTarget(void) { static bool firstResult = false; static bool firstRun = true; if (!firstRun) return firstResult; firstRun = false; if (AFXADDR_GET(csgo_C_BasePlayer_RecvProxy_ObserverTarget)) { detoured_csgo_C_BasePlayer_RecvProxy_ObserverTarget = (csgo_C_BasePlayer_RecvProxy_ObserverTarget_t)DetourApply((BYTE *)AFXADDR_GET(csgo_C_BasePlayer_RecvProxy_ObserverTarget), (BYTE *)touring_csgo_C_BasePlayer_RecvProxy_ObserverTarget, (int)0x06); firstResult = true; } return firstResult; }
bool Hook_CL_Disconnect() { static bool firstRun = true; static bool firstResult = true; if (!firstRun) return firstResult; firstRun = false; LONG error = NO_ERROR; g_Old_CL_Disconnect = (CL_Disconnect_t)AFXADDR_GET(CL_Disconnect); DetourTransactionBegin(); DetourUpdateThread(GetCurrentThread()); DetourAttach(&(PVOID&)g_Old_CL_Disconnect, New_CL_Disconnect); error = DetourTransactionCommit(); if (NO_ERROR != error) { firstResult = false; ErrorBox("Interception failed:\nhw.dll:CL_Disconnect"); } return firstResult; }
bool csgo_CViewRender_Install(void) { static bool firstResult = true; static bool firstRun = true; if(!firstRun) return firstResult; firstRun = false; if(AFXADDR_GET(csgo_CViewRender_RenderView_VGui_DrawHud_In) && AFXADDR_GET(csgo_CViewRender_RenderView_VGui_DrawHud_Out)) { { detoured_csgo_CViewRender_RenderView_VGui_DrawHud_In = (void *)DetourApply((BYTE *)AFXADDR_GET(csgo_CViewRender_RenderView_VGui_DrawHud_In), (BYTE *)touring_csgo_CViewRender_RenderView_VGui_DrawHud_In, 0x5); // fix-up code relocation: DWORD * pCalladdr = (DWORD *)((BYTE *)detoured_csgo_CViewRender_RenderView_VGui_DrawHud_In + 0x1); *pCalladdr = *pCalladdr - ((DWORD)detoured_csgo_CViewRender_RenderView_VGui_DrawHud_In - AFXADDR_GET(csgo_CViewRender_RenderView_VGui_DrawHud_In)); } { detoured_csgo_CViewRender_RenderView_VGui_DrawHud_Out = (void *)DetourApply((BYTE *)AFXADDR_GET(csgo_CViewRender_RenderView_VGui_DrawHud_Out), (BYTE *)touring_csgo_CViewRender_RenderView_VGui_DrawHud_Out, 0x5); } } else firstResult = false; if (AFXADDR_GET(csgo_CCSViewRender_vtable) && AFXADDR_GET(csgo_CCSViewRender_RenderSmokeOverlay_OnLoadOldAlpha) && AFXADDR_GET(csgo_CCSViewRender_RenderSmokeOverlay_OnCompareAlphaBeforeDraw)) { int * vtable = (int*)AFXADDR_GET(csgo_CCSViewRender_vtable); //DetourIfacePtr((DWORD *)&(vtable[5]), touring_CCSViewRender_Render, (DetourIfacePtr_fn &)detoured_CCSViewRender_Render); DetourIfacePtr((DWORD *)&(vtable[6]), touring_CCSViewRender_RenderView, (DetourIfacePtr_fn &)detoured_CCSViewRender_RenderView); detoured_csgo_CViewRender_RenderSmokeOverlay_OnLoadOldAlpha = (void *)DetourApply((BYTE *)AFXADDR_GET(csgo_CCSViewRender_RenderSmokeOverlay_OnLoadOldAlpha), (BYTE *)touring_csgo_CViewRender_RenderSmokeOverlay_OnLoadOldAlpha, 8); detoured_csgo_CViewRender_RenderSmokeOverlay_OnCompareAlphaBeforeDraw = (void *)DetourApply((BYTE *)AFXADDR_GET(csgo_CCSViewRender_RenderSmokeOverlay_OnCompareAlphaBeforeDraw), (BYTE *)touring_csgo_CViewRender_RenderSmokeOverlay_OnCompareAlphaBeforeDraw, 7); } else firstResult = false; return firstResult; }
void Addresses_InitHwDll(AfxAddr hwDll) { AFXADDR_SET(hwDll, hwDll); // // Engine-to-client interfaces: // AFXADDR_SET(p_cl_enginefuncs_s, hwDll + 0x134260); // *[5] AFXADDR_SET(p_playermove_s, hwDll + 0x1006AE0); // *[5] AFXADDR_SET(p_engine_studio_api_s, hwDll + 0x1502F0); // *[5] // // General engine hooks: // AFXADDR_SET(Host_Init, hwDll +0x568F0); // *[18] AFXADDR_SET(Host_Init_DSZ, 0x09); // *[18] AFXADDR_SET(Host_Frame, hwDll +0x561E0); // *[8] AFXADDR_SET(Host_Frame_DSZ, 0x05); // *[8] AFXADDR_SET(host_frametime, hwDll +0xAB4028); // *[8] AFXADDR_SET(CL_EmitEntities, hwDll + 0x14A30); // *[8] AFXADDR_SET(CL_EmitEntities_DSZ, 0x05); // *[8] AFXADDR_SET(CL_Disconnect, hwDll + 0x17470); // *[16] AFXADDR_SET(CL_Disconnect_DSZ, 0x06); // *[16] AFXADDR_SET(ClientFunctionTable, hwDll +0x122F540); // *[9] AFXADDR_SET(CmdTools_Ofs1, 0x19); // *[13] AFXADDR_SET(CmdTools_Ofs2, 0x0D); // *[13] AFXADDR_SET(CmdTools_Ofs3, 0x29); // *[13] // // Rendering related: // AFXADDR_SET(UnkDrawHudInCall, hwDll +0x4F780); // *[7] AFXADDR_SET(UnkDrawHudOutCall, hwDll +0x4F950); // *[7] AFXADDR_SET(UnkDrawHudIn, hwDll +0xB52B4); // *[7] AFXADDR_SET(UnkDrawHudInContinue, AFXADDR_GET(UnkDrawHudIn) + 0x5); // *[7] AFXADDR_SET(UnkDrawHudOut, hwDll +0xB5339); // *[7] AFXADDR_SET(UnkDrawHudOutContinue, AFXADDR_GET(UnkDrawHudOut) + 0x5); // *[7] AFXADDR_SET(R_PushDlights, hwDll + 0x42290); // *[7] AFXADDR_SET(R_RenderView, hwDll + 0x452E0); // *[7] AFXADDR_SET(DTOURSZ_R_RenderView, 0x6); // *[7] AFXADDR_SET(R_DrawViewModel, hwDll +0x43990); // *[7] AFXADDR_SET(DTOURSZ_R_DrawViewModel, 0x06); // *[7] AFXADDR_SET(R_PolyBlend, hwDll +0x43EF0); // *[7] AFXADDR_SET(DTOURSZ_R_PolyBlend, 0x06); // *[7] AFXADDR_SET(r_refdef, hwDll + 0xEC61E0); // *[7] AFXADDR_SET(Mod_LeafPVS, hwDll + 0x28270); // *[7] AFXADDR_SET(DTOURSZ_Mod_LeafPVS, 0x06); // *[7] AFXADDR_SET(R_DrawEntitiesOnList, hwDll + 0x43750); // *[7] AFXADDR_SET(DTOURSZ_R_DrawEntitiesOnList, 0x06); // *[7] AFXADDR_SET(R_DrawParticles, hwDll + 0x7B1B0); // *[7] AFXADDR_SET(DTOURSZ_R_DrawParticles, 0x06); // *[7] AFXADDR_SET(R_DrawSkyBoxEx, hwDll + 0x4F55E); // *[11] AFXADDR_SET(R_DrawSkyBoxEx_DSZ, 0x06); // *[11] AFXADDR_SET(skytextures, hwDll + 0x63FF48); // *[11] AFXADDR_SET(UnkGetDecalTexture, hwDll + 0x2EB30); // *[12] AFXADDR_SET(UnkGetDecalTexture_DSZ, 0x06); // *[12] AFXADDR_SET(g_fov , hwDll +0x144A8C); // *[17] // // Sound system related: // AFXADDR_SET(GetSoundtime, hwDll + 0x8B140); // *[6] AFXADDR_SET(DTOURSZ_GetSoundtime, 0x0a); // *[6] AFXADDR_SET(S_PaintChannels, hwDll + 0x8CD60); // *[6] AFXADDR_SET(DTOURSZ_S_PaintChannels, 0x08); // *[6] AFXADDR_SET(paintedtime, hwDll + 0xA2B860); // *[6] AFXADDR_SET(shm, hwDll + 0x6B7CD8); // *[6] AFXADDR_SET(soundtime, hwDll + 0xA2B85C); // *[6] AFXADDR_SET(paintbuffer, hwDll + 0xA21720); // *[6] AFXADDR_SET(S_TransferPaintBuffer, hwDll + 0x8C800); // *[6] AFXADDR_SET(DTOURSZ_S_TransferPaintBuffer, 0x06); // *[6] AFXADDR_SET(SND_PickChannel, hwDll + 0x8A3E0); // *[6] AFXADDR_SET(DTOURSZ_SND_PickChannel, 0x07); // *[6] // // Demo parsing related: // AFXADDR_SET(CL_ParseServerMessage_CmdRead, hwDll + 0x1CFC6); // *[10] AFXADDR_SET(CL_ParseServerMessage_CmdRead_DSZ, 0x07); // *[10] AFXADDR_SET(msg_readcount, hwDll + 0x1004D28); // *[10] AFXADDR_SET(net_message, hwDll +0xA9F230 - 0x10); // *[10] }