Microsoft Detours

Microsoft Detours is an open source library for intercepting, monitoring and instrumenting binary functions on Microsoft Windows. It is developed by Microsoft and is most commonly used to intercept Win32 API calls within Windows applications. Detours makes it possible to add debugging instrumentation and to attach arbitrary DLLs to any existing Win32 binary. Detours does not require other software frameworks as a dependency and works on ARM, x86_16, x64, and IA-64 systems. The interception code is applied dynamically at execution time.
Detours is used by product teams at Microsoft and has also been used by ISVs.
Prior to 2016, Detours was available in a free version for non-commercial use and a paid version for commercial use. Since 2016, the source code is licensed under MIT License and available on GitHub.