Skip to content

Commit

Permalink
Fix for texture injection with third-party EvilWare
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaldaien committed Jan 3, 2017
1 parent b1963d4 commit 9fcb1fa
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 25 deletions.
4 changes: 2 additions & 2 deletions UnX/DLL_VERSION.H
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

#define UNX_MAJOR 0
#define UNX_MINOR 8
#define UNX_BUILD 4
#define UNX_REV 2
#define UNX_BUILD 5
#define UNX_REV 0



Expand Down
42 changes: 24 additions & 18 deletions UnX/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,22 +49,24 @@ typedef void (WINAPI *SK_DXGI_SetPreferredAdapter_pfn) (int);
SK_DXGI_EnableFlipMode_pfn SK_DXGI_EnableFlipMode = nullptr;
SK_DXGI_SetPreferredAdapter_pfn SK_DXGI_SetPreferredAdapter = nullptr;

typedef void (WINAPI *SK_D3D11_SetResourceRoot_pfn) (const wchar_t*);
typedef void (WINAPI *SK_D3D11_EnableTexDump_pfn) (bool);
typedef void (WINAPI *SK_D3D11_EnableTexInjectFFX_pfn) (bool);
typedef void (WINAPI *SK_D3D11_EnableTexCache_pfn) (bool);
typedef void (WINAPI *SK_D3D11_AddTexHash_pfn) (const wchar_t*, uint32_t, uint32_t);
typedef void (WINAPI *SK_D3D11_RemoveTexHash_pfn) (uint32_t);
typedef void (WINAPI *SK_D3D11_SetResourceRoot_pfn) (const wchar_t*);
typedef void (WINAPI *SK_D3D11_EnableTexDump_pfn) (bool);
typedef void (WINAPI *SK_D3D11_EnableTexInjectFFX_pfn) (bool);
typedef void (WINAPI *SK_D3D11_EnableTexCache_pfn) (bool);
typedef void (WINAPI *SK_D3D11_AddTexHash_pfn) (const wchar_t*, uint32_t, uint32_t);
typedef void (WINAPI *SK_D3D11_RemoveTexHash_pfn) (uint32_t);
typedef void (WINAPI *SK_D3D11_PopulateResourceList_pfn) (void);

typedef void (WINAPI *SKX_D3D11_MarkTextures_pfn) (bool,bool,bool);
typedef void (WINAPI *SKX_D3D11_EnableFullscreen_pfn) (bool);

SK_D3D11_SetResourceRoot_pfn SK_D3D11_SetResourceRoot = nullptr;
SK_D3D11_EnableTexDump_pfn SK_D3D11_EnableTexDump = nullptr;
SK_D3D11_EnableTexInjectFFX_pfn SK_D3D11_EnableTexInject = nullptr;
SK_D3D11_EnableTexCache_pfn SK_D3D11_EnableTexCache = nullptr;
SK_D3D11_AddTexHash_pfn SK_D3D11_AddTexHash = nullptr;
SK_D3D11_RemoveTexHash_pfn SK_D3D11_RemoveTexHash = nullptr;
SK_D3D11_SetResourceRoot_pfn SK_D3D11_SetResourceRoot = nullptr;
SK_D3D11_EnableTexDump_pfn SK_D3D11_EnableTexDump = nullptr;
SK_D3D11_EnableTexInjectFFX_pfn SK_D3D11_EnableTexInject = nullptr;
SK_D3D11_EnableTexCache_pfn SK_D3D11_EnableTexCache = nullptr;
SK_D3D11_AddTexHash_pfn SK_D3D11_AddTexHash = nullptr;
SK_D3D11_RemoveTexHash_pfn SK_D3D11_RemoveTexHash = nullptr;
SK_D3D11_PopulateResourceList_pfn SK_D3D11_PopulateResourceList = nullptr;

