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 the steps in the next section and after that, you will have a solution file (*.sln
) that you can open with Visual Studio.
To build from the command line, type the following from the appropriate build folder:
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]/
.
mkdir build
cd build
cmake ..
mkdir build64
cd build64
cmake -A x64 ..
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.