Skip to content

Commit

Permalink
Experimental build 4554 support
Browse files Browse the repository at this point in the history
  • Loading branch information
ScriptedSnark committed Mar 8, 2024
1 parent 2a9a9e4 commit b72d49f
Show file tree
Hide file tree
Showing 7 changed files with 184 additions and 70 deletions.
10 changes: 10 additions & 0 deletions GSChaos/CFeatureForgotCSS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,16 @@ void CFeatureForgotCSS::Init()
DEBUG_PRINT("[hw dll] Found r_notexture_mip at 0x%p.\n", r_notexture_mip);
}

break;
case 2: // HL-4554
DEBUG_PRINT("Searching r_notexture_mip in HL-4554 pattern...\n");
r_notexture_mip = *reinterpret_cast<texture_t***>(reinterpret_cast<uintptr_t>(R_InitTextures) + 0x2D);

if (r_notexture_mip)
{
DEBUG_PRINT("[hw dll] Found r_notexture_mip at 0x%p.\n", r_notexture_mip);
}

break;
}
});
Expand Down
12 changes: 12 additions & 0 deletions GSChaos/CFeatureSet1HP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,18 @@ void CFeatureSet1HP::Init()

break;
}
case 2: // HL-4554
{
DEBUG_PRINT("Searching sv_player in HL-4554 pattern...\n");
sv_player = *reinterpret_cast<edict_t***>(reinterpret_cast<uintptr_t>(SV_ExecuteClientMessage) + 22);

if (sv_player)
{
DEBUG_PRINT("[hw dll] Found sv_player at 0x%p.\n", sv_player);
}

break;
}
}
});
}
Expand Down
106 changes: 81 additions & 25 deletions GSChaos/GSChaos.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,18 +133,26 @@ void HookEngine()
switch (pattern - patterns::engine::ClientDLL_Init.cbegin())
{
default:
case 0: // HL25
DEBUG_PRINT("Searching pEngfuncs in HL25 pattern...\n");
case 0: // HL-9920
DEBUG_PRINT("Searching pEngfuncs in HL-9920 pattern...\n");
pEngfuncs = *reinterpret_cast<cl_enginefunc_t**>(reinterpret_cast<uintptr_t>(ClientDLL_Init) + 0x18B);

if (pEngfuncs)
DEBUG_PRINT("[hw dll] Found cl_enginefuncs at 0x%p.\n", pEngfuncs);

break;
case 1: // HL-Steampipe
DEBUG_PRINT("Searching pEngfuncs in HL-Steampipe pattern...\n");
case 1: // HL-8684
DEBUG_PRINT("Searching pEngfuncs in HL-8684 pattern...\n");
pEngfuncs = *reinterpret_cast<cl_enginefunc_t**>(reinterpret_cast<uintptr_t>(ClientDLL_Init) + 181);

if (pEngfuncs)
DEBUG_PRINT("[hw dll] Found cl_enginefuncs at 0x%p.\n", pEngfuncs);

break;
case 2: // HL-4554
DEBUG_PRINT("Searching pEngfuncs in HL-4554 pattern...\n");
pEngfuncs = *reinterpret_cast<cl_enginefunc_t**>(reinterpret_cast<uintptr_t>(ClientDLL_Init) + 226);

if (pEngfuncs)
DEBUG_PRINT("[hw dll] Found cl_enginefuncs at 0x%p.\n", pEngfuncs);

Expand All @@ -160,8 +168,8 @@ void HookEngine()
switch (pattern - patterns::engine::LoadThisDll.cbegin())
{
default:
case 0: // HL25
DEBUG_PRINT("Searching g_engfuncs in HL25 pattern...\n");
case 0: // HL-9920
DEBUG_PRINT("Searching g_engfuncs in HL-9920 pattern...\n");
g_engfuncs = *reinterpret_cast<enginefuncs_t**>(reinterpret_cast<uintptr_t>(LoadThisDll) + 0x5F);
gpGlobals = *reinterpret_cast<globalvars_t**>(reinterpret_cast<uintptr_t>(LoadThisDll) + 0x5A);

Expand All @@ -172,11 +180,22 @@ void HookEngine()
DEBUG_PRINT("[hw dll] Found gpGlobals at 0x%p.\n", gpGlobals);

break;
case 1: // HL-Steampipe
DEBUG_PRINT("Searching g_engfuncs in HL-Steampipe pattern...\n");
case 1: // HL-8684
DEBUG_PRINT("Searching g_engfuncs in HL-8684 pattern...\n");
g_engfuncs = *reinterpret_cast<enginefuncs_t**>(reinterpret_cast<uintptr_t>(LoadThisDll) + 0x5F);
gpGlobals = *reinterpret_cast<globalvars_t**>(reinterpret_cast<uintptr_t>(LoadThisDll) + 0x5A);

if (g_engfuncs)
DEBUG_PRINT("[hw dll] Found g_engfuncs at 0x%p.\n", g_engfuncs);

if (gpGlobals)
DEBUG_PRINT("[hw dll] Found gpGlobals at 0x%p.\n", gpGlobals);
break;
case 2: // HL-4554
DEBUG_PRINT("Searching g_engfuncs in HL-4554 pattern...\n");
g_engfuncs = *reinterpret_cast<enginefuncs_t**>(reinterpret_cast<uintptr_t>(LoadThisDll) + 91);
gpGlobals = *reinterpret_cast<globalvars_t**>(reinterpret_cast<uintptr_t>(LoadThisDll) + 86);

if (g_engfuncs)
DEBUG_PRINT("[hw dll] Found g_engfuncs at 0x%p.\n", g_engfuncs);

Expand All @@ -194,18 +213,26 @@ void HookEngine()
switch (pattern - patterns::engine::LoadEntityDLLs.cbegin())
{
default:
case 0: // HL25
DEBUG_PRINT("Searching gEntityInterface in HL25 pattern...\n");
case 0: // HL-9920
DEBUG_PRINT("Searching gEntityInterface in HL-9920 pattern...\n");
gEntityInterface = *reinterpret_cast<DLL_FUNCTIONS**>(reinterpret_cast<uintptr_t>(LoadEntityDLLs) + 0x4CF);

if (gEntityInterface)
DEBUG_PRINT("[hw dll] Found gEntityInterface at 0x%p.\n", gEntityInterface);

break;
case 1: // HL-Steampipe
DEBUG_PRINT("Searching gEntityInterface in HL-Steampipe pattern...\n");
case 1: // HL-8684
DEBUG_PRINT("Searching gEntityInterface in HL-8684 pattern...\n");
gEntityInterface = *reinterpret_cast<DLL_FUNCTIONS**>(reinterpret_cast<uintptr_t>(LoadEntityDLLs) + 0x48D);

if (gEntityInterface)
DEBUG_PRINT("[hw dll] Found gEntityInterface at 0x%p.\n", gEntityInterface);

break;
case 2: // HL-4554
DEBUG_PRINT("Searching gEntityInterface in HL-4554 pattern...\n");
gEntityInterface = *reinterpret_cast<DLL_FUNCTIONS**>(reinterpret_cast<uintptr_t>(LoadEntityDLLs) + 0x41C);

if (gEntityInterface)
DEBUG_PRINT("[hw dll] Found gEntityInterface at 0x%p.\n", gEntityInterface);

Expand All @@ -221,23 +248,31 @@ void HookEngine()
switch (pattern - patterns::engine::Host_ClearMemory.cbegin())
{
default:
case 0: // HL25
DEBUG_PRINT("Searching sv in HL25 pattern...\n");
case 0: // HL-9920
DEBUG_PRINT("Searching sv in HL-9920 pattern...\n");
sv = *reinterpret_cast<server_t**>(reinterpret_cast<uintptr_t>(Host_ClearMemory) + 0xA4);

if (sv)
{
DEBUG_PRINT("[hw dll] Found sv at 0x%p.\n", sv);
}
break;
case 1: // HL-Steampipe
DEBUG_PRINT("Searching sv in HL-Steampipe pattern...\n");
case 1: // HL-8684
DEBUG_PRINT("Searching sv in HL-8684 pattern...\n");
sv = *reinterpret_cast<server_t**>(reinterpret_cast<uintptr_t>(Host_ClearMemory) + 0x5E);
if (sv)
{
DEBUG_PRINT("[hw dll] Found sv at 0x%p.\n", sv);
}
break;
case 2: // HL-4554
DEBUG_PRINT("Searching sv in HL-4554 pattern...\n");
sv = *reinterpret_cast<server_t**>(reinterpret_cast<uintptr_t>(Host_ClearMemory) + 0x5C);
if (sv)
{
DEBUG_PRINT("[hw dll] Found sv at 0x%p.\n", sv);
}
break;
}
});

Expand All @@ -249,8 +284,8 @@ void HookEngine()
switch (pattern - patterns::engine::CL_Init.cbegin())
{
default:
case 0: // HL25
DEBUG_PRINT("Searching cl in HL25 pattern...\n");
case 0: // HL-9920
DEBUG_PRINT("Searching cl in HL-9920 pattern...\n");
cl_hl25 = *reinterpret_cast<client_state_HL25_t**>(reinterpret_cast<uintptr_t>(CL_Init) + 0x52B);

if (cl_hl25)
Expand All @@ -261,9 +296,19 @@ void HookEngine()
g_bHL25 = true;
}
break;
case 1: // HL-Steampipe
DEBUG_PRINT("Searching cl in HL-Steampipe pattern...\n");
cl = *reinterpret_cast<client_state_t**>(reinterpret_cast<uintptr_t>(CL_Init) + 0x4D6);
case 1: // HL-8684
DEBUG_PRINT("Searching cl in HL-8684 pattern...\n");
cl = *reinterpret_cast<client_state_t**>(reinterpret_cast<uintptr_t>(CL_Init) + 1);
if (cl)
{
DEBUG_PRINT("[hw dll] Found cl at 0x%p.\n", cl);
DEBUG_PRINT("[hw dll] cl->time: %.01f\n", cl->time);
g_bHL25 = false;
}
break;
case 2: // HL-4554
DEBUG_PRINT("Searching cl in HL-4554 pattern...\n");
cl = *reinterpret_cast<client_state_t**>(reinterpret_cast<uintptr_t>(CL_Init) + 1);
if (cl)
{
DEBUG_PRINT("[hw dll] Found cl at 0x%p.\n", cl);
Expand All @@ -282,8 +327,8 @@ void HookEngine()
switch (pattern - patterns::engine::SNDDMA_InitDirect.cbegin())
{
default:
case 0: // HL25
DEBUG_PRINT("Searching shm in HL25 pattern...\n");
case 0: // HL-9920
DEBUG_PRINT("Searching shm in HL-9920 pattern...\n");
shm = *reinterpret_cast<dma_t**>(reinterpret_cast<uintptr_t>(SNDDMA_InitDirect) + 0x19);

if (shm)
Expand All @@ -292,8 +337,8 @@ void HookEngine()
DEBUG_PRINT("[hw dll] shm->speed == %i\n", shm->speed);
}
break;
case 1: // HL-SteamPipe
DEBUG_PRINT("Searching shm in HL-SteamPipe pattern...\n");
case 1: // HL-8684
DEBUG_PRINT("Searching shm in HL-8684 pattern...\n");
shm = *reinterpret_cast<dma_t**>(reinterpret_cast<uintptr_t>(SNDDMA_InitDirect) + 0x46);

if (shm)
Expand All @@ -302,6 +347,17 @@ void HookEngine()
DEBUG_PRINT("[hw dll] shm->speed == %i\n", shm->speed);
}
break;
case 2: // HL-4554
DEBUG_PRINT("Searching shm in HL-4554 pattern...\n");
shm = *reinterpret_cast<dma_t**>(reinterpret_cast<uintptr_t>(SNDDMA_InitDirect) + 0xF);

if (shm)
{
DEBUG_PRINT("[hw dll] Found shm at 0x%p.\n", shm);
DEBUG_PRINT("[hw dll] shm->speed == %i\n", shm->speed);
}
break;

}
});
}
Expand Down
2 changes: 2 additions & 0 deletions GSChaos/GSChaos.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\external\imgui\backends\imgui_impl_opengl2.cpp" />
<ClCompile Include="..\external\imgui\backends\imgui_impl_opengl3.cpp" />
<ClCompile Include="..\external\imgui\backends\imgui_impl_win32.cpp" />
<ClCompile Include="..\external\imgui\imgui.cpp" />
<ClCompile Include="..\external\imgui\imgui_demo.cpp" />
Expand Down Expand Up @@ -159,6 +160,7 @@
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\external\imgui\backends\imgui_impl_opengl2.h" />
<ClInclude Include="..\external\imgui\backends\imgui_impl_opengl3.h" />
<ClInclude Include="..\external\imgui\backends\imgui_impl_win32.h" />
<ClInclude Include="..\external\imgui\imconfig.h" />
<ClInclude Include="..\external\imgui\imgui.h" />
Expand Down
6 changes: 6 additions & 0 deletions GSChaos/GSChaos.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,9 @@
<ClCompile Include="CFeatureJeepy.cpp">
<Filter>Effects</Filter>
</ClCompile>
<ClCompile Include="..\external\imgui\backends\imgui_impl_opengl3.cpp">
<Filter>ImGUI</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="includes.h" />
Expand Down Expand Up @@ -380,6 +383,9 @@
<ClInclude Include="CFeatureJeepy.h">
<Filter>Effects</Filter>
</ClInclude>
<ClInclude Include="..\external\imgui\backends\imgui_impl_opengl3.h">
<Filter>ImGUI</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<Filter Include="Hooking">
Expand Down
Loading

0 comments on commit b72d49f

Please sign in to comment.