SKX_D3D11_MarkTextures_pfn SKX_D3D11_MarkTextures = nullptr;
SKX_D3D11_EnableFullscreen_pfn SKX_D3D11_EnableFullscreen = nullptr;
Expand Down Expand Up @@ -209,15 +211,16 @@ UNX_SetupTexMgmt (void)
(SK_D3D11_RemoveTexHash_pfn)
GetProcAddress (hInjectorDLL, "SK_D3D11_RemoveTexHash");

SKX_D3D11_MarkTextures =
(SKX_D3D11_MarkTextures_pfn)
GetProcAddress (hInjectorDLL, "SKX_D3D11_MarkTextures");
SK_D3D11_PopulateResourceList =
(SK_D3D11_PopulateResourceList_pfn)
GetProcAddress (hInjectorDLL, "SK_D3D11_PopulateResourceList");

// Ignore SKX_..., these are experimental things and the software
// must work even if SpecialK removes the function.
if ( SK_D3D11_SetResourceRoot != nullptr && SK_D3D11_EnableTexDump != nullptr &&
SK_D3D11_EnableTexInject != nullptr && SK_D3D11_EnableTexCache != nullptr &&
SK_D3D11_AddTexHash != nullptr && SK_D3D11_RemoveTexHash != nullptr ) {
if ( SK_D3D11_SetResourceRoot != nullptr && SK_D3D11_EnableTexDump != nullptr &&
SK_D3D11_EnableTexInject != nullptr && SK_D3D11_EnableTexCache != nullptr &&
SK_D3D11_AddTexHash != nullptr && SK_D3D11_RemoveTexHash != nullptr &&
SK_D3D11_PopulateResourceList != nullptr ) {
return true;
}

Expand Down Expand Up @@ -732,6 +735,9 @@ UNX_LoadConfig (std::wstring name)

if (config.textures.inject)
SK_D3D11_AddTexHash (L"Title.dds", 0xA4FFC068, 0x00);

if (config.textures.inject || config.textures.dump)
SK_D3D11_PopulateResourceList ();
}

UNX_SaveConfig (name);
Expand Down
13 changes: 8 additions & 5 deletions version.ini
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
[Version.Latest]
Title="Untitled" Project X (v 0.8.4.2)
Title="Untitled" Project X (v 0.8.5)
BranchDescription=Default branch; fewer updates but stable.
Description=Compatibility Updates (Final?) :: RTFM to turn OSD OFF - TL;DR: Ctrl + Shift + O
ReleaseNotes=https://github.com/Kaldaien/UnX/releases/tag/unx_084
InstallPackage=UNX_0_8_4_2,19
Description=Fix for evil third-party software and texture injection :: RTFM to turn OSD OFF - TL;DR: Ctrl + Shift + O
ReleaseNotes=https://github.com/Kaldaien/UnX/releases/tag/unx_085
InstallPackage=UNX_0_8_5,20

[Version.Testing]
Title="Untitled" Project X (v 0.8.4)
BranchDescription=Latest Test Release (0.8.x)
Description=Suspends background threads during initialization
ReleaseNotes=https://github.com/Kaldaien/UNX/releases/latest
ReleaseNotes=https://github.com/Kaldaien/UnX/releases/tag/unx_084
InstallPackage=UNX_0_8_4,16

[Version.Compatibility]
Expand All @@ -19,6 +19,9 @@ Description=Adds Keyboard Soft Reset Support (Ctrl + Shift + Backspace)
ReleaseNotes=https://github.com/Kaldaien/UnX/releases/tag/unx_073
InstallPackage=UNX_0_7_3,4

[Archive.UNX_0_8_5]
URL=https://github.com/Kaldaien/UnX/releases/download/unx_085/UnX.7z

[Archive.UNX_0_8_4_2]
URL=https://github.com/Kaldaien/UnX/releases/download/unx_084/UnX_0_8_4_2.7z

Expand Down

0 comments on commit 9fcb1fa

Please # to comment.