This is a project that uses Microsoft's Detours as a submodule with CMake.
After you clone this repository, initialize the Detours submodule like this:
git submodule udpdate --init --recursive
Follow these steps to generate a solution file (*.sln
) that you can open with Visual Studio:
- Configuring for x86 builds:
cmake -B build -A Win32
- Configuring for x64 builds:
cmake -B build64 -A x64
Now, to build from the command line, type the following from the appropriate build folder:
cd build or build64
cmake --build . --config Release
(Replace Release
with Debug
or any other configuration name).
The binaries will be in the build folder under bin/[configuration_name]/
.
This repository contains various projects:
The simple
project is a standalone console program that uses Detours.
This is a dummy project that calls the Beep
API. This process, if executed alone, does nothing special. However, if we inject a Detours helper into it before starting it, it will behave differently.
This is a Detours helper DLL. When injected into a process, it installs hooks.
This project leverages Detours' API DetourCreateProcessWithDll
to run dummy.exe
with the dllsample.dll
(injected).
This is the Detours static library itself.
The withdll
sample from the Detours' sample directory.