Skip to content

Commit

Permalink
HOTFIX to install DXGI/D3D11 hooks immediately rather than deferring …
Browse files Browse the repository at this point in the history
…them.
  • Loading branch information
Kaldaien committed Jan 1, 2025
1 parent 4100e3c commit 7d13606
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 11 deletions.
1 change: 1 addition & 0 deletions include/SpecialK/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -1720,6 +1720,7 @@ enum class SK_GAME_ID
ShinMegamiTensei3, // smt3hd.exe
TheQuarry, // TheQuarry-Win64-Shipping.exe
GenshinImpact, // GenshinImpact.exe
WutheringWaves, // WutheringWaves*****\Client-Win64-Shipping.exe
PathOfExile, // PathOfExileSteam.exe
Disgaea5, // Disgaea5.exe
SoulHackers2, // SOUL HACKERS2.exe
Expand Down
19 changes: 16 additions & 3 deletions src/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -293,9 +293,14 @@ SK_GetCurrentGameID (void)

if (app_id == 1382330)
current_game = SK_GAME_ID::Persona5Strikers;

if (StrStrIW (SK_GetFullyQualifiedApp (), L"WutheringWaves"))
{
current_game = SK_GAME_ID::WutheringWaves;
}

if ( StrStrIW ( SK_GetHostApp (), L"ffxv" ) ==
SK_GetHostApp () )
else if ( StrStrIW ( SK_GetHostApp (), L"ffxv" ) ==
SK_GetHostApp () )
{
if ( StrStrIW ( SK_GetHostApp (), L"ffxv_" ) )
{
Expand Down Expand Up @@ -3037,6 +3042,13 @@ auto DeclKeybind =
} break;

#ifdef _M_AMD64
case SK_GAME_ID::WutheringWaves:
{
// Work-around anti-cheat
config.compatibility.disable_debug_features = true;
config.system.handle_crashes = false;
} break;

case SK_GAME_ID::GenshinImpact:
{
// Work-around anti-cheat
Expand Down Expand Up @@ -5702,7 +5714,8 @@ auto DeclKeybind =
static auto code_sig =
SK_VerifyTrust_GetCodeSignature (SK_GetFullyQualifiedApp ());

if (StrStrIW (code_sig.subject.c_str (), L"COGNOSPHERE"))
if (StrStrIW (code_sig.subject.c_str (), L"COGNOSPHERE") ||
StrStrIW (code_sig.subject.c_str (), L"KURO TECHNOLOGY"))
{
config.compatibility.disable_debug_features = true;
}
Expand Down
4 changes: 2 additions & 2 deletions src/render/d3d11/d3d11.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6848,12 +6848,12 @@ SK_D3D11_Init (void)
{
InterlockedIncrementRelease (&SK_D3D11_initialized);

//bool bEnable = SK_EnableApplyQueuedHooks ();
bool bEnable = SK_EnableApplyQueuedHooks ();
{
success =
( MH_OK == SK_ApplyQueuedHooks () );
}
//if (! bEnable) SK_DisableApplyQueuedHooks ();
if (! bEnable) SK_DisableApplyQueuedHooks ();
}
}

Expand Down
10 changes: 5 additions & 5 deletions src/render/dxgi/dxgi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8459,11 +8459,11 @@ SK_HookDXGI (void)
{
SK_DXGI_DetermineHighestSupportedFactoryVersion ();

//bool bEnable = SK_EnableApplyQueuedHooks ();
//{
// SK_ApplyQueuedHooks ();
//}
//if (! bEnable) SK_DisableApplyQueuedHooks ();
bool bEnable = SK_EnableApplyQueuedHooks ();
{
SK_ApplyQueuedHooks ();
}
if (! bEnable) SK_DisableApplyQueuedHooks ();

static const IID iids [] = { IID_IDXGIFactory, IID_IDXGIFactory1, IID_IDXGIFactory2,
IID_IDXGIFactory3, IID_IDXGIFactory4, IID_IDXGIFactory5,
Expand Down
2 changes: 1 addition & 1 deletion src/utility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3154,7 +3154,7 @@ SK_DeleteTemporaryFiles (const wchar_t* wszPath, const wchar_t* wszPattern)
HANDLE
hFind = FindFirstFileW (wszFindPattern, &fd);

if (hFind != INVALID_HANDLE_VALUE)
if (hFind != INVALID_HANDLE_VALUE && StrStrIW (fd.cFileName, L"SKI"))
{
if (config.system.log_level >= 0)
{
Expand Down

0 comments on commit 7d13606

Please sign in to comment.