For CoreHook, the Microsoft Detours package serves as a good binary hooking module since it supports x86, x86_64, ARM, and ARM64, while EasyHook only supports x86 and x86_64. Since .NET Core supports the two ARM architectures, we can implement the necessary changes to support those architectures for CoreHook.
X86, X64, and ARM
have all been tested and work, but I do not have a Windows on ARM device to test ARM64
support with. If you have one to loan, let me know, otherwise, I will wait for a price drop.
Building the DLL requires Visual Studio and there are two options: You can build the DLL by using the Visual Studio IDE or nmake (it has been tested with Visual Studio 2017
only).
You can find the Visual Studio solution in the msvc folder. You can choose a configuration (Debug or Release) and a target platform (X86, X64, ARM, ARM64) and build.
You can find the build environments for your Visual Studio installation normally at C:\Program Files (x86)\Microsoft Visual Studio\2017\[ProductType]\VC\Auxiliary\Build
, where [ProductType]
is your version of Visual Studio: (Community, Professional, or Enterprise).
- Start the
vcvars32.bat
. Thencd
to theCoreHook.Hooking
directory, and run:
nmake DETOURS_TARGET_PROCESSOR=X86
- For X64, start the
vcvars64.bat
. Thencd
to theCoreHook.Hooking
directory, and run:
nmake DETOURS_TARGET_PROCESSOR=X64
- For ARM, start the
vcvarsx86_arm.bat
. Thencd
to theCoreHook.Hooking
directory, and run:
nmake DETOURS_TARGET_PROCESSOR=ARM
- For ARM64, start the
vcvarsamd64_arm64.bat
. Thencd
to theCoreHook.Hooking
directory, and run:
nmake DETOURS_TARGET_PROCESSOR=ARM64
- For X86, the output directory is
bin.X86
and the output file iscorehook32.dll
. - For X64, the output directory is
bin.X64
and the output file iscorehook64.dll
. - For ARM, the output directory is
bin.ARM
and the output file iscorehook32.dll
. - For ARM64, the output directory is
bin.ARM64
and the output file iscorehook64.dll
.
Copy the desired file for your target architecture to the output directory of the program that uses CoreHook.