aboutsummaryrefslogtreecommitdiff
path: root/ports/polyhook2/fix-build-error.patch
diff options
context:
space:
mode:
authorRobert Schumacher <roschuma@microsoft.com>2020-02-06 14:50:32 -0800
committerGitHub <noreply@github.com>2020-02-06 14:50:32 -0800
commit7a78d51e2ff6cc34cc2b9741bc3ca47de089e4b4 (patch)
tree78822f40b938127782c279d61d2b562b5217b9a7 /ports/polyhook2/fix-build-error.patch
parentaaddcb1afb3b2db595ba9d6cab5ddf0e9450a7c2 (diff)
parent3f75ce5786408046c45a8c347895c5bf6cffbabc (diff)
downloadvcpkg-7a78d51e2ff6cc34cc2b9741bc3ca47de089e4b4.tar.gz
vcpkg-7a78d51e2ff6cc34cc2b9741bc3ca47de089e4b4.zip
Merge pull request #9932 from xeropresence/polyhook2-update
[polyhook2 ] Update port
Diffstat (limited to 'ports/polyhook2/fix-build-error.patch')
-rw-r--r--ports/polyhook2/fix-build-error.patch133
1 files changed, 112 insertions, 21 deletions
diff --git a/ports/polyhook2/fix-build-error.patch b/ports/polyhook2/fix-build-error.patch
index e33864f0e..1366d6816 100644
--- a/ports/polyhook2/fix-build-error.patch
+++ b/ports/polyhook2/fix-build-error.patch
@@ -1,8 +1,104 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
-index 62dbdba..55a3068 100644
+index 2577bb2..e88761c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
-@@ -217,8 +217,10 @@ if(NOT ${CAPSTONE_FULL})
+@@ -12,18 +12,19 @@ option(FEATURE_PE "Implement all win pe hooking functionality" ON)
+ option(BUILD_DLL "Build dll & lib instead of tests" OFF)
+ option(BUILD_STATIC "If BUILD_DLL is set, create the type that can be statically linked" ON)
+ option(CAPSTONE_FULL "Build all features of capstone." OFF)
++option(BUILD_TOOLS "Build tests" OFF)
+
+ # Calculate inclusion of necessary dependencies based on features
+
+ # for now only inlinentd uses asmjit
+ set(DEP_ASMJIT_NEED ${FEATURE_INLINENTD})
+-set(DEP_ZYDIS_NEED ON)
++set(DEP_ZYDIS_NEED OFF)
+ # todo: make inclusion of capstone stuff depend on feature flags
+
+ #IDE's like it when header file are included as source files
+ set(HEADER_FILES ${PROJECT_SOURCE_DIR}/polyhook2/ADisassembler.hpp
+ ${PROJECT_SOURCE_DIR}/polyhook2/CapstoneDisassembler.hpp
+- ${PROJECT_SOURCE_DIR}/polyhook2/ZydisDisassembler.hpp
++# ${PROJECT_SOURCE_DIR}/polyhook2/ZydisDisassembler.hpp
+ ${PROJECT_SOURCE_DIR}/polyhook2/Enums.hpp
+ ${PROJECT_SOURCE_DIR}/polyhook2/IHook.hpp
+ ${PROJECT_SOURCE_DIR}/polyhook2/Instruction.hpp
+@@ -35,13 +36,13 @@ set(HEADER_FILES ${PROJECT_SOURCE_DIR}/polyhook2/ADisassembler.hpp
+
+ set(HEADER_IMP_SOURCES
+ ${PROJECT_SOURCE_DIR}/sources/CapstoneDisassembler.cpp
+- ${PROJECT_SOURCE_DIR}/sources/ZydisDisassembler.cpp
++# ${PROJECT_SOURCE_DIR}/sources/ZydisDisassembler.cpp
+ ${PROJECT_SOURCE_DIR}/sources/MemProtector.cpp
+ ${PROJECT_SOURCE_DIR}/sources/TestEffectTracker.cpp
+ ${PROJECT_SOURCE_DIR}/sources/PageAllocator.cpp)
+
+ # only build tests if making exe
+-if(BUILD_DLL MATCHES OFF)
++if(BUILD_TOOLS)
+ set(UNIT_TEST_SOURCES
+ ${PROJECT_SOURCE_DIR}/MainTests.cpp
+ ${PROJECT_SOURCE_DIR}/UnitTests/TestDisassembler.cpp
+@@ -65,7 +66,7 @@ if(FEATURE_DETOURS MATCHES ON)
+ set(HEADER_IMP_SOURCES ${HEADER_IMP_SOURCES} ${DETOUR_IMP_SOURCES})
+
+ # only build tests if making exe
+- if(BUILD_DLL MATCHES OFF)
++ if(BUILD_TOOLS)
+ if(CMAKE_SIZEOF_VOID_P EQUAL 8)
+ # 64 bits
+ set(UNIT_TEST_SOURCES ${UNIT_TEST_SOURCES}
+@@ -93,7 +94,7 @@ if(FEATURE_EXCEPTION MATCHES ON)
+ set(HEADER_IMP_SOURCES ${HEADER_IMP_SOURCES} ${EXCEPTION_IMP_SOURCES})
+
+ # only build tests if making exe
+- if(BUILD_DLL MATCHES OFF)
++ if(BUILD_TOOLS)
+ set(UNIT_TEST_SOURCES ${UNIT_TEST_SOURCES}
+ ${PROJECT_SOURCE_DIR}/UnitTests/TestBreakpointHook.cpp
+ ${PROJECT_SOURCE_DIR}/UnitTests/TestHWBreakpointHook.cpp)
+@@ -113,7 +114,7 @@ if(FEATURE_VIRTUALS MATCHES ON)
+ set(HEADER_IMP_SOURCES ${HEADER_IMP_SOURCES} ${VIRTUAL_IMP_SOURCES})
+
+ # only build tests if making exe
+- if(BUILD_DLL MATCHES OFF)
++ if(BUILD_TOOLS)
+ set(UNIT_TEST_SOURCES ${UNIT_TEST_SOURCES}
+ ${PROJECT_SOURCE_DIR}/UnitTests/TestVTableSwapHook.cpp
+ ${PROJECT_SOURCE_DIR}/UnitTests/TestVFuncSwapHook.cpp)
+@@ -134,7 +135,7 @@ if(FEATURE_PE MATCHES ON)
+ set(HEADER_IMP_SOURCES ${HEADER_IMP_SOURCES} ${PE_IMP_SOURCES})
+
+ # only build tests if making exe
+- if(BUILD_DLL MATCHES OFF)
++ if(BUILD_TOOLS)
+ set(UNIT_TEST_SOURCES ${UNIT_TEST_SOURCES}
+ ${PROJECT_SOURCE_DIR}/UnitTests/TestEatHook.cpp
+ ${PROJECT_SOURCE_DIR}/UnitTests/TestIatHook.cpp)
+@@ -152,7 +153,7 @@ if(FEATURE_INLINENTD MATCHES ON)
+ set(HEADER_IMP_SOURCES ${HEADER_IMP_SOURCES} ${NTD_SOURCES})
+
+ # only build tests if making exe
+- if(BUILD_DLL MATCHES OFF)
++ if(BUILD_TOOLS)
+ if(CMAKE_SIZEOF_VOID_P EQUAL 8)
+ # 64 bits
+ set(UNIT_TEST_SOURCES ${UNIT_TEST_SOURCES}
+@@ -175,8 +176,10 @@ if(BUILD_DLL MATCHES ON)
+ else()
+ add_library(PolyHook_2 SHARED ${SOURCE_FILES_PLH})
+ endif()
+-else()
+- add_executable(PolyHook_2 ${SOURCE_FILES_PLH})
++endif()
++
++if(BUILD_TOOLS)
++ add_executable(PolyHook2_tool ${SOURCE_FILES_PLH})
+ endif()
+
+ # add WALL + PDB flags
+@@ -220,8 +223,16 @@ if(NOT ${CAPSTONE_FULL})
set(CAPSTONE_EVM_SUPPORT OFF CACHE BOOL "EVM support")
endif()
@@ -12,33 +108,28 @@ index 62dbdba..55a3068 100644
+find_path(CAPSTONE_INCLUDE_DIR NAMES capstone/capstone.h)
+target_link_libraries(${PROJECT_NAME} ${CAPSTONE_LIBRARY})
+target_include_directories(${PROJECT_NAME} PRIVATE ${CAPSTONE_INCLUDE_DIR})
++
++if(BUILD_TOOLS)
++ target_link_libraries(PolyHook2_tool ${CAPSTONE_LIBRARY})
++ target_include_directories(PolyHook2_tool PRIVATE ${CAPSTONE_INCLUDE_DIR})
++ install(TARGETS PolyHook2_tool DESTINATION tool)
++endif()
# ASMJIT
if(DEP_ASMJIT_NEED MATCHES ON)
-@@ -230,3 +232,13 @@ if(DEP_ASMJIT_NEED MATCHES ON)
- add_subdirectory(${ASMJIT_DIR}) # build it
- target_link_libraries(${PROJECT_NAME} asmjit)
- endif()
-+
-+#Install targets
-+install(TARGETS ${PROJECT_NAME}
-+ RUNTIME DESTINATION bin
-+ LIBRARY DESTINATION lib
-+ ARCHIVE DESTINATION lib
-+)
-+
-+#Install headers
-+install(FILES ${HEADER_FILES} DESTINATION include)
-diff --git a/headers/CapstoneDisassembler.hpp b/headers/CapstoneDisassembler.hpp
-index 2c31bfe..5f3a8ee 100644
---- a/headers/CapstoneDisassembler.hpp
-+++ b/headers/CapstoneDisassembler.hpp
+diff --git a/polyhook2/CapstoneDisassembler.hpp b/polyhook2/CapstoneDisassembler.hpp
+index d227b30..bb5d222 100644
+--- a/polyhook2/CapstoneDisassembler.hpp
++++ b/polyhook2/CapstoneDisassembler.hpp
@@ -7,7 +7,7 @@
- #include "headers/ADisassembler.hpp"
+ #include "polyhook2/ADisassembler.hpp"
-#include <capstone/include/capstone/capstone.h>
+#include <capstone/capstone.h>
#include <string.h>
#include <iostream> //for debug printing
+--
+2.25.0.windows.1
+