Otok public index

apotocki/detours

apotocki/detours 4.0.1.20260929 (r1, windows)

Library
detours
Variant
windows, target windows
Channel
stable
Published
2026-11-13
Recipe source
https://github.com/otok-dev/recipes.git
b970f0bb534a7425d6b6fdf304db08dca4a92f7b in recipes/detours/4.0/windows/
Recipe SHA-256
1389cf9051c15e80e714b884fa710d6c7e7fa1b41d84c95bd4afacf86f2f5cb1

Inputs

source.commit1dbd4ea281d73d478aa8d09a8b83fbd265f715f7
source.githttps://github.com/microsoft/Detours

Platforms

windows

Toolchains

Recipe files

CMakeLists.txt 866 bytes · raw
# The detours library of the otok recipe: the objects of Detours' src/Makefile (OBJS), static. The disassemblers of
# the other architectures (disol*.cpp) are compiled as the Makefile compiles them, for DetourCopyInstruction's offline
# use. DETOUR_DEBUG is not defined: a debug build of the Makefile traces to the standard output of the process.
cmake_minimum_required(VERSION 3.20)
project(detours VERSION 4.0.1 LANGUAGES CXX)

add_library(detours STATIC
    src/detours.cpp src/modules.cpp src/disasm.cpp src/image.cpp src/creatwth.cpp
    src/disolx86.cpp src/disolx64.cpp src/disolia64.cpp src/disolarm.cpp src/disolarm64.cpp)
# as the Makefile defines them
target_compile_definitions(detours PRIVATE WIN32_LEAN_AND_MEAN _WIN32_WINNT=0x501)

install(TARGETS detours ARCHIVE DESTINATION lib)
install(FILES src/detours.h src/detver.h DESTINATION include/detours)
build.lua 378 bytes · raw
-- The detours library through the recipe's CMakeLists.txt, which compiles what src/Makefile puts into detours.lib.

function build(slice, options, deps)
    otok.copy(slice.recipe .. "/CMakeLists.txt", slice.source .. "/CMakeLists.txt")
    otok.cmake{}
    local p = slice.prefix
    return { libraries = { detours = p .. "/lib/detours.lib" }, headers = p .. "/include" }
end
recipe.toml 1277 bytes · raw
# The otok recipe of Microsoft Detours (https://github.com/apotocki/otok): the detours library for Windows, from a commit
# of Detours' main (its last release, 4.0.1, is of 2018; the version is 4.0.1 and the date of the commit), with a
# CMakeLists.txt of the recipe in place of Detours' nmake Makefile, with MSVC or with clang-cl across from Linux; static
# only, as Detours builds it. The headers are in include/detours/, as vcpkg lays them out.
[recipe]
api = 1
library = "detours"
name = "detours"
version = "4.0.1.20260929"
revision = 1
license = "MIT"
license-files = ["LICENSE"]
homepage = "https://github.com/microsoft/Detours"
documentation = "https://github.com/microsoft/Detours/wiki"
description = "Microsoft Detours, the library for intercepting and instrumenting Win32 API calls."
keywords = ["hooking", "instrumentation", "interception", "windows"]
linkage = ["static"]

[source]
git = "https://github.com/microsoft/Detours"
commit = "1dbd4ea281d73d478aa8d09a8b83fbd265f715f7"

[platforms]
supported = ["windows"]
build-on = ["windows/msvc", "linux/clang-cl"]

[toolchains]
cmake = { version = ">= 3.20", default-recipe = "apotocki/cmake" }
ninja = { version = ">= 1.10", default-recipe = "apotocki/ninja" }

[[product]]
name = "Detours"
libraries = ["detours"]