diff options
Diffstat (limited to 'vcpkg/ports/easyhook')
| -rw-r--r-- | vcpkg/ports/easyhook/fix-build.patch | 154 | ||||
| -rw-r--r-- | vcpkg/ports/easyhook/portfile.cmake | 94 | ||||
| -rw-r--r-- | vcpkg/ports/easyhook/vcpkg.json | 15 |
3 files changed, 263 insertions, 0 deletions
diff --git a/vcpkg/ports/easyhook/fix-build.patch b/vcpkg/ports/easyhook/fix-build.patch new file mode 100644 index 0000000..b8802af --- /dev/null +++ b/vcpkg/ports/easyhook/fix-build.patch @@ -0,0 +1,154 @@ +diff --git a/EasyHookDll/EasyHookDll.vcxproj b/EasyHookDll/EasyHookDll.vcxproj +index ec66f91..5773555 100644 +--- a/EasyHookDll/EasyHookDll.vcxproj ++++ b/EasyHookDll/EasyHookDll.vcxproj +@@ -188,7 +188,7 @@ + <StringPooling>true</StringPooling> + <MinimalRebuild>true</MinimalRebuild> + <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> +- <SmallerTypeCheck>true</SmallerTypeCheck> ++ <SmallerTypeCheck>false</SmallerTypeCheck> + <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> + <PrecompiledHeader> + </PrecompiledHeader> +@@ -207,10 +207,6 @@ + <TargetMachine>MachineX86</TargetMachine> + <ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers> + </Link> +- <PostBuildEvent> +- <Command>copy "$(TargetPath)" "$(TargetDir)..\x64\EasyHook32.dll" +-copy "$(TargetDir)EasyHook32.lib" "$(TargetDir)..\x64\EasyHook32.lib"</Command> +- </PostBuildEvent> + <MASM> + <UseSafeExceptionHandlers>false</UseSafeExceptionHandlers> + </MASM> +@@ -223,7 +219,7 @@ copy "$(TargetDir)EasyHook32.lib" "$(TargetDir)..\x64\EasyHook32.lib"</Command> + <StringPooling>true</StringPooling> + <MinimalRebuild>true</MinimalRebuild> + <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> +- <SmallerTypeCheck>true</SmallerTypeCheck> ++ <SmallerTypeCheck>false</SmallerTypeCheck> + <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> + <PrecompiledHeader> + </PrecompiledHeader> +@@ -242,10 +238,6 @@ copy "$(TargetDir)EasyHook32.lib" "$(TargetDir)..\x64\EasyHook32.lib"</Command> + <TargetMachine>MachineX86</TargetMachine> + <ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers> + </Link> +- <PostBuildEvent> +- <Command>copy "$(TargetPath)" "$(TargetDir)..\x64\EasyHook32.dll" +-copy "$(TargetDir)EasyHook32.lib" "$(TargetDir)..\x64\EasyHook32.lib"</Command> +- </PostBuildEvent> + <MASM> + <UseSafeExceptionHandlers>false</UseSafeExceptionHandlers> + </MASM> +@@ -261,7 +253,7 @@ copy "$(TargetDir)EasyHook32.lib" "$(TargetDir)..\x64\EasyHook32.lib"</Command> + <StringPooling>true</StringPooling> + <MinimalRebuild>true</MinimalRebuild> + <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> +- <SmallerTypeCheck>true</SmallerTypeCheck> ++ <SmallerTypeCheck>false</SmallerTypeCheck> + <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> + <PrecompiledHeader> + </PrecompiledHeader> +@@ -278,10 +270,6 @@ copy "$(TargetDir)EasyHook32.lib" "$(TargetDir)..\x64\EasyHook32.lib"</Command> + <SubSystem>Windows</SubSystem> + <TargetMachine>MachineX64</TargetMachine> + </Link> +- <PostBuildEvent> +- <Command>copy "$(TargetPath)" "$(TargetDir)..\x86\EasyHook64.dll" +-copy "$(TargetDir)EasyHook64.lib" "$(TargetDir)..\x86\EasyHook64.lib"</Command> +- </PostBuildEvent> + <MASM> + <UseSafeExceptionHandlers>false</UseSafeExceptionHandlers> + </MASM> +@@ -297,7 +285,7 @@ copy "$(TargetDir)EasyHook64.lib" "$(TargetDir)..\x86\EasyHook64.lib"</Command> + <StringPooling>true</StringPooling> + <MinimalRebuild>true</MinimalRebuild> + <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> +- <SmallerTypeCheck>true</SmallerTypeCheck> ++ <SmallerTypeCheck>false</SmallerTypeCheck> + <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> + <PrecompiledHeader> + </PrecompiledHeader> +@@ -314,10 +302,6 @@ copy "$(TargetDir)EasyHook64.lib" "$(TargetDir)..\x86\EasyHook64.lib"</Command> + <SubSystem>Windows</SubSystem> + <TargetMachine>MachineX64</TargetMachine> + </Link> +- <PostBuildEvent> +- <Command>copy "$(TargetPath)" "$(TargetDir)..\x86\EasyHook64.dll" +-copy "$(TargetDir)EasyHook64.lib" "$(TargetDir)..\x86\EasyHook64.lib"</Command> +- </PostBuildEvent> + <MASM> + <UseSafeExceptionHandlers>false</UseSafeExceptionHandlers> + </MASM> +@@ -355,10 +339,6 @@ copy "$(TargetDir)EasyHook64.lib" "$(TargetDir)..\x86\EasyHook64.lib"</Command> + <TargetMachine>MachineX86</TargetMachine> + <ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers> + </Link> +- <PostBuildEvent> +- <Command>copy "$(TargetPath)" "$(TargetDir)..\x64\EasyHook32.dll" +-copy "$(TargetDir)EasyHook32.lib" "$(TargetDir)..\x64\EasyHook32.lib"</Command> +- </PostBuildEvent> + <MASM> + <GenerateDebugInformation>false</GenerateDebugInformation> + <UseSafeExceptionHandlers>false</UseSafeExceptionHandlers> +@@ -397,10 +377,6 @@ copy "$(TargetDir)EasyHook32.lib" "$(TargetDir)..\x64\EasyHook32.lib"</Command> + <TargetMachine>MachineX86</TargetMachine> + <ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers> + </Link> +- <PostBuildEvent> +- <Command>copy "$(TargetPath)" "$(TargetDir)..\x64\EasyHook32.dll" +-copy "$(TargetDir)EasyHook32.lib" "$(TargetDir)..\x64\EasyHook32.lib"</Command> +- </PostBuildEvent> + <MASM> + <GenerateDebugInformation>false</GenerateDebugInformation> + <UseSafeExceptionHandlers>false</UseSafeExceptionHandlers> +@@ -439,10 +415,6 @@ copy "$(TargetDir)EasyHook32.lib" "$(TargetDir)..\x64\EasyHook32.lib"</Command> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <TargetMachine>MachineX64</TargetMachine> + </Link> +- <PostBuildEvent> +- <Command>copy "$(TargetPath)" "$(TargetDir)..\x86\EasyHook64.dll" +-copy "$(TargetDir)EasyHook64.lib" "$(TargetDir)..\x86\EasyHook64.lib"</Command> +- </PostBuildEvent> + <MASM> + <GenerateDebugInformation>false</GenerateDebugInformation> + <UseSafeExceptionHandlers>false</UseSafeExceptionHandlers> +@@ -481,10 +453,6 @@ copy "$(TargetDir)EasyHook64.lib" "$(TargetDir)..\x86\EasyHook64.lib"</Command> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <TargetMachine>MachineX64</TargetMachine> + </Link> +- <PostBuildEvent> +- <Command>copy "$(TargetPath)" "$(TargetDir)..\x86\EasyHook64.dll" +-copy "$(TargetDir)EasyHook64.lib" "$(TargetDir)..\x86\EasyHook64.lib"</Command> +- </PostBuildEvent> + <MASM> + <GenerateDebugInformation>false</GenerateDebugInformation> + <UseSafeExceptionHandlers>false</UseSafeExceptionHandlers> +diff --git a/EasyHookDll/EasyHookDll_32.rc b/EasyHookDll/EasyHookDll_32.rc +index 2a8dfb6..abf5ae3 100644 +--- a/EasyHookDll/EasyHookDll_32.rc ++++ b/EasyHookDll/EasyHookDll_32.rc +@@ -7,7 +7,7 @@ + // + // Generated from the TEXTINCLUDE 2 resource. + // +-#include "afxres.h" ++#include "windows.h" + + ///////////////////////////////////////////////////////////////////////////// + #undef APSTUDIO_READONLY_SYMBOLS +diff --git a/EasyHookDll/EasyHookDll_64.rc b/EasyHookDll/EasyHookDll_64.rc +index 163a2f0..b32a4d4 100644 +--- a/EasyHookDll/EasyHookDll_64.rc ++++ b/EasyHookDll/EasyHookDll_64.rc +@@ -7,7 +7,7 @@ + // + // Generated from the TEXTINCLUDE 2 resource. + // +-#include "afxres.h" ++#include "windows.h" + + ///////////////////////////////////////////////////////////////////////////// + #undef APSTUDIO_READONLY_SYMBOLS diff --git a/vcpkg/ports/easyhook/portfile.cmake b/vcpkg/ports/easyhook/portfile.cmake new file mode 100644 index 0000000..54e2629 --- /dev/null +++ b/vcpkg/ports/easyhook/portfile.cmake @@ -0,0 +1,94 @@ +message(WARNING ".Net framework 4.7.2 is required, please install it before installing easyhook.")
+
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO EasyHook/EasyHook
+ REF v2.7.7097.0
+ SHA512 D0CA5B64E77F6281B2DD7EE0DC492A9B07DDB60A9F514037938CC3E3FFA5DD57C95CB630E18C02C984A89070839E4188044896D4EE57A21E43E6EA3A4918255A
+ HEAD_REF master
+ PATCHES fix-build.patch
+)
+
+# Use /Z7 rather than /Zi to avoid "fatal error C1090: PDB API call failed, error code '23': (0x00000006)"
+foreach(VCXPROJ IN ITEMS
+ "${SOURCE_PATH}/EasyHookDll/EasyHookDll.vcxproj"
+ "${SOURCE_PATH}/Examples/UnmanagedHook/UnmanagedHook.vcxproj")
+ vcpkg_replace_string(
+ "${VCXPROJ}"
+ "<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>"
+ "<DebugInformationFormat>OldStyle</DebugInformationFormat>"
+ )
+ vcpkg_replace_string(
+ "${VCXPROJ}"
+ "<DebugInformationFormat>EditAndContinue</DebugInformationFormat>"
+ "<DebugInformationFormat>OldStyle</DebugInformationFormat>"
+ )
+ vcpkg_replace_string(
+ "${VCXPROJ}"
+ "<MinimalRebuild>true</MinimalRebuild>"
+ ""
+ )
+endforeach()
+
+# Use modern .NET Framework
+foreach(CSPROJ IN ITEMS
+ "${SOURCE_PATH}/EasyHook/EasyHook.csproj"
+ "${SOURCE_PATH}/EasyHookSvc/EasyHookSvc.csproj"
+ "${SOURCE_PATH}/EasyLoad/EasyLoad.csproj"
+ "${SOURCE_PATH}/Examples/FileMon/FileMon.csproj"
+ "${SOURCE_PATH}/Examples/FileMonInject/FileMonInject.csproj"
+ "${SOURCE_PATH}/Examples/FileMonitorController/FileMonitorController.csproj"
+ "${SOURCE_PATH}/Examples/FileMonitorInterceptor/FileMonitorInterceptor.csproj"
+ "${SOURCE_PATH}/Examples/FileMonitorInterface/FileMonitorInterface.csproj"
+ "${SOURCE_PATH}/Examples/ProcessMonitor/ProcessMonitor.csproj"
+ "${SOURCE_PATH}/Examples/ProcMonInject/ProcMonInject.csproj"
+ "${SOURCE_PATH}/Test/ComplexParameterInject/ComplexParameterInject.csproj"
+ "${SOURCE_PATH}/Test/ComplexParameterTest/ComplexParameterTest.csproj"
+ "${SOURCE_PATH}/Test/EasyHook.Tests/EasyHook.Tests.csproj"
+ "${SOURCE_PATH}/Test/ManagedTarget/ManagedTarget.csproj"
+ "${SOURCE_PATH}/Test/ManagedTest/ManagedTest.csproj"
+ "${SOURCE_PATH}/Test/MultipleHooks/MultipleHooks/MultipleHooks.csproj"
+ "${SOURCE_PATH}/Test/MultipleHooks/SimpleHook1/SimpleHook1.csproj"
+ "${SOURCE_PATH}/Test/MultipleHooks/SimpleHook2/SimpleHook2.csproj"
+ "${SOURCE_PATH}/Test/TestFuncHooks/TestFuncHooks.csproj")
+
+ vcpkg_replace_string(
+ "${CSPROJ}"
+ "<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>"
+ "<TargetFrameworkVersion>4.7.2</TargetFrameworkVersion>"
+ IGNORE_UNCHANGED
+ )
+ vcpkg_replace_string(
+ "${CSPROJ}"
+ "<TargetFrameworkProfile>Client</TargetFrameworkProfile>"
+ ""
+ IGNORE_UNCHANGED
+ )
+endforeach()
+
+vcpkg_msbuild_install(
+ SOURCE_PATH "${SOURCE_PATH}"
+ PROJECT_SUBPATH EasyHook.sln
+ TARGET EasyHookDll
+ RELEASE_CONFIGURATION "netfx4-Release"
+ DEBUG_CONFIGURATION "netfx4-Debug"
+)
+
+# Remove the mismatch rebuild library
+if (VCPKG_TARGET_ARCHITECTURE STREQUAL "x86")
+ file(REMOVE "${CURRENT_PACKAGES_DIR}/debug/lib/AUX_ULIB_x64.LIB")
+ file(REMOVE "${CURRENT_PACKAGES_DIR}/lib/AUX_ULIB_x64.LIB")
+elseif (VCPKG_TARGET_ARCHITECTURE STREQUAL "x64")
+ file(REMOVE "${CURRENT_PACKAGES_DIR}/debug/lib/AUX_ULIB_x86.LIB")
+ file(REMOVE "${CURRENT_PACKAGES_DIR}/lib/AUX_ULIB_x86.LIB")
+endif()
+
+# These libraries are useless, so remove.
+file(REMOVE "${CURRENT_PACKAGES_DIR}/bin/EasyHook.dll" "${CURRENT_PACKAGES_DIR}/bin/EasyHook.pdb")
+file(REMOVE "${CURRENT_PACKAGES_DIR}/debug/bin/EasyHook.dll" "${CURRENT_PACKAGES_DIR}/debug/bin/EasyHook.pdb")
+
+# Install includes
+file(INSTALL "${SOURCE_PATH}/Public/easyhook.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/easyhook")
+
+# Handle copyright
+vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
diff --git a/vcpkg/ports/easyhook/vcpkg.json b/vcpkg/ports/easyhook/vcpkg.json new file mode 100644 index 0000000..e83eb2d --- /dev/null +++ b/vcpkg/ports/easyhook/vcpkg.json @@ -0,0 +1,15 @@ +{ + "name": "easyhook", + "version": "2.7.7097.0", + "port-version": 9, + "description": "This project supports extending (hooking) unmanaged code (APIs) with pure managed ones, from within a fully managed environment on 32- or 64-bit Windows Vista x64, Windows Server 2008 x64, Windows 7, Windows 8.1, and Windows 10.", + "homepage": "https://github.com/EasyHook/EasyHook", + "supports": "windows & !static & !uwp & (x86 | x64)", + "dependencies": [ + { + "name": "vcpkg-msbuild", + "host": true, + "platform": "windows" + } + ] +} |