diff --git a/.gitignore b/.gitignore index a426adb..f2f1ba5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,10 @@ *.sdf *.user *.opensdf -Release \ No newline at end of file +*.suo +Release +Debug/ +Release/ +.vs/ +*.VC.VC.opendb +*.VC.db diff --git a/DSfix.sln b/DSfix.sln index 8548d66..ea6106c 100644 --- a/DSfix.sln +++ b/DSfix.sln @@ -4,20 +4,11 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DSfix", "DSfix.vcxproj", "{ EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Debug|x64 = Debug|x64 Release|Win32 = Release|Win32 - Release|x64 = Release|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {E004A114-54E0-B15C-BDA5-46681084E257}.Debug|Win32.ActiveCfg = Debug|Win32 - {E004A114-54E0-B15C-BDA5-46681084E257}.Debug|Win32.Build.0 = Debug|Win32 - {E004A114-54E0-B15C-BDA5-46681084E257}.Debug|x64.ActiveCfg = Debug|x64 - {E004A114-54E0-B15C-BDA5-46681084E257}.Debug|x64.Build.0 = Debug|x64 {E004A114-54E0-B15C-BDA5-46681084E257}.Release|Win32.ActiveCfg = Release|Win32 {E004A114-54E0-B15C-BDA5-46681084E257}.Release|Win32.Build.0 = Release|Win32 - {E004A114-54E0-B15C-BDA5-46681084E257}.Release|x64.ActiveCfg = Release|x64 - {E004A114-54E0-B15C-BDA5-46681084E257}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/DSfix.v11.suo b/DSfix.v11.suo deleted file mode 100644 index aaa1b11..0000000 Binary files a/DSfix.v11.suo and /dev/null differ diff --git a/DSfix.vcxproj b/DSfix.vcxproj index ce32a8a..fad2fff 100644 --- a/DSfix.vcxproj +++ b/DSfix.vcxproj @@ -1,22 +1,10 @@  - - Debug - Win32 - - - Debug - x64 - Release Win32 - - Release - x64 - @@ -26,25 +14,7 @@ {E004A114-54E0-B15C-BDA5-46681084E257} - - DynamicLibrary - false - MultiByte - v110 - - - DynamicLibrary - false - MultiByte - v110 - - DynamicLibrary - false - MultiByte - v100 - - DynamicLibrary false MultiByte @@ -53,38 +23,20 @@ - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 .\Release\ .\Release\ false - false - .\Debug\ - .\Debug\ - false - false - C:\dev\OculusSDK\LibOVR\Include;C:\dev\Detours Express 3.0\include;$(IncludePath) - E:\Program Files %28x86%29\Microsoft DirectX SDK %28June 2010%29\Include;$(IncludePath) + $(DXSDK_DIR)\Include;$(IncludePath) DINPUT8 - d3d9 - DINPUT8 - d3d9 - C:\dev\OculusSDK\LibOVR\Lib\Win32;C:\Program Files (x86)\Microsoft DirectX SDK (August 2009)\Lib\x86;C:\dev\Detours Express 3.0\lib.X86;$(LibraryPath) + $(DXSDK_DIR)\Lib\x86;$(LibraryPath) @@ -104,18 +56,19 @@ true Speed StreamingSIMDExtensions2 + 4005 true MachineX86 - E:\Program Files %28x86%29\Microsoft DirectX SDK %28June 2010%29\Lib\x86;%(AdditionalLibraryDirectories) + %(AdditionalLibraryDirectories) DINPUT8.def - winmm.lib;detours.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;psapi.lib;%(AdditionalDependencies) + winmm.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;psapi.lib;%(AdditionalDependencies) - Default + UseLinkTimeCodeGeneration NDEBUG;%(PreprocessorDefinitions) @@ -130,126 +83,14 @@ 0x0409 - cp $(TargetPath) "E:\Steam\steamapps\common\Dark Souls Prepare to Die Edition\DATA" + + - - - MaxSpeed - OnlyExplicitInline - WIN32;NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) - true - MultiThreaded - true - - - .\Release/ - .\Release/ - .\Release/ - Level3 - true - - - true - C:\Program Files %28x86%29\Microsoft DirectX SDK %28June 2010%29\Lib\x86;%(AdditionalLibraryDirectories) - - - NDEBUG;%(PreprocessorDefinitions) - true - true - - - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - - - Disabled - WIN32;_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - .\Debug/ - .\Debug/ - .\Debug/ - true - Level3 - true - EditAndContinue - C:\Program Files %28x86%29\Microsoft DirectX SDK %28June 2010%29\Include;%(AdditionalIncludeDirectories) - - - true - true - MachineX86 - C:\Program Files %28x86%29\Microsoft DirectX SDK %28June 2010%29\Lib\x86;%(AdditionalLibraryDirectories) - - - _DEBUG;%(PreprocessorDefinitions) - true - true - Win32 - - - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - - - Disabled - WIN32;_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - .\Debug/ - .\Debug/ - .\Debug/ - true - Level3 - true - ProgramDatabase - E:\Program Files %28x86%29\Microsoft DirectX SDK %28June 2010%29\Include;%(AdditionalIncludeDirectories) - - - .\Debug/d3d9.dll - true - true - E:\Program Files %28x86%29\Microsoft DirectX SDK %28June 2010%29\Lib\x86;%(AdditionalLibraryDirectories) - - - _DEBUG;%(PreprocessorDefinitions) - true - true - - - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - Disabled - Disabled - WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL - WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL - EnableFastChecks - EnableFastChecks - true - true MaxSpeed - MaxSpeed WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL - WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL @@ -261,46 +102,16 @@ - Disabled - Disabled - WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL - WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL - EnableFastChecks - EnableFastChecks - true - true MaxSpeed - MaxSpeed WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL - WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL - Disabled - Disabled - WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL - WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL - EnableFastChecks - EnableFastChecks - true - true MaxSpeed - MaxSpeed WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL - WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL - Disabled - Disabled - WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL - WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL - EnableFastChecks - EnableFastChecks - true - true MaxSpeed - MaxSpeed WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL - WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL diff --git a/DSfix.vcxproj.filters b/DSfix.vcxproj.filters new file mode 100644 index 0000000..703042d --- /dev/null +++ b/DSfix.vcxproj.filters @@ -0,0 +1,154 @@ + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + + + + + + + + + + {b7358087-4926-4614-a239-dcc17176b6d8} + + + {55ebbcd6-421b-458a-abd5-c9d7c082044d} + + + \ No newline at end of file diff --git a/Detouring.cpp b/Detouring.cpp index ac2b7c8..8141f17 100644 --- a/Detouring.cpp +++ b/Detouring.cpp @@ -74,49 +74,68 @@ HRESULT WINAPI DetouredD3DXCompileShader(_In_ LPCSTR pSrcData, _In_ UINT srcData return res; } +void hookFunction(const char* name, const char* dllname, void** ppTarget, void* const pDetour, void** ppOriginal) { + HMODULE dllHandle = GetModuleHandle(dllname); + *ppTarget = GetProcAddress(dllHandle, name); + MH_STATUS ret = MH_CreateHook(*ppTarget, pDetour, ppOriginal); + if (ret == MH_OK) { + SDLOG(2, "MH_CreateHook for %s in %s succeeded\n", name, dllname); + } + else { + SDLOG(0, "MH_CreateHook for %s in %s failed\n", name, dllname); + SDLOG(0, "dllHandle = %p\n", dllHandle); + SDLOG(0, "*ppTarget = %p\n", *ppTarget); + } + ret = MH_EnableHook(*ppTarget); + if (ret == MH_OK) { + SDLOG(2, "MH_EnableHook succeeded\n"); + } + else { + SDLOG(0, "MH_EnableHook failed\n"); + } +} + +namespace { + void* TargetDirect3DCreate9; + void* TargetQueryPerformanceCounter; + void* TargetD3DXCreateTextureFromFileInMemory; + void* TargetD3DXCreateTextureFromFileInMemoryEx; +} + void earlyDetour() { QueryPerformanceFrequency(&countsPerSec); - DetourTransactionBegin(); - DetourUpdateThread(GetCurrentThread()); - DetourAttach(&(PVOID&)oDirect3DCreate9, hkDirect3DCreate9); - DetourTransactionCommit(); + MH_Initialize(); + hookFunction("Direct3DCreate9", + "d3d9.dll", + &TargetDirect3DCreate9, + &hkDirect3DCreate9, + reinterpret_cast(&oDirect3DCreate9)); } -void startDetour() { - DetourTransactionBegin(); - DetourUpdateThread(GetCurrentThread()); - //DetourAttach(&(PVOID&)TrueSleepEx, DetouredSleepEx); - //DetourAttach(&(PVOID&)TrueTimeGetTime, DetouredTimeGetTime); - if(Settings::get().getSkipIntro()) DetourAttach(&(PVOID&)TrueQueryPerformanceCounter, DetouredQueryPerformanceCounter); - //TrueD3DXCreateTexture = (D3DXCreateTexture_FNType)DetourFindFunction("d3dx9_43.dll", "D3DXCreateTexture"); - TrueD3DXCreateTextureFromFileInMemory = (D3DXCreateTextureFromFileInMemory_FNType)DetourFindFunction("d3dx9_43.dll", "D3DXCreateTextureFromFileInMemory"); - TrueD3DXCreateTextureFromFileInMemoryEx = (D3DXCreateTextureFromFileInMemoryEx_FNType)DetourFindFunction("d3dx9_43.dll", "D3DXCreateTextureFromFileInMemoryEx"); - //DetourAttach(&(PVOID&)TrueD3DXCreateTexture, DetouredD3DXCreateTexture); - DetourAttach(&(PVOID&)TrueD3DXCreateTextureFromFileInMemory, DetouredD3DXCreateTextureFromFileInMemory); - DetourAttach(&(PVOID&)TrueD3DXCreateTextureFromFileInMemoryEx, DetouredD3DXCreateTextureFromFileInMemoryEx); - //TrueD3DXCompileShader = (D3DXCompileShader_FNType)DetourFindFunction("d3dx9_43.dll", "D3DXCompileShader"); - //SDLOG(0, "Detouring: compile shader: %p\n", TrueD3DXCompileShader); - //DetourAttach(&(PVOID&)TrueD3DXCompileShader, DetouredD3DXCompileShader); - - if(DetourTransactionCommit() == NO_ERROR) { - SDLOG(0, "Detouring: Detoured successfully\n"); - } else { - SDLOG(0, "Detouring: Error detouring\n"); +void startDetour() { + if (Settings::get().getSkipIntro()) { + hookFunction("QueryPerformanceCounter", + "kernel32.dll", + &TargetQueryPerformanceCounter, + &DetouredQueryPerformanceCounter, + reinterpret_cast(&TrueQueryPerformanceCounter)); } + hookFunction("D3DXCreateTextureFromFileInMemory", + "d3dx9_43.dll", + &TargetD3DXCreateTextureFromFileInMemory, + &DetouredD3DXCreateTextureFromFileInMemory, + reinterpret_cast(&TrueD3DXCreateTextureFromFileInMemory)); + hookFunction("D3DXCreateTextureFromFileInMemoryEx", + "d3dx9_43.dll", + &TargetD3DXCreateTextureFromFileInMemoryEx, + &DetouredD3DXCreateTextureFromFileInMemoryEx, + reinterpret_cast(&TrueD3DXCreateTextureFromFileInMemoryEx)); } void endDetour() { - //if(Settings::get().getSkipIntro()) { - DetourTransactionBegin(); - DetourUpdateThread(GetCurrentThread()); - //DetourDetach(&(PVOID&)TrueSleepEx, DetouredSleepEx); - //DetourDetach(&(PVOID&)TrueTimeGetTime, DetouredTimeGetTime); - if(Settings::get().getSkipIntro()) DetourDetach(&(PVOID&)TrueQueryPerformanceCounter, DetouredQueryPerformanceCounter); - //DetourDetach(&(PVOID&)TrueD3DXCreateTexture, DetouredD3DXCreateTexture); - DetourDetach(&(PVOID&)TrueD3DXCreateTextureFromFileInMemory, DetouredD3DXCreateTextureFromFileInMemory); - DetourDetach(&(PVOID&)TrueD3DXCreateTextureFromFileInMemoryEx, DetouredD3DXCreateTextureFromFileInMemoryEx); - DetourDetach(&(PVOID&)oDirect3DCreate9, hkDirect3DCreate9); - //DetourDetach(&(PVOID&)TrueD3DXCompileShader, DetouredD3DXCompileShader); - DetourTransactionCommit(); - //} + MH_RemoveHook(TargetDirect3DCreate9); + MH_RemoveHook(TargetQueryPerformanceCounter); + MH_RemoveHook(TargetD3DXCreateTextureFromFileInMemory); + MH_RemoveHook(TargetD3DXCreateTextureFromFileInMemoryEx); + MH_Uninitialize(); } diff --git a/Detouring.h b/Detouring.h index ebd5f7a..93ef0cc 100644 --- a/Detouring.h +++ b/Detouring.h @@ -2,7 +2,8 @@ #include "main.h" -#include +#include "minhook/MinHook.h" +#pragma comment(lib, "minhook\\libMinhook.x86.lib") static DWORD (WINAPI * TrueSleepEx)(DWORD dwMilliseconds, BOOL bAlertable) = SleepEx; diff --git a/SaveManager.cpp b/SaveManager.cpp index 0a53d32..dcdf7fb 100644 --- a/SaveManager.cpp +++ b/SaveManager.cpp @@ -26,7 +26,7 @@ void SaveManager::init() { if(searchHandle != INVALID_HANDLE_VALUE) { do { std::string fn = userSaveFolderData.cFileName; - bool dir = userSaveFolderData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY; + bool dir = !!(userSaveFolderData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY); bool saveFile = fn.substr(fn.find_last_of(".") + 1) == "sl2"; // newer versions don't contain an additional folder under NBGI\\DarkSouls if (fn.size() > 2 && (dir || saveFile)) { @@ -103,7 +103,7 @@ void SaveManager::backup(const time_t curTime) { vector saveFiles = getSaveFiles(); for(size_t i=0; i(curTime)); string newPath = string(buffer) + fn + ".bak"; if(CopyFile(saveFiles[i].c_str(), newPath.c_str(), false) == 0) { SDLOG(0, "ERROR: SaveManager failed to back up file! (Copying %s to %s)\n", saveFiles[i].c_str(), buffer); diff --git a/d3d9.h b/d3d9.h index d512f4b..45cbc0a 100644 --- a/d3d9.h +++ b/d3d9.h @@ -1,5 +1,7 @@ #pragma once +//Download & Install https://www.microsoft.com/en-us/download/details.aspx?id=6812 + #pragma comment(lib, "d3d9.lib") #pragma comment(lib, "d3dx9.lib") #pragma comment(lib, "dxguid.lib") diff --git a/d3d9dev.cpp b/d3d9dev.cpp index 4d1f86a..57dbed1 100644 --- a/d3d9dev.cpp +++ b/d3d9dev.cpp @@ -579,7 +579,7 @@ HRESULT APIENTRY hkIDirect3DDevice9::SetPixelShaderConstantF(UINT StartRegister, UINT width; UINT height; - getDofRes(HALF_X_RESOLUTION, HALF_Y_RESOLUTION, width, height); + getDofRes(static_cast(HALF_X_RESOLUTION), static_cast(HALF_Y_RESOLUTION), width, height); pBuffer[offset] = static_cast(width); pBuffer[offset + 1] = static_cast(height); pBuffer[offset + 2] = 1.f / width; diff --git a/minhook/MinHook.h b/minhook/MinHook.h new file mode 100644 index 0000000..31b9d06 --- /dev/null +++ b/minhook/MinHook.h @@ -0,0 +1,166 @@ +/* + * MinHook - The Minimalistic API Hooking Library for x64/x86 + * Copyright (C) 2009-2015 Tsuda Kageyu. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#pragma once + +#if !(defined _M_IX86) && !(defined _M_X64) + #error MinHook supports only x86 and x64 systems. +#endif + +#include + +// MinHook Error Codes. +typedef enum MH_STATUS +{ + // Unknown error. Should not be returned. + MH_UNKNOWN = -1, + + // Successful. + MH_OK = 0, + + // MinHook is already initialized. + MH_ERROR_ALREADY_INITIALIZED, + + // MinHook is not initialized yet, or already uninitialized. + MH_ERROR_NOT_INITIALIZED, + + // The hook for the specified target function is already created. + MH_ERROR_ALREADY_CREATED, + + // The hook for the specified target function is not created yet. + MH_ERROR_NOT_CREATED, + + // The hook for the specified target function is already enabled. + MH_ERROR_ENABLED, + + // The hook for the specified target function is not enabled yet, or already + // disabled. + MH_ERROR_DISABLED, + + // The specified pointer is invalid. It points the address of non-allocated + // and/or non-executable region. + MH_ERROR_NOT_EXECUTABLE, + + // The specified target function cannot be hooked. + MH_ERROR_UNSUPPORTED_FUNCTION, + + // Failed to allocate memory. + MH_ERROR_MEMORY_ALLOC, + + // Failed to change the memory protection. + MH_ERROR_MEMORY_PROTECT, + + // The specified module is not loaded. + MH_ERROR_MODULE_NOT_FOUND, + + // The specified function is not found. + MH_ERROR_FUNCTION_NOT_FOUND +} +MH_STATUS; + +// Can be passed as a parameter to MH_EnableHook, MH_DisableHook, +// MH_QueueEnableHook or MH_QueueDisableHook. +#define MH_ALL_HOOKS NULL + +#ifdef __cplusplus +extern "C" { +#endif + + // Initialize the MinHook library. You must call this function EXACTLY ONCE + // at the beginning of your program. + MH_STATUS WINAPI MH_Initialize(VOID); + + // Uninitialize the MinHook library. You must call this function EXACTLY + // ONCE at the end of your program. + MH_STATUS WINAPI MH_Uninitialize(VOID); + + // Creates a Hook for the specified target function, in disabled state. + // Parameters: + // pTarget [in] A pointer to the target function, which will be + // overridden by the detour function. + // pDetour [in] A pointer to the detour function, which will override + // the target function. + // ppOriginal [out] A pointer to the trampoline function, which will be + // used to call the original target function. + // This parameter can be NULL. + MH_STATUS WINAPI MH_CreateHook(LPVOID pTarget, LPVOID pDetour, LPVOID *ppOriginal); + + // Creates a Hook for the specified API function, in disabled state. + // Parameters: + // pszModule [in] A pointer to the loaded module name which contains the + // target function. + // pszTarget [in] A pointer to the target function name, which will be + // overridden by the detour function. + // pDetour [in] A pointer to the detour function, which will override + // the target function. + // ppOriginal [out] A pointer to the trampoline function, which will be + // used to call the original target function. + // This parameter can be NULL. + MH_STATUS WINAPI MH_CreateHookApi( + LPCWSTR pszModule, LPCSTR pszProcName, LPVOID pDetour, LPVOID *ppOriginal); + + // Removes an already created hook. + // Parameters: + // pTarget [in] A pointer to the target function. + MH_STATUS WINAPI MH_RemoveHook(LPVOID pTarget); + + // Enables an already created hook. + // Parameters: + // pTarget [in] A pointer to the target function. + // If this parameter is MH_ALL_HOOKS, all created hooks are + // enabled in one go. + MH_STATUS WINAPI MH_EnableHook(LPVOID pTarget); + + // Disables an already created hook. + // Parameters: + // pTarget [in] A pointer to the target function. + // If this parameter is MH_ALL_HOOKS, all created hooks are + // disabled in one go. + MH_STATUS WINAPI MH_DisableHook(LPVOID pTarget); + + // Queues to enable an already created hook. + // Parameters: + // pTarget [in] A pointer to the target function. + // If this parameter is MH_ALL_HOOKS, all created hooks are + // queued to be enabled. + MH_STATUS WINAPI MH_QueueEnableHook(LPVOID pTarget); + + // Queues to disable an already created hook. + // Parameters: + // pTarget [in] A pointer to the target function. + // If this parameter is MH_ALL_HOOKS, all created hooks are + // queued to be disabled. + MH_STATUS WINAPI MH_QueueDisableHook(LPVOID pTarget); + + // Applies all queued changes in one go. + MH_STATUS WINAPI MH_ApplyQueued(VOID); + +#ifdef __cplusplus +} +#endif + diff --git a/minhook/libMinHook.x86.lib b/minhook/libMinHook.x86.lib new file mode 100644 index 0000000..f7f0e39 Binary files /dev/null and b/minhook/libMinHook.x86.lib differ