From 840c8faef3063b7d150ea54599389f22220ace8b Mon Sep 17 00:00:00 2001 From: korenkonder Date: Tue, 2 Apr 2024 14:52:54 +0300 Subject: [PATCH] Removed unused options --- DivaGL.sln | 10 --- src/DivaGL/DivaGL.vcxproj | 127 +-------------------------------- src/DivaGL/DivaGL.vcxproj.user | 12 ---- src/DivaGL/dllmain.cpp | 72 ------------------- 4 files changed, 2 insertions(+), 219 deletions(-) diff --git a/DivaGL.sln b/DivaGL.sln index 8a4c8b9..cb4f4fc 100644 --- a/DivaGL.sln +++ b/DivaGL.sln @@ -12,27 +12,17 @@ EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|x64 = Debug|x64 - DebugDLL|x64 = DebugDLL|x64 Release|x64 = Release|x64 - ReleaseDLL|x64 = ReleaseDLL|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {65707AD3-568A-4FE9-A75E-BDBF3D5EFC88}.Debug|x64.ActiveCfg = DebugOpt|x64 {65707AD3-568A-4FE9-A75E-BDBF3D5EFC88}.Debug|x64.Build.0 = DebugOpt|x64 - {65707AD3-568A-4FE9-A75E-BDBF3D5EFC88}.DebugDLL|x64.ActiveCfg = DebugOpt|x64 - {65707AD3-568A-4FE9-A75E-BDBF3D5EFC88}.DebugDLL|x64.Build.0 = DebugOpt|x64 {65707AD3-568A-4FE9-A75E-BDBF3D5EFC88}.Release|x64.ActiveCfg = Release|x64 {65707AD3-568A-4FE9-A75E-BDBF3D5EFC88}.Release|x64.Build.0 = Release|x64 - {65707AD3-568A-4FE9-A75E-BDBF3D5EFC88}.ReleaseDLL|x64.ActiveCfg = Release|x64 - {65707AD3-568A-4FE9-A75E-BDBF3D5EFC88}.ReleaseDLL|x64.Build.0 = Release|x64 {4D949362-9095-4113-9423-7E0492618F16}.Debug|x64.ActiveCfg = Debug|x64 {4D949362-9095-4113-9423-7E0492618F16}.Debug|x64.Build.0 = Debug|x64 - {4D949362-9095-4113-9423-7E0492618F16}.DebugDLL|x64.ActiveCfg = DebugDLL|x64 - {4D949362-9095-4113-9423-7E0492618F16}.DebugDLL|x64.Build.0 = DebugDLL|x64 {4D949362-9095-4113-9423-7E0492618F16}.Release|x64.ActiveCfg = Release|x64 {4D949362-9095-4113-9423-7E0492618F16}.Release|x64.Build.0 = Release|x64 - {4D949362-9095-4113-9423-7E0492618F16}.ReleaseDLL|x64.ActiveCfg = ReleaseDLL|x64 - {4D949362-9095-4113-9423-7E0492618F16}.ReleaseDLL|x64.Build.0 = ReleaseDLL|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/DivaGL/DivaGL.vcxproj b/src/DivaGL/DivaGL.vcxproj index adad8c3..353cba3 100644 --- a/src/DivaGL/DivaGL.vcxproj +++ b/src/DivaGL/DivaGL.vcxproj @@ -1,18 +1,10 @@ - - DebugDLL - x64 - Debug x64 - - ReleaseDLL - x64 - Release x64 @@ -31,24 +23,12 @@ v142 Unicode - - DynamicLibrary - false - v142 - Unicode - DynamicLibrary false v142 Unicode - - DynamicLibrary - false - v142 - Unicode - @@ -56,15 +36,9 @@ - - - - - - false @@ -73,13 +47,6 @@ $(SolutionDir)obj\debug\DivaGL\ .dva - - false - dinput8 - $(SolutionDir)bin\ - $(SolutionDir)obj\debug\DivaGL\ - .dll - false DivaGL @@ -87,13 +54,6 @@ $(SolutionDir)obj\release\DivaGL\ .dva - - false - dinput8 - $(SolutionDir)bin\ - $(SolutionDir)obj\release\DivaGL\ - .dll - NotUsing @@ -125,45 +85,7 @@ copy /Y "$(SolutionDir)bin\$(TargetName).dva" "N:\DUMP\plugins\$(TargetName).dva" -copy /Y "$(SolutionDir)bin\$(TargetName).pdb" "N:\DUMP\plugins\$(TargetName).pdb" -del "$(SolutionDir)bin\$(TargetName).exp" -del "$(SolutionDir)bin\$(TargetName).lib" - - - - - NotUsing - Level3 - Disabled - WIN32;DINPUT8_DLL;DEBUG;%(PreprocessorDefinitions) - $(SolutionDir)extern\src - true - ProgramDatabase - false - OnlyExplicitInline - FastCall - true - CompileAsCpp - $(IntDir)/%(RelativeDir) - MultiThreaded - 26812 - false - true - - - MachineX64 - DebugFull - Windows - $(SolutionDir)extern\lib;$(SolutionDir)lib\debugopt\ - opengl32.lib;detours.lib;syelog.lib;libdeflatestatic.lib;KKdLib.lib;%(AdditionalDependencies) - /ignore:4098 /ignore:4099 /ignore:4286 %(AdditionalOptions) - false - - - copy /Y "$(SolutionDir)bin\$(TargetName).dll" "N:\DUMP\$(TargetName).dll" -copy /Y "$(SolutionDir)bin\$(TargetName).pdb" "N:\DUMP\$(TargetName).pdb" -del "$(SolutionDir)bin\$(TargetName).exp" -del "$(SolutionDir)bin\$(TargetName).lib" +copy /Y "$(SolutionDir)bin\$(TargetName).pdb" "N:\DUMP\plugins\$(TargetName).pdb" @@ -204,52 +126,7 @@ del "$(SolutionDir)bin\$(TargetName).lib" copy /Y "$(SolutionDir)bin\$(TargetName).dva" "N:\DUMP\plugins\$(TargetName).dva" -copy /Y "$(SolutionDir)bin\$(TargetName).pdb" "N:\DUMP\plugins\$(TargetName).pdb" -del "$(SolutionDir)bin\$(TargetName).exp" -del "$(SolutionDir)bin\$(TargetName).lib" - - - - - NotUsing - Level3 - MaxSpeed - WIN32;DINPUT8_DLL;%(PreprocessorDefinitions) - $(SolutionDir)extern\src - true - false - ProgramDatabase - OnlyExplicitInline - true - FastCall - CompileAsCpp - - - $(IntDir)/%(RelativeDir) - Size - - - false - MultiThreaded - 26812 - true - - - MachineX64 - true - Windows - $(SolutionDir)extern\lib;$(SolutionDir)lib\release\ - opengl32.lib;detours.lib;syelog.lib;libdeflatestatic.lib;KKdLib.lib;%(AdditionalDependencies) - true - /ignore:4098 /ignore:4099 /ignore:4286 %(AdditionalOptions) - true - false - - - copy /Y "$(SolutionDir)bin\$(TargetName).dll" "N:\DUMP\$(TargetName).dll" -copy /Y "$(SolutionDir)bin\$(TargetName).pdb" "N:\DUMP\$(TargetName).pdb" -del "$(SolutionDir)bin\$(TargetName).exp" -del "$(SolutionDir)bin\$(TargetName).lib" +copy /Y "$(SolutionDir)bin\$(TargetName).pdb" "N:\DUMP\plugins\$(TargetName).pdb" diff --git a/src/DivaGL/DivaGL.vcxproj.user b/src/DivaGL/DivaGL.vcxproj.user index c23e4d1..ab189b6 100644 --- a/src/DivaGL/DivaGL.vcxproj.user +++ b/src/DivaGL/DivaGL.vcxproj.user @@ -6,24 +6,12 @@ WindowsLocalDebugger --launch -w - - N:\DUMP\diva.exe - N:\DUMP - WindowsLocalDebugger - --launch -w - N:\DUMP\diva.exe --launch -w N:\DUMP WindowsLocalDebugger - - N:\DUMP\diva.exe - --launch -w - N:\DUMP - WindowsLocalDebugger - true diff --git a/src/DivaGL/dllmain.cpp b/src/DivaGL/dllmain.cpp index ab9741c..c6cf564 100644 --- a/src/DivaGL/dllmain.cpp +++ b/src/DivaGL/dllmain.cpp @@ -19,61 +19,6 @@ size_t dll_handle; bool aes_ni; bool f16c; -#if defined(DINPUT8_DLL) -struct dinput8 { - HMODULE dll; - HRESULT(*DirectInput8Create)(HINSTANCE hinst, - DWORD dwVersion, REFIID riidltf, LPVOID* ppvOut, LPUNKNOWN punkOuter); - - void LoadOriginalLibrary(HMODULE module) { - dll = module; - DirectInput8Create = (HRESULT(*)(HINSTANCE hinst, DWORD dwVersion, - REFIID riidltf, LPVOID * ppvOut, LPUNKNOWN punkOuter))GetProcAddress(dll, "DirectInput8Create"); - } -} dinput8; - -extern "C" __declspec(dllexport) HRESULT DirectInput8Create(HINSTANCE hinst, - DWORD dwVersion, REFIID riidltf, LPVOID * ppvOut, LPUNKNOWN punkOuter) { - if (!dinput8.DirectInput8Create) - return (HRESULT)0x80000002; - return dinput8.DirectInput8Create(hinst, dwVersion, riidltf, ppvOut, punkOuter); -} - -void load_original_dll() { - wchar_t dll_file_path[MAX_PATH]; - GetModuleFileNameW((HMODULE)dll_handle, dll_file_path, MAX_PATH); - - wchar_t* dll_file_name = wcsrchr(dll_file_path, '\\'); - if (!dll_file_name) - dll_file_name = wcsrchr(dll_file_path, '/'); - - if (!dll_file_name) - return; - - dll_file_name++; - - _wcslwr_s(dll_file_name, MAX_PATH - (dll_file_name - dll_file_path)); - - wchar_t* sys_folder; - if (dll_file_name && SUCCEEDED(SHGetKnownFolderPath(FOLDERID_System, 0, 0, &sys_folder))) { - size_t dll_path_len = wcslen(sys_folder) + wcslen(dll_file_name) + 2; - wchar_t* dll_path = (wchar_t*)malloc(sizeof(wchar_t) * dll_path_len); - if (dll_path) { - wcscpy_s(dll_path, dll_path_len, sys_folder); - wcscat_s(dll_path, dll_path_len, L"\\"); - wcscat_s(dll_path, dll_path_len, dll_file_name); - if (!wcscmp(dll_file_name, L"dinput8.dll")) { - HMODULE dinput8_handle = LoadLibraryW(dll_path); - if (dinput8_handle) - dinput8.LoadOriginalLibrary(dinput8_handle); - } - free(dll_path); - } - CoTaskMemFree((LPVOID)sys_folder); - } -} -#endif - void FASTCALL divagl_main() { int32_t cpuid_data[4] = {}; __cpuid(cpuid_data, 1); @@ -91,15 +36,6 @@ void FASTCALL divagl_main() { return; } -#if defined(DINPUT8_DLL) - load_original_dll(); - LoadLibraryW(L"plugins\\DivaSound.dva"); - LoadLibraryW(L"plugins\\Patches.dva"); - LoadLibraryW(L"plugins\\TLAC.dva"); -#endif - //Sleep(5000); - //return; - wrap_addresses(); printf_divagl("Patching memory"); @@ -110,14 +46,6 @@ void FASTCALL divagl_main() { bool APIENTRY DllMain(HMODULE handle, DWORD ul_reason_for_call, LPVOID lpReserved) { switch (ul_reason_for_call) { case DLL_PROCESS_ATTACH: - /*if (!GetConsoleWindow()) - AllocConsole(); - - FILE* f_stdin = 0; - FILE* f_stdout = 0; - freopen_s(&f_stdin, "CONIN$", "r", stdin); - freopen_s(&f_stdout, "CONOUT$", "w", stdout);*/ - dll_handle = (size_t)handle; printf_divagl("Current version - v0.5.2.0"); printf_divagl("Attach");