The response has been limited to 50k tokens of the smallest files in the repo. You can remove this limitation by removing the max tokens filter.
├── .editorconfig
├── .github
    └── workflows
    │   └── msbuild.yml
├── .gitignore
├── AUTHORS.txt
├── CMakeLists.txt
├── LICENSE.txt
├── README.md
├── build
    ├── MinGW
    │   ├── Makefile
    │   ├── make.bat
    │   └── make.sh
    ├── VC10
    │   ├── MinHook.vcxproj
    │   ├── MinHookVC10.sln
    │   ├── libMinHook.vcxproj
    │   └── libMinHook.vcxproj.filters
    ├── VC11
    │   ├── MinHook.vcxproj
    │   ├── MinHookVC11.sln
    │   ├── libMinHook.vcxproj
    │   └── libMinHook.vcxproj.filters
    ├── VC12
    │   ├── MinHook.vcxproj
    │   ├── MinHookVC12.sln
    │   ├── libMinHook.vcxproj
    │   └── libMinHook.vcxproj.filters
    ├── VC14
    │   ├── MinHook.vcxproj
    │   ├── MinHookVC14.sln
    │   ├── libMinHook.vcxproj
    │   └── libMinHook.vcxproj.filters
    ├── VC15
    │   ├── MinHook.vcxproj
    │   ├── MinHookVC15.sln
    │   ├── libMinHook.vcxproj
    │   └── libMinHook.vcxproj.filters
    ├── VC16
    │   ├── MinHook.vcxproj
    │   ├── MinHookVC16.sln
    │   ├── libMinHook.vcxproj
    │   └── libMinHook.vcxproj.filters
    ├── VC17
    │   ├── MinHook.vcxproj
    │   ├── MinHookVC17.sln
    │   ├── libMinHook.vcxproj
    │   └── libMinHook.vcxproj.filters
    └── VC9
    │   ├── MinHook.vcproj
    │   ├── MinHookVC9.sln
    │   └── libMinHook.vcproj
├── cmake
    └── minhook-config.cmake.in
├── dll_resources
    ├── MinHook.def
    └── MinHook.rc
├── include
    └── MinHook.h
└── src
    ├── buffer.c
    ├── buffer.h
    ├── hde
        ├── hde32.c
        ├── hde32.h
        ├── hde64.c
        ├── hde64.h
        ├── pstdint.h
        ├── table32.h
        └── table64.h
    ├── hook.c
    ├── trampoline.c
    └── trampoline.h


/.editorconfig:
--------------------------------------------------------------------------------
 1 | # EditorConfig is awesome: http://EditorConfig.org
 2 | 
 3 | # top-most EditorConfig file
 4 | root = true
 5 | 
 6 | # Windows-style newlines with a newline ending every file
 7 | [*]
 8 | end_of_line = crlf
 9 | insert_final_newline = true
10 | 
11 | # 4 space indentation
12 | [*.{c,h,def}]
13 | indent_style = space
14 | indent_size = 4
15 | 
16 | # Trim trailing whitespaces
17 | [*.{c,h,def,txt}]
18 | trim_trailing_whitespace = true
19 | 
20 | # UTF-8 with BOM
21 | [*.{c,h,def,txt}]
22 | charset=utf-8-bom
23 | 
24 | # C/C++ code formatting
25 | [*.{c,h}]
26 | cpp_space_pointer_reference_alignment = right
27 | 


--------------------------------------------------------------------------------
/.github/workflows/msbuild.yml:
--------------------------------------------------------------------------------
 1 | name: Build
 2 | 
 3 | on:
 4 |   workflow_dispatch:
 5 |   push:
 6 |     branches: [ "master" ]
 7 | 
 8 | env:
 9 |   # Path to the solution file relative to the root of the project.
10 |   SOLUTION_FILE_PATH: build/VC17/MinHookVC17.sln
11 | 
12 |   # Configuration type to build.
13 |   # You can convert this to a build matrix if you need coverage of multiple configuration types.
14 |   # https://docs.github.com/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
15 |   BUILD_CONFIGURATION: Release
16 | 
17 | jobs:
18 |   build:
19 |     runs-on: windows-latest
20 | 
21 |     steps:
22 |       - uses: actions/checkout@v4
23 | 
24 |       - name: Add MSBuild to PATH
25 |         uses: microsoft/setup-msbuild@v2
26 | 
27 |       - name: Build Win32
28 |         # Add additional options to the MSBuild command line here (like platform or verbosity level).
29 |         # See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference
30 |         run: msbuild /m /p:Configuration=${{ env.BUILD_CONFIGURATION }} /p:Platform="Win32" ${{ env.SOLUTION_FILE_PATH }}
31 | 
32 |       - name: Build x64
33 |         # Add additional options to the MSBuild command line here (like platform or verbosity level).
34 |         # See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference
35 |         run: msbuild /m /p:Configuration=${{ env.BUILD_CONFIGURATION }} /p:Platform="x64" ${{ env.SOLUTION_FILE_PATH }}
36 | 
37 |       - name: Collect artifacts
38 |         shell: bash
39 |         run: |
40 |           mkdir "${{ runner.temp }}/artifacts"
41 |           mv "build/VC17/bin/${{ env.BUILD_CONFIGURATION }}" "${{ runner.temp }}/artifacts/bin"
42 |           mv "build/VC17/lib/${{ env.BUILD_CONFIGURATION }}" "${{ runner.temp }}/artifacts/lib"
43 |           cp -r include "${{ runner.temp }}/artifacts/include"
44 | 
45 |       - name: Package bin
46 |         uses: actions/upload-artifact@v4
47 |         with:
48 |           name: MinHook_bin
49 |           path: |
50 |             ${{ runner.temp }}/artifacts/bin/
51 |             ${{ runner.temp }}/artifacts/include/
52 | 
53 |       - name: Package lib
54 |         uses: actions/upload-artifact@v4
55 |         with:
56 |           name: MinHook_lib
57 |           path: |
58 |             ${{ runner.temp }}/artifacts/lib/
59 |             ${{ runner.temp }}/artifacts/include/
60 | 


--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
 1 | #OS junk files
 2 | [Tt]humbs.db
 3 | *.DS_Store
 4 | 
 5 | #Visual Studio files
 6 | *.[Oo]bj
 7 | *.user
 8 | *.aps
 9 | *.pch
10 | *.vspscc
11 | *.vssscc
12 | *_i.c
13 | *_p.c
14 | *.ncb
15 | *.suo
16 | *.tlb
17 | *.tlh
18 | *.bak
19 | *.[Cc]ache
20 | *.ilk
21 | *.log
22 | *.sbr
23 | *.sdf
24 | *.opensdf
25 | *.unsuccessfulbuild
26 | ipch/
27 | obj/
28 | [Ll]ib
29 | [Bb]in
30 | [Dd]ebug*/
31 | [Rr]elease*/
32 | Ankh.NoLoad
33 | *.VC.db
34 | .vs/
35 | 
36 | #GCC files
37 | *.o
38 | *.d
39 | *.res
40 | *.dll
41 | *.a
42 | 
43 | #Visual Studio Code files
44 | .vscode/
45 | 


--------------------------------------------------------------------------------
/AUTHORS.txt:
--------------------------------------------------------------------------------
1 | Tsuda Kageyu <tsuda.kageyu@gmail.com>
2 |  Creator, maintainer
3 | 
4 | Michael Maltsev <leahcimmar@gmail.com>
5 |  Added "Queue" functions. A lot of bug fixes.
6 | 
7 | Andrey Unis <uniskz@gmail.com>
8 |  Rewrote the hook engine in plain C.
9 | 


--------------------------------------------------------------------------------
/CMakeLists.txt:
--------------------------------------------------------------------------------
  1 | #  MinHook - The Minimalistic API Hooking Library for x64/x86
  2 | #  Copyright (C) 2009-2017 Tsuda Kageyu.
  3 | #  All rights reserved.
  4 | #
  5 | #  Redistribution and use in source and binary forms, with or without
  6 | #  modification, are permitted provided that the following conditions
  7 | #  are met:
  8 | #
  9 | #   1. Redistributions of source code must retain the above copyright
 10 | #      notice, this list of conditions and the following disclaimer.
 11 | #   2. Redistributions in binary form must reproduce the above copyright
 12 | #      notice, this list of conditions and the following disclaimer in the
 13 | #      documentation and/or other materials provided with the distribution.
 14 | #
 15 | #  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 16 | #  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
 17 | #  TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
 18 | #  PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER
 19 | #  OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 20 | #  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 21 | #  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 22 | #  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
 23 | #  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 24 | #  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 25 | #  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 26 | 
 27 | cmake_minimum_required(VERSION 3.0...3.5)
 28 | 
 29 | project(minhook LANGUAGES C)
 30 | 
 31 | include(CMakePackageConfigHelpers)
 32 | 
 33 | set(MINHOOK_MAJOR_VERSION 1)
 34 | set(MINHOOK_MINOR_VERSION 3)
 35 | set(MINHOOK_PATCH_VERSION 3)
 36 | set(MINHOOK_VERSION ${MINHOOK_MAJOR_VERSION}.${MINHOOK_MINOR_VERSION}.${MINHOOK_PATCH_VERSION})
 37 | 
 38 | ################
 39 | #    BUILD     # 
 40 | ################
 41 | 
 42 | option(BUILD_SHARED_LIBS "build shared version" OFF)
 43 | 
 44 | set(SOURCES_MINHOOK 
 45 |   "src/buffer.c"
 46 |   "src/hook.c"
 47 |   "src/trampoline.c"
 48 | )
 49 | 
 50 | if(CMAKE_SIZEOF_VOID_P EQUAL 8)
 51 |   set(SOURCES_HDE "src/hde/hde64.c")
 52 | else()
 53 |   set(SOURCES_HDE "src/hde/hde32.c")
 54 | endif()
 55 | 
 56 | if(BUILD_SHARED_LIBS)
 57 |   set(RESOURCES 
 58 |     "dll_resources/MinHook.rc"
 59 |     "dll_resources/MinHook.def"
 60 |   )
 61 | endif()
 62 | 
 63 | add_library(minhook ${SOURCES_MINHOOK} ${SOURCES_HDE} ${RESOURCES})
 64 | 
 65 | target_include_directories(minhook PUBLIC
 66 |   
lt;BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/>
 67 |   
lt;INSTALL_INTERFACE:include>
 68 | )
 69 | 
 70 | target_include_directories(minhook PRIVATE "src/")
 71 | target_include_directories(minhook PRIVATE "src/hde/")
 72 | 
 73 | if(WIN32)
 74 |   set_target_properties(minhook PROPERTIES PREFIX "")
 75 |   if(CMAKE_SIZEOF_VOID_P EQUAL 8)   
 76 |     set_target_properties(minhook PROPERTIES DEBUG_POSTFIX ".x64d")
 77 |     set_target_properties(minhook PROPERTIES RELEASE_POSTFIX ".x64")
 78 |     set_target_properties(minhook PROPERTIES RELWITHDEBINFO_POSTFIX ".x64")
 79 |     set_target_properties(minhook PROPERTIES MINSIZEREL_POSTFIX ".x64")
 80 |   else()
 81 |     set_target_properties(minhook PROPERTIES DEBUG_POSTFIX ".x32d")
 82 |     set_target_properties(minhook PROPERTIES RELEASE_POSTFIX ".x32")
 83 |     set_target_properties(minhook PROPERTIES RELWITHDEBINFO_POSTFIX ".x32")
 84 |     set_target_properties(minhook PROPERTIES MINSIZEREL_POSTFIX ".x32")
 85 |   endif()
 86 | else()
 87 |   set_target_properties(minhook PROPERTIES PREFIX "lib")
 88 |   set_target_properties(minhook PROPERTIES POSTFIX "")
 89 |   set_target_properties(minhook PROPERTIES DEBUG_POSTFIX "d")
 90 | endif()
 91 | 
 92 | ################
 93 | # CMAKE CONFIG # 
 94 | ################
 95 | 
 96 | configure_package_config_file(
 97 |     "cmake/minhook-config.cmake.in"
 98 |     "minhook-config.cmake"
 99 |   INSTALL_DESTINATION 
100 |     "share/minhook"
101 | )
102 | 
103 | write_basic_package_version_file(
104 |   "minhook-config-version.cmake"
105 | VERSION 
106 |   ${MINHOOK_VERSION}
107 | COMPATIBILITY
108 |   AnyNewerVersion
109 | )
110 | 
111 | install(
112 |   FILES 
113 |     "${CMAKE_CURRENT_BINARY_DIR}/minhook-config.cmake"
114 |     "${CMAKE_CURRENT_BINARY_DIR}/minhook-config-version.cmake"
115 |   DESTINATION 
116 |     "share/minhook"
117 | )
118 | 
119 | ###################
120 | #     INSTALL     #
121 | ###################
122 | 
123 | install(TARGETS minhook
124 |         EXPORT minhook-targets
125 |         RUNTIME DESTINATION "bin"
126 |         ARCHIVE DESTINATION "lib"
127 |         LIBRARY DESTINATION "lib"
128 | )
129 | 
130 | install(
131 |   EXPORT
132 |     minhook-targets
133 |   NAMESPACE 
134 |     minhook::
135 |   DESTINATION 
136 |     "share/minhook"
137 | )
138 | 
139 | install(
140 |   DIRECTORY include DESTINATION .
141 | )
142 | 


--------------------------------------------------------------------------------
/LICENSE.txt:
--------------------------------------------------------------------------------
 1 | MinHook - The Minimalistic API Hooking Library for x64/x86
 2 | Copyright (C) 2009-2017 Tsuda Kageyu.
 3 | All rights reserved.
 4 | 
 5 | Redistribution and use in source and binary forms, with or without
 6 | modification, are permitted provided that the following conditions
 7 | are met:
 8 | 
 9 |  1. Redistributions of source code must retain the above copyright
10 |     notice, this list of conditions and the following disclaimer.
11 |  2. Redistributions in binary form must reproduce the above copyright
12 |     notice, this list of conditions and the following disclaimer in the
13 |     documentation and/or other materials provided with the distribution.
14 | 
15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
16 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
17 | TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
18 | PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER
19 | OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
20 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
21 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
22 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
23 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
24 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | 
27 | ================================================================================
28 | Portions of this software are Copyright (c) 2008-2009, Vyacheslav Patkov.
29 | ================================================================================
30 | Hacker Disassembler Engine 32 C
31 | Copyright (c) 2008-2009, Vyacheslav Patkov.
32 | All rights reserved.
33 | 
34 | Redistribution and use in source and binary forms, with or without
35 | modification, are permitted provided that the following conditions
36 | are met:
37 | 
38 |  1. Redistributions of source code must retain the above copyright
39 |     notice, this list of conditions and the following disclaimer.
40 |  2. Redistributions in binary form must reproduce the above copyright
41 |     notice, this list of conditions and the following disclaimer in the
42 |     documentation and/or other materials provided with the distribution.
43 | 
44 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
45 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
46 | TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
47 | PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR
48 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
49 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
50 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
51 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
52 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
53 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
54 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
55 | 
56 | -------------------------------------------------------------------------------
57 | Hacker Disassembler Engine 64 C
58 | Copyright (c) 2008-2009, Vyacheslav Patkov.
59 | All rights reserved.
60 | 
61 | Redistribution and use in source and binary forms, with or without
62 | modification, are permitted provided that the following conditions
63 | are met:
64 | 
65 |  1. Redistributions of source code must retain the above copyright
66 |     notice, this list of conditions and the following disclaimer.
67 |  2. Redistributions in binary form must reproduce the above copyright
68 |     notice, this list of conditions and the following disclaimer in the
69 |     documentation and/or other materials provided with the distribution.
70 | 
71 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
72 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
73 | TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
74 | PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR
75 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
76 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
77 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
78 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
79 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
80 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
81 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
82 | 


--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
 1 | # MinHook
 2 | 
 3 | [![License](https://img.shields.io/badge/License-BSD%202--Clause-orange.svg)](https://opensource.org/licenses/BSD-2-Clause)
 4 | 
 5 | The Minimalistic x86/x64 API Hooking Library for Windows
 6 | 
 7 | https://www.codeproject.com/articles/MinHook-The-Minimalistic-x-x-API-Hooking-Libra
 8 | 
 9 | ### Version history
10 | 
11 | - **v1.3.4 - 28 Mar 2025**
12 |   * Improved error handling for enumerating and suspending threads.
13 |   * Visual Studio 2022 support.
14 |   * CMake support.
15 |   * Fixed compilation with Clang.
16 |   * Fixed compilation as C++ code.
17 | 
18 | - **v1.3.3 - 8 Jan 2017**
19 |   * Added a helper function ```MH_CreateHookApiEx```. (Thanks to asm256)
20 |   * Support Visual Studio 2017 RC.
21 | 
22 | - **v1.3.2.1 - 9 Nov 2015**  (Nuget package only)
23 |   * Fixed an insufficient support for Visual Studio 2015.
24 | 
25 | - **v1.3.2 - 1 Nov 2015**
26 |   * Support Visual Studio 2015.
27 |   * Support MinGW.
28 | 
29 | - **v1.3.2-beta3 - 21 Jul 2015**  (Nuget package only)
30 |   * Support MinGW. (Experimental)
31 | 
32 | - **v1.3.2-beta2 - 18 May 2015**
33 |   * Fixed some subtle bugs. (Thanks to RaMMicHaeL)
34 |   * Added a helper function ```MH_StatusToString```. (Thanks to Jan Klass)
35 | 
36 | - **v1.3.2-beta - 12 May 2015**
37 |   * Fixed a possible thread deadlock in x64 mode. (Thanks to Aleh Kazakevich)
38 |   * Reduced the footprint a little more.
39 |   * Support Visual Studio 2015 RC. (Experimental)
40 | 
41 | - **v1.3.1.1 - 7 Apr 2015**  (Nuget package only)
42 |   * Support for WDK8.0 and 8.1.
43 | 
44 | - **v1.3.1 - 19 Mar 2015**
45 |   * No major changes from v1.3.1-beta.
46 | 
47 | - **v1.3.1-beta - 11 Mar 2015**
48 |   * Added a helper function ```MH_CreateHookApi```. (Thanks to uniskz).
49 |   * Fixed a false memory leak reported by some tools.
50 |   * Fixed a degradated compatibility issue.
51 | 
52 | - **v1.3 - 13 Sep 2014**
53 |   * No major changes from v1.3-beta3.
54 | 
55 | - **v1.3-beta3 - 31 Jul 2014**
56 |   * Fixed some small bugs.
57 |   * Improved the memory management.
58 | 
59 | - **v1.3-beta2 - 21 Jul 2014**
60 |   * Changed the parameters to Windows-friendly types. (void* to LPVOID)
61 |   * Fixed some small bugs.
62 |   * Reorganized the source files.
63 |   * Reduced the footprint a little more.
64 | 
65 | - **v1.3-beta - 17 Jul 2014**
66 |   * Rewrote in plain C to reduce the footprint and memory usage. (suggested by Andrey Unis)
67 |   * Simplified the overall code base to make it more readable and maintainable.
68 |   * Changed the license from 3-clause to 2-clause BSD License.
69 | 
70 | - **v1.2 - 28 Sep 2013**
71 |   * Removed boost dependency ([jarredholman](https://github.com/jarredholman/minhook)).
72 |   * Fixed a small bug in the GetRelativeBranchDestination function ([pillbug99](http://www.codeproject.com/Messages/4058892/Small-Bug-Found.aspx)).
73 |   * Added the ```MH_RemoveHook``` function, which removes a hook created with the ```MH_CreateHook``` function.
74 |   * Added the following functions to enable or disable multiple hooks in one go: ```MH_QueueEnableHook```, ```MH_QueueDisableHook```, ```MH_ApplyQueued```. This is the preferred way of handling multiple hooks as every call to `MH_EnableHook` or `MH_DisableHook` suspends and resumes all threads.
75 |   * Made the functions ```MH_EnableHook``` and ```MH_DisableHook``` enable/disable all created hooks when the ```MH_ALL_HOOKS``` parameter is passed. This, too, is an efficient way of handling multiple hooks.
76 |   * If the target function is too small to be patched with a jump, MinHook tries to place the jump above the function. If that fails as well, the ```MH_CreateHook``` function returns ```MH_ERROR_UNSUPPORTED_FUNCTION```. This fixes an issue of hooking the LoadLibraryExW function on Windows 7 x64 ([reported by Obble](http://www.codeproject.com/Messages/4578613/Re-Bug-LoadLibraryExW-hook-fails-on-windows-2008-r.aspx)).
77 | 
78 | - **v1.1 - 26 Nov 2009**
79 |   * Changed the interface to create a hook and a trampoline function in one go to prevent the detour function from being called before the trampoline function is created. ([reported by xliqz](http://www.codeproject.com/Messages/3280374/Unsafe.aspx))
80 |   * Shortened the function names from ```MinHook_*``` to ```MH_*``` to make them handier.
81 | 
82 | - **v1.0 - 22 Nov 2009**
83 |   * Initial release.
84 | 
85 | ### Building MinHook - Using vcpkg
86 | 
87 | You can download and install MinHook using the [vcpkg](https://github.com/Microsoft/vcpkg) dependency manager:
88 | 
89 |     git clone https://github.com/microsoft/vcpkg
90 |     .\vcpkg\bootstrap-vcpkg.bat
91 |     .\vcpkg\vcpkg integrate install
92 |     .\vcpkg\vcpkg install minhook
93 | 
94 | The MinHook port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please [create an issue or pull request](https://github.com/Microsoft/vcpkg) on the vcpkg repository.
95 | 


--------------------------------------------------------------------------------
/build/MinGW/Makefile:
--------------------------------------------------------------------------------
 1 | WINDRES:=$(CROSS_PREFIX)windres
 2 | DLLTOOL:=$(CROSS_PREFIX)dlltool
 3 | AR:=$(CROSS_PREFIX)ar
 4 | CC:=$(CROSS_PREFIX)gcc
 5 | CCLD:=$(CC)
 6 | SRCS:=$(wildcard src/*.c src/hde/*.c)
 7 | OBJS:=$(SRCS:%.c=%.o)
 8 | DEPS:=$(SRCS:%.c=%.d)
 9 | INCS:=-Isrc -Iinclude
10 | CFLAGS:=-masm=intel -Wall -Werror -std=c11
11 | LDFLAGS:=-Wl,-enable-stdcall-fixup -s -static-libgcc
12 | 
13 | all: MinHook.dll libMinHook.dll.a libMinHook.a
14 | 
15 | -include $(DEPS)
16 | 
17 | libMinHook.a: $(OBJS)
18 | 	$(AR) r $@ $^
19 | libMinHook.dll.a: MinHook.dll dll_resources/MinHook.def
20 | 	$(DLLTOOL) --dllname MinHook.dll --input-def dll_resources/MinHook.def --output-lib $@
21 | MinHook.dll: $(OBJS) dll_resources/MinHook.res dll_resources/MinHook.def
22 | 	$(CCLD) -o $@ -shared $(LDFLAGS) $^
23 | 
24 | .rc.res:
25 | 	$(WINDRES) -o $@ --input-format=rc --output-format=coff 
lt;
26 | .c.o:
27 | 	$(CC) -o $@ -c -MMD -MP $(INCS) $(CFLAGS) 
lt;
28 | 
29 | clean:
30 | 	rm -f $(OBJS) $(DEPS) MinHook.dll libMinHook.dll.a libMinHook.a dll_resources/MinHook.res
31 | 
32 | .PHONY: clean
33 | .SUFFIXES: .rc .res
34 | 


--------------------------------------------------------------------------------
/build/MinGW/make.bat:
--------------------------------------------------------------------------------
1 | windres -i ../../dll_resources/MinHook.rc -o MinHook_rc.o && dllwrap --driver-name g++ -o MinHook.dll -masm=intel --def ../../dll_resources/MinHook.def -Wl,-enable-stdcall-fixup -Wall MinHook_rc.o ../../src/*.c ../../src/HDE/*.c -I../../include -I../../src -Werror -std=c++11 -s -static-libgcc -static-libstdc++|| pause


--------------------------------------------------------------------------------
/build/MinGW/make.sh:
--------------------------------------------------------------------------------
1 | x86_64-w64-mingw32-windres -i ../../dll_resources/MinHook.rc -o MinHook_rc.o &&
2 | x86_64-w64-mingw32-dllwrap -o MinHook.dll -masm=intel --def ../../dll_resources/MinHook.def -Wl,-enable-stdcall-fixup -Wall MinHook_rc.o ../../src/*.c ../../src/hde/*.c -I../../include -I../../src -Werror -s -static-libgcc -static-libstdc++
3 | 


--------------------------------------------------------------------------------
/build/VC10/MinHook.vcxproj:
--------------------------------------------------------------------------------
  1 | <?xml version="1.0" encoding="utf-8"?>
  2 | <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  3 |   <ItemGroup Label="ProjectConfigurations">
  4 |     <ProjectConfiguration Include="Debug|Win32">
  5 |       <Configuration>Debug</Configuration>
  6 |       <Platform>Win32</Platform>
  7 |     </ProjectConfiguration>
  8 |     <ProjectConfiguration Include="Debug|x64">
  9 |       <Configuration>Debug</Configuration>
 10 |       <Platform>x64</Platform>
 11 |     </ProjectConfiguration>
 12 |     <ProjectConfiguration Include="Release|Win32">
 13 |       <Configuration>Release</Configuration>
 14 |       <Platform>Win32</Platform>
 15 |     </ProjectConfiguration>
 16 |     <ProjectConfiguration Include="Release|x64">
 17 |       <Configuration>Release</Configuration>
 18 |       <Platform>x64</Platform>
 19 |     </ProjectConfiguration>
 20 |   </ItemGroup>
 21 |   <PropertyGroup Label="Globals">
 22 |     <ProjectGuid>{027FAC75-3FDB-4044-8DD0-BC297BD4C461}</ProjectGuid>
 23 |     <RootNamespace>MinHook</RootNamespace>
 24 |     <Keyword>Win32Proj</Keyword>
 25 |   </PropertyGroup>
 26 |   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
 27 |   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
 28 |     <ConfigurationType>DynamicLibrary</ConfigurationType>
 29 |     <CharacterSet>Unicode</CharacterSet>
 30 |     <WholeProgramOptimization>true</WholeProgramOptimization>
 31 |   </PropertyGroup>
 32 |   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
 33 |     <ConfigurationType>DynamicLibrary</ConfigurationType>
 34 |     <CharacterSet>Unicode</CharacterSet>
 35 |   </PropertyGroup>
 36 |   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
 37 |     <ConfigurationType>DynamicLibrary</ConfigurationType>
 38 |     <CharacterSet>Unicode</CharacterSet>
 39 |     <WholeProgramOptimization>true</WholeProgramOptimization>
 40 |   </PropertyGroup>
 41 |   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
 42 |     <ConfigurationType>DynamicLibrary</ConfigurationType>
 43 |     <CharacterSet>Unicode</CharacterSet>
 44 |   </PropertyGroup>
 45 |   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
 46 |   <ImportGroup Label="ExtensionSettings">
 47 |   </ImportGroup>
 48 |   <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
 49 |     <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
 50 |   </ImportGroup>
 51 |   <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
 52 |     <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
 53 |   </ImportGroup>
 54 |   <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
 55 |     <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
 56 |   </ImportGroup>
 57 |   <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
 58 |     <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
 59 |   </ImportGroup>
 60 |   <PropertyGroup Label="UserMacros" />
 61 |   <PropertyGroup>
 62 |     <_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
 63 |     <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)bin\$(Configuration)\</OutDir>
 64 |     <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
 65 |     <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
 66 |     <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)bin\$(Configuration)\</OutDir>
 67 |     <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
 68 |     <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
 69 |     <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)bin\$(Configuration)\</OutDir>
 70 |     <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
 71 |     <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
 72 |     <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)bin\$(Configuration)\</OutDir>
 73 |     <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
 74 |     <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
 75 |     <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectName).x86</TargetName>
 76 |     <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectName).x86</TargetName>
 77 |     <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(ProjectName).x64</TargetName>
 78 |     <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(ProjectName).x64</TargetName>
 79 |   </PropertyGroup>
 80 |   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
 81 |     <ClCompile>
 82 |       <Optimization>Disabled</Optimization>
 83 |       <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;MINHOOK_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
 84 |       <MinimalRebuild>false</MinimalRebuild>
 85 |       <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
 86 |       <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
 87 |       <PrecompiledHeader>
 88 |       </PrecompiledHeader>
 89 |       <WarningLevel>Level3</WarningLevel>
 90 |       <DebugInformationFormat>
 91 |       </DebugInformationFormat>
 92 |     </ClCompile>
 93 |     <Link>
 94 |       <ModuleDefinitionFile>$(SolutionDir)..\..\dll_resources\MinHook.def</ModuleDefinitionFile>
 95 |       <GenerateDebugInformation>false</GenerateDebugInformation>
 96 |       <SubSystem>Windows</SubSystem>
 97 |       <TargetMachine>MachineX86</TargetMachine>
 98 |       <AdditionalDependencies>$(SolutionDir)lib\$(Configuration)\libMinHook.x86.lib;%(AdditionalDependencies)</AdditionalDependencies>
 99 |     </Link>
100 |   </ItemDefinitionGroup>
101 |   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
102 |     <Midl>
103 |       <TargetEnvironment>X64</TargetEnvironment>
104 |     </Midl>
105 |     <ClCompile>
106 |       <Optimization>Disabled</Optimization>
107 |       <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;MINHOOK_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
108 |       <MinimalRebuild>false</MinimalRebuild>
109 |       <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
110 |       <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
111 |       <PrecompiledHeader>
112 |       </PrecompiledHeader>
113 |       <WarningLevel>Level3</WarningLevel>
114 |       <DebugInformationFormat>
115 |       </DebugInformationFormat>
116 |     </ClCompile>
117 |     <Link>
118 |       <ModuleDefinitionFile>$(SolutionDir)..\..\dll_resources\MinHook.def</ModuleDefinitionFile>
119 |       <GenerateDebugInformation>false</GenerateDebugInformation>
120 |       <SubSystem>Windows</SubSystem>
121 |       <TargetMachine>MachineX64</TargetMachine>
122 |       <AdditionalDependencies>$(SolutionDir)lib\$(Configuration)\libMinHook.x64.lib;%(AdditionalDependencies)</AdditionalDependencies>
123 |     </Link>
124 |   </ItemDefinitionGroup>
125 |   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
126 |     <ClCompile>
127 |       <Optimization>MinSpace</Optimization>
128 |       <IntrinsicFunctions>true</IntrinsicFunctions>
129 |       <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;MINHOOK_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
130 |       <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
131 |       <FunctionLevelLinking>true</FunctionLevelLinking>
132 |       <PrecompiledHeader>
133 |       </PrecompiledHeader>
134 |       <WarningLevel>Level3</WarningLevel>
135 |       <DebugInformationFormat>
136 |       </DebugInformationFormat>
137 |       <MinimalRebuild>false</MinimalRebuild>
138 |     </ClCompile>
139 |     <Link>
140 |       <ModuleDefinitionFile>$(SolutionDir)..\..\dll_resources\MinHook.def</ModuleDefinitionFile>
141 |       <GenerateDebugInformation>false</GenerateDebugInformation>
142 |       <SubSystem>Windows</SubSystem>
143 |       <OptimizeReferences>true</OptimizeReferences>
144 |       <EnableCOMDATFolding>true</EnableCOMDATFolding>
145 |       <TargetMachine>MachineX86</TargetMachine>
146 |       <AdditionalDependencies>$(SolutionDir)lib\$(Configuration)\libMinHook.x86.lib;%(AdditionalDependencies)</AdditionalDependencies>
147 |       <NoEntryPoint>true</NoEntryPoint>
148 |       <MergeSections>.CRT=.text</MergeSections>
149 |     </Link>
150 |   </ItemDefinitionGroup>
151 |   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
152 |     <Midl>
153 |       <TargetEnvironment>X64</TargetEnvironment>
154 |     </Midl>
155 |     <ClCompile>
156 |       <Optimization>MinSpace</Optimization>
157 |       <IntrinsicFunctions>true</IntrinsicFunctions>
158 |       <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;MINHOOK_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
159 |       <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
160 |       <FunctionLevelLinking>true</FunctionLevelLinking>
161 |       <PrecompiledHeader>
162 |       </PrecompiledHeader>
163 |       <WarningLevel>Level3</WarningLevel>
164 |       <DebugInformationFormat>
165 |       </DebugInformationFormat>
166 |       <MinimalRebuild>false</MinimalRebuild>
167 |     </ClCompile>
168 |     <Link>
169 |       <ModuleDefinitionFile>$(SolutionDir)..\..\dll_resources\MinHook.def</ModuleDefinitionFile>
170 |       <GenerateDebugInformation>false</GenerateDebugInformation>
171 |       <SubSystem>Windows</SubSystem>
172 |       <OptimizeReferences>true</OptimizeReferences>
173 |       <EnableCOMDATFolding>true</EnableCOMDATFolding>
174 |       <TargetMachine>MachineX64</TargetMachine>
175 |       <AdditionalDependencies>$(SolutionDir)lib\$(Configuration)\libMinHook.x64.lib;%(AdditionalDependencies)</AdditionalDependencies>
176 |       <NoEntryPoint>true</NoEntryPoint>
177 |       <MergeSections>.CRT=.text</MergeSections>
178 |     </Link>
179 |   </ItemDefinitionGroup>
180 |   <ItemGroup>
181 |     <None Include="..\..\dll_resources\MinHook.def" />
182 |   </ItemGroup>
183 |   <ItemGroup>
184 |     <ResourceCompile Include="..\..\dll_resources\MinHook.rc" />
185 |   </ItemGroup>
186 |   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
187 |   <ImportGroup Label="ExtensionTargets">
188 |   </ImportGroup>
189 | </Project>


--------------------------------------------------------------------------------
/build/VC10/MinHookVC10.sln:
--------------------------------------------------------------------------------
 1 | 
 2 | Microsoft Visual Studio Solution File, Format Version 11.00
 3 | # Visual Studio 2010
 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libMinHook", "libMinHook.vcxproj", "{F142A341-5EE0-442D-A15F-98AE9B48DBAE}"
 5 | EndProject
 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MinHook", "MinHook.vcxproj", "{027FAC75-3FDB-4044-8DD0-BC297BD4C461}"
 7 | 	ProjectSection(ProjectDependencies) = postProject
 8 | 		{F142A341-5EE0-442D-A15F-98AE9B48DBAE} = {F142A341-5EE0-442D-A15F-98AE9B48DBAE}
 9 | 	EndProjectSection
10 | EndProject
11 | Global
12 | 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
13 | 		Debug|Win32 = Debug|Win32
14 | 		Debug|x64 = Debug|x64
15 | 		Release|Win32 = Release|Win32
16 | 		Release|x64 = Release|x64
17 | 	EndGlobalSection
18 | 	GlobalSection(ProjectConfigurationPlatforms) = postSolution
19 | 		{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Debug|Win32.ActiveCfg = Debug|Win32
20 | 		{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Debug|Win32.Build.0 = Debug|Win32
21 | 		{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Debug|x64.ActiveCfg = Debug|x64
22 | 		{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Debug|x64.Build.0 = Debug|x64
23 | 		{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Release|Win32.ActiveCfg = Release|Win32
24 | 		{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Release|Win32.Build.0 = Release|Win32
25 | 		{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Release|x64.ActiveCfg = Release|x64
26 | 		{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Release|x64.Build.0 = Release|x64
27 | 		{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Debug|Win32.ActiveCfg = Debug|Win32
28 | 		{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Debug|Win32.Build.0 = Debug|Win32
29 | 		{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Debug|x64.ActiveCfg = Debug|x64
30 | 		{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Debug|x64.Build.0 = Debug|x64
31 | 		{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Release|Win32.ActiveCfg = Release|Win32
32 | 		{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Release|Win32.Build.0 = Release|Win32
33 | 		{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Release|x64.ActiveCfg = Release|x64
34 | 		{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Release|x64.Build.0 = Release|x64
35 | 	EndGlobalSection
36 | 	GlobalSection(SolutionProperties) = preSolution
37 | 		HideSolutionNode = FALSE
38 | 	EndGlobalSection
39 | EndGlobal
40 | 


--------------------------------------------------------------------------------
/build/VC10/libMinHook.vcxproj:
--------------------------------------------------------------------------------
  1 | <?xml version="1.0" encoding="utf-8"?>
  2 | <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  3 |   <ItemGroup Label="ProjectConfigurations">
  4 |     <ProjectConfiguration Include="Debug|Win32">
  5 |       <Configuration>Debug</Configuration>
  6 |       <Platform>Win32</Platform>
  7 |     </ProjectConfiguration>
  8 |     <ProjectConfiguration Include="Debug|x64">
  9 |       <Configuration>Debug</Configuration>
 10 |       <Platform>x64</Platform>
 11 |     </ProjectConfiguration>
 12 |     <ProjectConfiguration Include="Release|Win32">
 13 |       <Configuration>Release</Configuration>
 14 |       <Platform>Win32</Platform>
 15 |     </ProjectConfiguration>
 16 |     <ProjectConfiguration Include="Release|x64">
 17 |       <Configuration>Release</Configuration>
 18 |       <Platform>x64</Platform>
 19 |     </ProjectConfiguration>
 20 |   </ItemGroup>
 21 |   <PropertyGroup Label="Globals">
 22 |     <ProjectGuid>{F142A341-5EE0-442D-A15F-98AE9B48DBAE}</ProjectGuid>
 23 |     <RootNamespace>libMinHook</RootNamespace>
 24 |     <Keyword>Win32Proj</Keyword>
 25 |   </PropertyGroup>
 26 |   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
 27 |   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
 28 |     <ConfigurationType>StaticLibrary</ConfigurationType>
 29 |     <CharacterSet>Unicode</CharacterSet>
 30 |     <WholeProgramOptimization>true</WholeProgramOptimization>
 31 |   </PropertyGroup>
 32 |   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
 33 |     <ConfigurationType>StaticLibrary</ConfigurationType>
 34 |     <CharacterSet>Unicode</CharacterSet>
 35 |   </PropertyGroup>
 36 |   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
 37 |     <ConfigurationType>StaticLibrary</ConfigurationType>
 38 |     <CharacterSet>Unicode</CharacterSet>
 39 |     <WholeProgramOptimization>true</WholeProgramOptimization>
 40 |   </PropertyGroup>
 41 |   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
 42 |     <ConfigurationType>StaticLibrary</ConfigurationType>
 43 |     <CharacterSet>Unicode</CharacterSet>
 44 |   </PropertyGroup>
 45 |   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
 46 |   <ImportGroup Label="ExtensionSettings">
 47 |   </ImportGroup>
 48 |   <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
 49 |     <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
 50 |   </ImportGroup>
 51 |   <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
 52 |     <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
 53 |   </ImportGroup>
 54 |   <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
 55 |     <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
 56 |   </ImportGroup>
 57 |   <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
 58 |     <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
 59 |   </ImportGroup>
 60 |   <PropertyGroup Label="UserMacros" />
 61 |   <PropertyGroup>
 62 |     <_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
 63 |     <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)lib\$(Configuration)\</OutDir>
 64 |     <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
 65 |     <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)lib\$(Configuration)\</OutDir>
 66 |     <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
 67 |     <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)lib\$(Configuration)\</OutDir>
 68 |     <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
 69 |     <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)lib\$(Configuration)\</OutDir>
 70 |     <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
 71 |     <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectName).x86</TargetName>
 72 |     <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectName).x86</TargetName>
 73 |     <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(ProjectName).x64</TargetName>
 74 |     <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(ProjectName).x64</TargetName>
 75 |   </PropertyGroup>
 76 |   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
 77 |     <ClCompile>
 78 |       <Optimization>Disabled</Optimization>
 79 |       <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
 80 |       <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;STRICT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
 81 |       <MinimalRebuild>false</MinimalRebuild>
 82 |       <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
 83 |       <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
 84 |       <WarningLevel>Level3</WarningLevel>
 85 |       <DebugInformationFormat>
 86 |       </DebugInformationFormat>
 87 |       <WholeProgramOptimization>false</WholeProgramOptimization>
 88 |     </ClCompile>
 89 |     <Lib />
 90 |   </ItemDefinitionGroup>
 91 |   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
 92 |     <Midl>
 93 |       <TargetEnvironment>X64</TargetEnvironment>
 94 |     </Midl>
 95 |     <ClCompile>
 96 |       <Optimization>Disabled</Optimization>
 97 |       <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
 98 |       <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;STRICT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
 99 |       <MinimalRebuild>false</MinimalRebuild>
100 |       <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
101 |       <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
102 |       <WarningLevel>Level3</WarningLevel>
103 |       <DebugInformationFormat>
104 |       </DebugInformationFormat>
105 |       <WholeProgramOptimization>false</WholeProgramOptimization>
106 |     </ClCompile>
107 |     <Lib />
108 |   </ItemDefinitionGroup>
109 |   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
110 |     <ClCompile>
111 |       <Optimization>MinSpace</Optimization>
112 |       <IntrinsicFunctions>true</IntrinsicFunctions>
113 |       <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
114 |       <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;STRICT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
115 |       <MinimalRebuild>false</MinimalRebuild>
116 |       <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
117 |       <FunctionLevelLinking>true</FunctionLevelLinking>
118 |       <WarningLevel>Level3</WarningLevel>
119 |       <DebugInformationFormat>
120 |       </DebugInformationFormat>
121 |       <WholeProgramOptimization>true</WholeProgramOptimization>
122 |       <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
123 |     </ClCompile>
124 |     <Lib />
125 |   </ItemDefinitionGroup>
126 |   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
127 |     <Midl>
128 |       <TargetEnvironment>X64</TargetEnvironment>
129 |     </Midl>
130 |     <ClCompile>
131 |       <Optimization>MinSpace</Optimization>
132 |       <IntrinsicFunctions>true</IntrinsicFunctions>
133 |       <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
134 |       <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;STRICT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
135 |       <MinimalRebuild>false</MinimalRebuild>
136 |       <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
137 |       <FunctionLevelLinking>true</FunctionLevelLinking>
138 |       <WarningLevel>Level3</WarningLevel>
139 |       <DebugInformationFormat>
140 |       </DebugInformationFormat>
141 |       <WholeProgramOptimization>true</WholeProgramOptimization>
142 |       <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
143 |     </ClCompile>
144 |     <Lib />
145 |   </ItemDefinitionGroup>
146 |   <ItemGroup>
147 |     <ClCompile Include="..\..\src\buffer.c" />
148 |     <ClCompile Include="..\..\src\HDE\hde32.c">
149 |       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
150 |       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
151 |     </ClCompile>
152 |     <ClCompile Include="..\..\src\HDE\hde64.c">
153 |       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
154 |       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
155 |     </ClCompile>
156 |     <ClCompile Include="..\..\src\hook.c" />
157 |     <ClCompile Include="..\..\src\trampoline.c" />
158 |   </ItemGroup>
159 |   <ItemGroup>
160 |     <ClInclude Include="..\..\include\MinHook.h" />
161 |     <ClInclude Include="..\..\src\buffer.h" />
162 |     <ClInclude Include="..\..\src\HDE\hde32.h" />
163 |     <ClInclude Include="..\..\src\HDE\hde64.h" />
164 |     <ClInclude Include="..\..\src\HDE\pstdint.h" />
165 |     <ClInclude Include="..\..\src\HDE\table32.h" />
166 |     <ClInclude Include="..\..\src\HDE\table64.h" />
167 |     <ClInclude Include="..\..\src\trampoline.h" />
168 |   </ItemGroup>
169 |   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
170 |   <ImportGroup Label="ExtensionTargets">
171 |   </ImportGroup>
172 | </Project>


--------------------------------------------------------------------------------
/build/VC10/libMinHook.vcxproj.filters:
--------------------------------------------------------------------------------
 1 | <?xml version="1.0" encoding="utf-8"?>
 2 | <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
 3 |   <ItemGroup>
 4 |     <ClCompile Include="..\..\src\buffer.c">
 5 |       <Filter>Source Files</Filter>
 6 |     </ClCompile>
 7 |     <ClCompile Include="..\..\src\hook.c">
 8 |       <Filter>Source Files</Filter>
 9 |     </ClCompile>
10 |     <ClCompile Include="..\..\src\trampoline.c">
11 |       <Filter>Source Files</Filter>
12 |     </ClCompile>
13 |     <ClCompile Include="..\..\src\HDE\hde32.c">
14 |       <Filter>HDE</Filter>
15 |     </ClCompile>
16 |     <ClCompile Include="..\..\src\HDE\hde64.c">
17 |       <Filter>HDE</Filter>
18 |     </ClCompile>
19 |   </ItemGroup>
20 |   <ItemGroup>
21 |     <ClInclude Include="..\..\src\trampoline.h">
22 |       <Filter>Header Files</Filter>
23 |     </ClInclude>
24 |     <ClInclude Include="..\..\src\buffer.h">
25 |       <Filter>Header Files</Filter>
26 |     </ClInclude>
27 |     <ClInclude Include="..\..\include\MinHook.h" />
28 |     <ClInclude Include="..\..\src\HDE\hde32.h">
29 |       <Filter>HDE</Filter>
30 |     </ClInclude>
31 |     <ClInclude Include="..\..\src\HDE\hde64.h">
32 |       <Filter>HDE</Filter>
33 |     </ClInclude>
34 |     <ClInclude Include="..\..\src\HDE\pstdint.h">
35 |       <Filter>HDE</Filter>
36 |     </ClInclude>
37 |     <ClInclude Include="..\..\src\HDE\table32.h">
38 |       <Filter>HDE</Filter>
39 |     </ClInclude>
40 |     <ClInclude Include="..\..\src\HDE\table64.h">
41 |       <Filter>HDE</Filter>
42 |     </ClInclude>
43 |   </ItemGroup>
44 |   <ItemGroup>
45 |     <Filter Include="Source Files">
46 |       <UniqueIdentifier>{9d24b740-be2e-4cfd-b9a4-340a50946ee9}</UniqueIdentifier>
47 |     </Filter>
48 |     <Filter Include="Header Files">
49 |       <UniqueIdentifier>{76381bc7-2863-4cc5-aede-926ec2c506e4}</UniqueIdentifier>
50 |     </Filter>
51 |     <Filter Include="HDE">
52 |       <UniqueIdentifier>{56ddb326-6179-430d-ae19-e13bfd767bfa}</UniqueIdentifier>
53 |     </Filter>
54 |   </ItemGroup>
55 | </Project>


--------------------------------------------------------------------------------
/build/VC11/MinHookVC11.sln:
--------------------------------------------------------------------------------
 1 | 
 2 | Microsoft Visual Studio Solution File, Format Version 12.00
 3 | # Visual Studio 2012
 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libMinHook", "libMinHook.vcxproj", "{F142A341-5EE0-442D-A15F-98AE9B48DBAE}"
 5 | EndProject
 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MinHook", "MinHook.vcxproj", "{027FAC75-3FDB-4044-8DD0-BC297BD4C461}"
 7 | 	ProjectSection(ProjectDependencies) = postProject
 8 | 		{F142A341-5EE0-442D-A15F-98AE9B48DBAE} = {F142A341-5EE0-442D-A15F-98AE9B48DBAE}
 9 | 	EndProjectSection
10 | EndProject
11 | Global
12 | 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
13 | 		Debug|Win32 = Debug|Win32
14 | 		Debug|x64 = Debug|x64
15 | 		Release|Win32 = Release|Win32
16 | 		Release|x64 = Release|x64
17 | 	EndGlobalSection
18 | 	GlobalSection(ProjectConfigurationPlatforms) = postSolution
19 | 		{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Debug|Win32.ActiveCfg = Debug|Win32
20 | 		{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Debug|Win32.Build.0 = Debug|Win32
21 | 		{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Debug|x64.ActiveCfg = Debug|x64
22 | 		{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Debug|x64.Build.0 = Debug|x64
23 | 		{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Release|Win32.ActiveCfg = Release|Win32
24 | 		{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Release|Win32.Build.0 = Release|Win32
25 | 		{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Release|x64.ActiveCfg = Release|x64
26 | 		{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Release|x64.Build.0 = Release|x64
27 | 		{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Debug|Win32.ActiveCfg = Debug|Win32
28 | 		{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Debug|Win32.Build.0 = Debug|Win32
29 | 		{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Debug|x64.ActiveCfg = Debug|x64
30 | 		{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Debug|x64.Build.0 = Debug|x64
31 | 		{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Release|Win32.ActiveCfg = Release|Win32
32 | 		{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Release|Win32.Build.0 = Release|Win32
33 | 		{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Release|x64.ActiveCfg = Release|x64
34 | 		{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Release|x64.Build.0 = Release|x64
35 | 	EndGlobalSection
36 | 	GlobalSection(SolutionProperties) = preSolution
37 | 		HideSolutionNode = FALSE
38 | 	EndGlobalSection
39 | EndGlobal
40 | 


--------------------------------------------------------------------------------
/build/VC11/libMinHook.vcxproj:
--------------------------------------------------------------------------------
  1 | <?xml version="1.0" encoding="utf-8"?>
  2 | <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  3 |   <ItemGroup Label="ProjectConfigurations">
  4 |     <ProjectConfiguration Include="Debug|Win32">
  5 |       <Configuration>Debug</Configuration>
  6 |       <Platform>Win32</Platform>
  7 |     </ProjectConfiguration>
  8 |     <ProjectConfiguration Include="Debug|x64">
  9 |       <Configuration>Debug</Configuration>
 10 |       <Platform>x64</Platform>
 11 |     </ProjectConfiguration>
 12 |     <ProjectConfiguration Include="Release|Win32">
 13 |       <Configuration>Release</Configuration>
 14 |       <Platform>Win32</Platform>
 15 |     </ProjectConfiguration>
 16 |     <ProjectConfiguration Include="Release|x64">
 17 |       <Configuration>Release</Configuration>
 18 |       <Platform>x64</Platform>
 19 |     </ProjectConfiguration>
 20 |   </ItemGroup>
 21 |   <PropertyGroup Label="Globals">
 22 |     <ProjectGuid>{F142A341-5EE0-442D-A15F-98AE9B48DBAE}</ProjectGuid>
 23 |     <RootNamespace>libMinHook</RootNamespace>
 24 |     <Keyword>Win32Proj</Keyword>
 25 |   </PropertyGroup>
 26 |   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
 27 |   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
 28 |     <ConfigurationType>StaticLibrary</ConfigurationType>
 29 |     <CharacterSet>Unicode</CharacterSet>
 30 |     <WholeProgramOptimization>true</WholeProgramOptimization>
 31 |     <PlatformToolset>v110_xp</PlatformToolset>
 32 |   </PropertyGroup>
 33 |   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
 34 |     <ConfigurationType>StaticLibrary</ConfigurationType>
 35 |     <CharacterSet>Unicode</CharacterSet>
 36 |     <PlatformToolset>v110_xp</PlatformToolset>
 37 |   </PropertyGroup>
 38 |   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
 39 |     <ConfigurationType>StaticLibrary</ConfigurationType>
 40 |     <CharacterSet>Unicode</CharacterSet>
 41 |     <WholeProgramOptimization>true</WholeProgramOptimization>
 42 |     <PlatformToolset>v110_xp</PlatformToolset>
 43 |   </PropertyGroup>
 44 |   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
 45 |     <ConfigurationType>StaticLibrary</ConfigurationType>
 46 |     <CharacterSet>Unicode</CharacterSet>
 47 |     <PlatformToolset>v110_xp</PlatformToolset>
 48 |   </PropertyGroup>
 49 |   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
 50 |   <ImportGroup Label="ExtensionSettings">
 51 |   </ImportGroup>
 52 |   <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
 53 |     <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
 54 |   </ImportGroup>
 55 |   <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
 56 |     <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
 57 |   </ImportGroup>
 58 |   <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
 59 |     <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
 60 |   </ImportGroup>
 61 |   <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
 62 |     <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
 63 |   </ImportGroup>
 64 |   <PropertyGroup Label="UserMacros" />
 65 |   <PropertyGroup>
 66 |     <_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
 67 |     <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)lib\$(Configuration)\</OutDir>
 68 |     <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
 69 |     <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)lib\$(Configuration)\</OutDir>
 70 |     <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
 71 |     <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)lib\$(Configuration)\</OutDir>
 72 |     <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
 73 |     <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)lib\$(Configuration)\</OutDir>
 74 |     <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
 75 |     <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectName).x86</TargetName>
 76 |     <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectName).x86</TargetName>
 77 |     <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(ProjectName).x64</TargetName>
 78 |     <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(ProjectName).x64</TargetName>
 79 |   </PropertyGroup>
 80 |   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
 81 |     <ClCompile>
 82 |       <Optimization>Disabled</Optimization>
 83 |       <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
 84 |       <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;STRICT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
 85 |       <MinimalRebuild>false</MinimalRebuild>
 86 |       <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
 87 |       <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
 88 |       <WarningLevel>Level3</WarningLevel>
 89 |       <DebugInformationFormat>None</DebugInformationFormat>
 90 |       <EnableEnhancedInstructionSet>NoExtensions</EnableEnhancedInstructionSet>
 91 |     </ClCompile>
 92 |     <Lib />
 93 |   </ItemDefinitionGroup>
 94 |   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
 95 |     <Midl>
 96 |       <TargetEnvironment>X64</TargetEnvironment>
 97 |     </Midl>
 98 |     <ClCompile>
 99 |       <Optimization>Disabled</Optimization>
100 |       <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
101 |       <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;STRICT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
102 |       <MinimalRebuild>false</MinimalRebuild>
103 |       <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
104 |       <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
105 |       <WarningLevel>Level3</WarningLevel>
106 |       <DebugInformationFormat>None</DebugInformationFormat>
107 |     </ClCompile>
108 |     <Lib />
109 |   </ItemDefinitionGroup>
110 |   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
111 |     <ClCompile>
112 |       <Optimization>MinSpace</Optimization>
113 |       <IntrinsicFunctions>true</IntrinsicFunctions>
114 |       <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
115 |       <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;STRICT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
116 |       <MinimalRebuild>false</MinimalRebuild>
117 |       <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
118 |       <FunctionLevelLinking>true</FunctionLevelLinking>
119 |       <WarningLevel>Level3</WarningLevel>
120 |       <DebugInformationFormat>None</DebugInformationFormat>
121 |       <WholeProgramOptimization>true</WholeProgramOptimization>
122 |       <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
123 |       <EnableEnhancedInstructionSet>NoExtensions</EnableEnhancedInstructionSet>
124 |     </ClCompile>
125 |     <Lib />
126 |   </ItemDefinitionGroup>
127 |   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
128 |     <Midl>
129 |       <TargetEnvironment>X64</TargetEnvironment>
130 |     </Midl>
131 |     <ClCompile>
132 |       <Optimization>MinSpace</Optimization>
133 |       <IntrinsicFunctions>true</IntrinsicFunctions>
134 |       <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
135 |       <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;STRICT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
136 |       <MinimalRebuild>false</MinimalRebuild>
137 |       <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
138 |       <FunctionLevelLinking>true</FunctionLevelLinking>
139 |       <WarningLevel>Level3</WarningLevel>
140 |       <DebugInformationFormat>None</DebugInformationFormat>
141 |       <WholeProgramOptimization>true</WholeProgramOptimization>
142 |       <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
143 |     </ClCompile>
144 |     <Lib />
145 |   </ItemDefinitionGroup>
146 |   <ItemGroup>
147 |     <ClCompile Include="..\..\src\buffer.c" />
148 |     <ClCompile Include="..\..\src\HDE\hde32.c">
149 |       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
150 |       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
151 |     </ClCompile>
152 |     <ClCompile Include="..\..\src\HDE\hde64.c">
153 |       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
154 |       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
155 |     </ClCompile>
156 |     <ClCompile Include="..\..\src\hook.c" />
157 |     <ClCompile Include="..\..\src\trampoline.c" />
158 |   </ItemGroup>
159 |   <ItemGroup>
160 |     <ClInclude Include="..\..\include\MinHook.h" />
161 |     <ClInclude Include="..\..\src\buffer.h" />
162 |     <ClInclude Include="..\..\src\HDE\hde32.h" />
163 |     <ClInclude Include="..\..\src\HDE\hde64.h" />
164 |     <ClInclude Include="..\..\src\HDE\pstdint.h" />
165 |     <ClInclude Include="..\..\src\HDE\table32.h" />
166 |     <ClInclude Include="..\..\src\HDE\table64.h" />
167 |     <ClInclude Include="..\..\src\trampoline.h" />
168 |   </ItemGroup>
169 |   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
170 |   <ImportGroup Label="ExtensionTargets">
171 |   </ImportGroup>
172 | </Project>


--------------------------------------------------------------------------------
/build/VC11/libMinHook.vcxproj.filters:
--------------------------------------------------------------------------------
 1 | <?xml version="1.0" encoding="utf-8"?>
 2 | <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
 3 |   <ItemGroup>
 4 |     <ClCompile Include="..\..\src\buffer.c">
 5 |       <Filter>Source Files</Filter>
 6 |     </ClCompile>
 7 |     <ClCompile Include="..\..\src\hook.c">
 8 |       <Filter>Source Files</Filter>
 9 |     </ClCompile>
10 |     <ClCompile Include="..\..\src\trampoline.c">
11 |       <Filter>Source Files</Filter>
12 |     </ClCompile>
13 |     <ClCompile Include="..\..\src\HDE\hde32.c">
14 |       <Filter>HDE</Filter>
15 |     </ClCompile>
16 |     <ClCompile Include="..\..\src\HDE\hde64.c">
17 |       <Filter>HDE</Filter>
18 |     </ClCompile>
19 |   </ItemGroup>
20 |   <ItemGroup>
21 |     <ClInclude Include="..\..\src\trampoline.h">
22 |       <Filter>Header Files</Filter>
23 |     </ClInclude>
24 |     <ClInclude Include="..\..\src\buffer.h">
25 |       <Filter>Header Files</Filter>
26 |     </ClInclude>
27 |     <ClInclude Include="..\..\include\MinHook.h" />
28 |     <ClInclude Include="..\..\src\HDE\hde32.h">
29 |       <Filter>HDE</Filter>
30 |     </ClInclude>
31 |     <ClInclude Include="..\..\src\HDE\hde64.h">
32 |       <Filter>HDE</Filter>
33 |     </ClInclude>
34 |     <ClInclude Include="..\..\src\HDE\pstdint.h">
35 |       <Filter>HDE</Filter>
36 |     </ClInclude>
37 |     <ClInclude Include="..\..\src\HDE\table32.h">
38 |       <Filter>HDE</Filter>
39 |     </ClInclude>
40 |     <ClInclude Include="..\..\src\HDE\table64.h">
41 |       <Filter>HDE</Filter>
42 |     </ClInclude>
43 |   </ItemGroup>
44 |   <ItemGroup>
45 |     <Filter Include="Source Files">
46 |       <UniqueIdentifier>{9d24b740-be2e-4cfd-b9a4-340a50946ee9}</UniqueIdentifier>
47 |     </Filter>
48 |     <Filter Include="Header Files">
49 |       <UniqueIdentifier>{76381bc7-2863-4cc5-aede-926ec2c506e4}</UniqueIdentifier>
50 |     </Filter>
51 |     <Filter Include="HDE">
52 |       <UniqueIdentifier>{56ddb326-6179-430d-ae19-e13bfd767bfa}</UniqueIdentifier>
53 |     </Filter>
54 |   </ItemGroup>
55 | </Project>


--------------------------------------------------------------------------------
/build/VC12/MinHookVC12.sln:
--------------------------------------------------------------------------------
 1 | 
 2 | Microsoft Visual Studio Solution File, Format Version 12.00
 3 | # Visual Studio 2013
 4 | VisualStudioVersion = 12.0.30501.0
 5 | MinimumVisualStudioVersion = 10.0.40219.1
 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libMinHook", "libMinHook.vcxproj", "{F142A341-5EE0-442D-A15F-98AE9B48DBAE}"
 7 | EndProject
 8 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MinHook", "MinHook.vcxproj", "{027FAC75-3FDB-4044-8DD0-BC297BD4C461}"
 9 | 	ProjectSection(ProjectDependencies) = postProject
10 | 		{F142A341-5EE0-442D-A15F-98AE9B48DBAE} = {F142A341-5EE0-442D-A15F-98AE9B48DBAE}
11 | 	EndProjectSection
12 | EndProject
13 | Global
14 | 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
15 | 		Debug|Win32 = Debug|Win32
16 | 		Debug|x64 = Debug|x64
17 | 		Release|Win32 = Release|Win32
18 | 		Release|x64 = Release|x64
19 | 	EndGlobalSection
20 | 	GlobalSection(ProjectConfigurationPlatforms) = postSolution
21 | 		{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Debug|Win32.ActiveCfg = Debug|Win32
22 | 		{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Debug|Win32.Build.0 = Debug|Win32
23 | 		{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Debug|x64.ActiveCfg = Debug|x64
24 | 		{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Debug|x64.Build.0 = Debug|x64
25 | 		{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Release|Win32.ActiveCfg = Release|Win32
26 | 		{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Release|Win32.Build.0 = Release|Win32
27 | 		{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Release|x64.ActiveCfg = Release|x64
28 | 		{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Release|x64.Build.0 = Release|x64
29 | 		{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Debug|Win32.ActiveCfg = Debug|Win32
30 | 		{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Debug|Win32.Build.0 = Debug|Win32
31 | 		{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Debug|x64.ActiveCfg = Debug|x64
32 | 		{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Debug|x64.Build.0 = Debug|x64
33 | 		{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Release|Win32.ActiveCfg = Release|Win32
34 | 		{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Release|Win32.Build.0 = Release|Win32
35 | 		{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Release|x64.ActiveCfg = Release|x64
36 | 		{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Release|x64.Build.0 = Release|x64
37 | 	EndGlobalSection
38 | 	GlobalSection(SolutionProperties) = preSolution
39 | 		HideSolutionNode = FALSE
40 | 	EndGlobalSection
41 | EndGlobal
42 | 


--------------------------------------------------------------------------------
/build/VC12/libMinHook.vcxproj:
--------------------------------------------------------------------------------
  1 | <?xml version="1.0" encoding="utf-8"?>
  2 | <Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  3 |   <ItemGroup Label="ProjectConfigurations">
  4 |     <ProjectConfiguration Include="Debug|Win32">
  5 |       <Configuration>Debug</Configuration>
  6 |       <Platform>Win32</Platform>
  7 |     </ProjectConfiguration>
  8 |     <ProjectConfiguration Include="Debug|x64">
  9 |       <Configuration>Debug</Configuration>
 10 |       <Platform>x64</Platform>
 11 |     </ProjectConfiguration>
 12 |     <ProjectConfiguration Include="Release|Win32">
 13 |       <Configuration>Release</Configuration>
 14 |       <Platform>Win32</Platform>
 15 |     </ProjectConfiguration>
 16 |     <ProjectConfiguration Include="Release|x64">
 17 |       <Configuration>Release</Configuration>
 18 |       <Platform>x64</Platform>
 19 |     </ProjectConfiguration>
 20 |   </ItemGroup>
 21 |   <PropertyGroup Label="Globals">
 22 |     <ProjectGuid>{F142A341-5EE0-442D-A15F-98AE9B48DBAE}</ProjectGuid>
 23 |     <RootNamespace>libMinHook</RootNamespace>
 24 |     <Keyword>Win32Proj</Keyword>
 25 |   </PropertyGroup>
 26 |   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
 27 |   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
 28 |     <ConfigurationType>StaticLibrary</ConfigurationType>
 29 |     <CharacterSet>Unicode</CharacterSet>
 30 |     <WholeProgramOptimization>true</WholeProgramOptimization>
 31 |     <PlatformToolset>v120_xp</PlatformToolset>
 32 |   </PropertyGroup>
 33 |   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
 34 |     <ConfigurationType>StaticLibrary</ConfigurationType>
 35 |     <CharacterSet>Unicode</CharacterSet>
 36 |     <PlatformToolset>v120_xp</PlatformToolset>
 37 |   </PropertyGroup>
 38 |   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
 39 |     <ConfigurationType>StaticLibrary</ConfigurationType>
 40 |     <CharacterSet>Unicode</CharacterSet>
 41 |     <WholeProgramOptimization>true</WholeProgramOptimization>
 42 |     <PlatformToolset>v120_xp</PlatformToolset>
 43 |   </PropertyGroup>
 44 |   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
 45 |     <ConfigurationType>StaticLibrary</ConfigurationType>
 46 |     <CharacterSet>Unicode</CharacterSet>
 47 |     <PlatformToolset>v120_xp</PlatformToolset>
 48 |   </PropertyGroup>
 49 |   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
 50 |   <ImportGroup Label="ExtensionSettings">
 51 |   </ImportGroup>
 52 |   <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
 53 |     <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
 54 |   </ImportGroup>
 55 |   <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
 56 |     <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
 57 |   </ImportGroup>
 58 |   <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
 59 |     <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
 60 |   </ImportGroup>
 61 |   <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
 62 |     <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
 63 |   </ImportGroup>
 64 |   <PropertyGroup Label="UserMacros" />
 65 |   <PropertyGroup>
 66 |     <_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
 67 |     <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)lib\$(Configuration)\</OutDir>
 68 |     <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
 69 |     <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)lib\$(Configuration)\</OutDir>
 70 |     <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
 71 |     <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)lib\$(Configuration)\</OutDir>
 72 |     <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
 73 |     <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)lib\$(Configuration)\</OutDir>
 74 |     <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
 75 |     <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectName).x86</TargetName>
 76 |     <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectName).x86</TargetName>
 77 |     <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(ProjectName).x64</TargetName>
 78 |     <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(ProjectName).x64</TargetName>
 79 |   </PropertyGroup>
 80 |   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
 81 |     <ClCompile>
 82 |       <Optimization>Disabled</Optimization>
 83 |       <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
 84 |       <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;STRICT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
 85 |       <MinimalRebuild>false</MinimalRebuild>
 86 |       <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
 87 |       <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
 88 |       <WarningLevel>Level3</WarningLevel>
 89 |       <DebugInformationFormat>None</DebugInformationFormat>
 90 |       <EnableEnhancedInstructionSet>NoExtensions</EnableEnhancedInstructionSet>
 91 |     </ClCompile>
 92 |     <Lib />
 93 |   </ItemDefinitionGroup>
 94 |   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
 95 |     <Midl>
 96 |       <TargetEnvironment>X64</TargetEnvironment>
 97 |     </Midl>
 98 |     <ClCompile>
 99 |       <Optimization>Disabled</Optimization>
100 |       <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
101 |       <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;STRICT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
102 |       <MinimalRebuild>false</MinimalRebuild>
103 |       <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
104 |       <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
105 |       <WarningLevel>Level3</WarningLevel>
106 |       <DebugInformationFormat>None</DebugInformationFormat>
107 |       <EnableEnhancedInstructionSet>NotSet</EnableEnhancedInstructionSet>
108 |     </ClCompile>
109 |     <Lib />
110 |   </ItemDefinitionGroup>
111 |   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
112 |     <ClCompile>
113 |       <Optimization>MinSpace</Optimization>
114 |       <IntrinsicFunctions>true</IntrinsicFunctions>
115 |       <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
116 |       <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;STRICT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
117 |       <MinimalRebuild>false</MinimalRebuild>
118 |       <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
119 |       <FunctionLevelLinking>true</FunctionLevelLinking>
120 |       <WarningLevel>Level3</WarningLevel>
121 |       <DebugInformationFormat>None</DebugInformationFormat>
122 |       <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
123 |       <WholeProgramOptimization>true</WholeProgramOptimization>
124 |       <EnableEnhancedInstructionSet>NoExtensions</EnableEnhancedInstructionSet>
125 |     </ClCompile>
126 |     <Lib />
127 |   </ItemDefinitionGroup>
128 |   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
129 |     <Midl>
130 |       <TargetEnvironment>X64</TargetEnvironment>
131 |     </Midl>
132 |     <ClCompile>
133 |       <Optimization>MinSpace</Optimization>
134 |       <IntrinsicFunctions>true</IntrinsicFunctions>
135 |       <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
136 |       <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;STRICT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
137 |       <MinimalRebuild>false</MinimalRebuild>
138 |       <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
139 |       <FunctionLevelLinking>true</FunctionLevelLinking>
140 |       <WarningLevel>Level3</WarningLevel>
141 |       <DebugInformationFormat>None</DebugInformationFormat>
142 |       <WholeProgramOptimization>true</WholeProgramOptimization>
143 |       <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
144 |     </ClCompile>
145 |     <Lib />
146 |   </ItemDefinitionGroup>
147 |   <ItemGroup>
148 |     <ClCompile Include="..\..\src\buffer.c" />
149 |     <ClCompile Include="..\..\src\HDE\hde32.c">
150 |       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
151 |       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
152 |     </ClCompile>
153 |     <ClCompile Include="..\..\src\HDE\hde64.c">
154 |       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
155 |       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
156 |     </ClCompile>
157 |     <ClCompile Include="..\..\src\hook.c" />
158 |     <ClCompile Include="..\..\src\trampoline.c" />
159 |   </ItemGroup>
160 |   <ItemGroup>
161 |     <ClInclude Include="..\..\include\MinHook.h" />
162 |     <ClInclude Include="..\..\src\buffer.h" />
163 |     <ClInclude Include="..\..\src\HDE\hde32.h" />
164 |     <ClInclude Include="..\..\src\HDE\hde64.h" />
165 |     <ClInclude Include="..\..\src\HDE\pstdint.h" />
166 |     <ClInclude Include="..\..\src\HDE\table32.h" />
167 |     <ClInclude Include="..\..\src\HDE\table64.h" />
168 |     <ClInclude Include="..\..\src\trampoline.h" />
169 |   </ItemGroup>
170 |   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
171 |   <ImportGroup Label="ExtensionTargets">
172 |   </ImportGroup>
173 | </Project>


--------------------------------------------------------------------------------
/build/VC12/libMinHook.vcxproj.filters:
--------------------------------------------------------------------------------
 1 | <?xml version="1.0" encoding="utf-8"?>
 2 | <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
 3 |   <ItemGroup>
 4 |     <ClCompile Include="..\..\src\buffer.c">
 5 |       <Filter>Source Files</Filter>
 6 |     </ClCompile>
 7 |     <ClCompile Include="..\..\src\hook.c">
 8 |       <Filter>Source Files</Filter>
 9 |     </ClCompile>
10 |     <ClCompile Include="..\..\src\trampoline.c">
11 |       <Filter>Source Files</Filter>
12 |     </ClCompile>
13 |     <ClCompile Include="..\..\src\HDE\hde32.c">
14 |       <Filter>HDE</Filter>
15 |     </ClCompile>
16 |     <ClCompile Include="..\..\src\HDE\hde64.c">
17 |       <Filter>HDE</Filter>
18 |     </ClCompile>
19 |   </ItemGroup>
20 |   <ItemGroup>
21 |     <ClInclude Include="..\..\src\trampoline.h">
22 |       <Filter>Header Files</Filter>
23 |     </ClInclude>
24 |     <ClInclude Include="..\..\src\buffer.h">
25 |       <Filter>Header Files</Filter>
26 |     </ClInclude>
27 |     <ClInclude Include="..\..\include\MinHook.h" />
28 |     <ClInclude Include="..\..\src\HDE\hde32.h">
29 |       <Filter>HDE</Filter>
30 |     </ClInclude>
31 |     <ClInclude Include="..\..\src\HDE\hde64.h">
32 |       <Filter>HDE</Filter>
33 |     </ClInclude>
34 |     <ClInclude Include="..\..\src\HDE\pstdint.h">
35 |       <Filter>HDE</Filter>
36 |     </ClInclude>
37 |     <ClInclude Include="..\..\src\HDE\table32.h">
38 |       <Filter>HDE</Filter>
39 |     </ClInclude>
40 |     <ClInclude Include="..\..\src\HDE\table64.h">
41 |       <Filter>HDE</Filter>
42 |     </ClInclude>
43 |   </ItemGroup>
44 |   <ItemGroup>
45 |     <Filter Include="Source Files">
46 |       <UniqueIdentifier>{9d24b740-be2e-4cfd-b9a4-340a50946ee9}</UniqueIdentifier>
47 |     </Filter>
48 |     <Filter Include="Header Files">
49 |       <UniqueIdentifier>{76381bc7-2863-4cc5-aede-926ec2c506e4}</UniqueIdentifier>
50 |     </Filter>
51 |     <Filter Include="HDE">
52 |       <UniqueIdentifier>{56ddb326-6179-430d-ae19-e13bfd767bfa}</UniqueIdentifier>
53 |     </Filter>
54 |   </ItemGroup>
55 | </Project>


--------------------------------------------------------------------------------
/build/VC14/MinHookVC14.sln:
--------------------------------------------------------------------------------
 1 | 
 2 | Microsoft Visual Studio Solution File, Format Version 12.00
 3 | # Visual Studio 14
 4 | VisualStudioVersion = 14.0.22823.1
 5 | MinimumVisualStudioVersion = 10.0.40219.1
 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libMinHook", "libMinHook.vcxproj", "{F142A341-5EE0-442D-A15F-98AE9B48DBAE}"
 7 | EndProject
 8 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MinHook", "MinHook.vcxproj", "{027FAC75-3FDB-4044-8DD0-BC297BD4C461}"
 9 | 	ProjectSection(ProjectDependencies) = postProject
10 | 		{F142A341-5EE0-442D-A15F-98AE9B48DBAE} = {F142A341-5EE0-442D-A15F-98AE9B48DBAE}
11 | 	EndProjectSection
12 | EndProject
13 | Global
14 | 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
15 | 		Debug|Win32 = Debug|Win32
16 | 		Debug|x64 = Debug|x64
17 | 		Release|Win32 = Release|Win32
18 | 		Release|x64 = Release|x64
19 | 	EndGlobalSection
20 | 	GlobalSection(ProjectConfigurationPlatforms) = postSolution
21 | 		{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Debug|Win32.ActiveCfg = Debug|Win32
22 | 		{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Debug|Win32.Build.0 = Debug|Win32
23 | 		{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Debug|x64.ActiveCfg = Debug|x64
24 | 		{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Debug|x64.Build.0 = Debug|x64
25 | 		{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Release|Win32.ActiveCfg = Release|Win32
26 | 		{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Release|Win32.Build.0 = Release|Win32
27 | 		{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Release|x64.ActiveCfg = Release|x64
28 | 		{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Release|x64.Build.0 = Release|x64
29 | 		{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Debug|Win32.ActiveCfg = Debug|Win32
30 | 		{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Debug|Win32.Build.0 = Debug|Win32
31 | 		{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Debug|x64.ActiveCfg = Debug|x64
32 | 		{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Debug|x64.Build.0 = Debug|x64
33 | 		{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Release|Win32.ActiveCfg = Release|Win32
34 | 		{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Release|Win32.Build.0 = Release|Win32
35 | 		{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Release|x64.ActiveCfg = Release|x64
36 | 		{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Release|x64.Build.0 = Release|x64
37 | 	EndGlobalSection
38 | 	GlobalSection(SolutionProperties) = preSolution
39 | 		HideSolutionNode = FALSE
40 | 	EndGlobalSection
41 | EndGlobal
42 | 


--------------------------------------------------------------------------------
/build/VC14/libMinHook.vcxproj:
--------------------------------------------------------------------------------
  1 | <?xml version="1.0" encoding="utf-8"?>
  2 | <Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  3 |   <ItemGroup Label="ProjectConfigurations">
  4 |     <ProjectConfiguration Include="Debug|Win32">
  5 |       <Configuration>Debug</Configuration>
  6 |       <Platform>Win32</Platform>
  7 |     </ProjectConfiguration>
  8 |     <ProjectConfiguration Include="Debug|x64">
  9 |       <Configuration>Debug</Configuration>
 10 |       <Platform>x64</Platform>
 11 |     </ProjectConfiguration>
 12 |     <ProjectConfiguration Include="Release|Win32">
 13 |       <Configuration>Release</Configuration>
 14 |       <Platform>Win32</Platform>
 15 |     </ProjectConfiguration>
 16 |     <ProjectConfiguration Include="Release|x64">
 17 |       <Configuration>Release</Configuration>
 18 |       <Platform>x64</Platform>
 19 |     </ProjectConfiguration>
 20 |   </ItemGroup>
 21 |   <PropertyGroup Label="Globals">
 22 |     <ProjectGuid>{F142A341-5EE0-442D-A15F-98AE9B48DBAE}</ProjectGuid>
 23 |     <RootNamespace>libMinHook</RootNamespace>
 24 |     <Keyword>Win32Proj</Keyword>
 25 |   </PropertyGroup>
 26 |   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
 27 |   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
 28 |     <ConfigurationType>StaticLibrary</ConfigurationType>
 29 |     <CharacterSet>Unicode</CharacterSet>
 30 |     <WholeProgramOptimization>true</WholeProgramOptimization>
 31 |     <PlatformToolset>v140_xp</PlatformToolset>
 32 |   </PropertyGroup>
 33 |   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
 34 |     <ConfigurationType>StaticLibrary</ConfigurationType>
 35 |     <CharacterSet>Unicode</CharacterSet>
 36 |     <PlatformToolset>v140_xp</PlatformToolset>
 37 |   </PropertyGroup>
 38 |   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
 39 |     <ConfigurationType>StaticLibrary</ConfigurationType>
 40 |     <CharacterSet>Unicode</CharacterSet>
 41 |     <WholeProgramOptimization>true</WholeProgramOptimization>
 42 |     <PlatformToolset>v140_xp</PlatformToolset>
 43 |   </PropertyGroup>
 44 |   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
 45 |     <ConfigurationType>StaticLibrary</ConfigurationType>
 46 |     <CharacterSet>Unicode</CharacterSet>
 47 |     <PlatformToolset>v140_xp</PlatformToolset>
 48 |   </PropertyGroup>
 49 |   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
 50 |   <ImportGroup Label="ExtensionSettings">
 51 |   </ImportGroup>
 52 |   <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
 53 |     <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
 54 |   </ImportGroup>
 55 |   <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
 56 |     <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
 57 |   </ImportGroup>
 58 |   <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
 59 |     <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
 60 |   </ImportGroup>
 61 |   <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
 62 |     <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
 63 |   </ImportGroup>
 64 |   <PropertyGroup Label="UserMacros" />
 65 |   <PropertyGroup>
 66 |     <_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
 67 |     <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)lib\$(Configuration)\</OutDir>
 68 |     <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
 69 |     <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)lib\$(Configuration)\</OutDir>
 70 |     <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
 71 |     <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)lib\$(Configuration)\</OutDir>
 72 |     <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
 73 |     <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)lib\$(Configuration)\</OutDir>
 74 |     <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
 75 |     <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectName).x86</TargetName>
 76 |     <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectName).x86</TargetName>
 77 |     <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(ProjectName).x64</TargetName>
 78 |     <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(ProjectName).x64</TargetName>
 79 |   </PropertyGroup>
 80 |   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
 81 |     <ClCompile>
 82 |       <Optimization>Disabled</Optimization>
 83 |       <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
 84 |       <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;STRICT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
 85 |       <MinimalRebuild>false</MinimalRebuild>
 86 |       <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
 87 |       <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
 88 |       <WarningLevel>Level3</WarningLevel>
 89 |       <DebugInformationFormat>None</DebugInformationFormat>
 90 |       <EnableEnhancedInstructionSet>NoExtensions</EnableEnhancedInstructionSet>
 91 |     </ClCompile>
 92 |     <Lib />
 93 |   </ItemDefinitionGroup>
 94 |   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
 95 |     <Midl>
 96 |       <TargetEnvironment>X64</TargetEnvironment>
 97 |     </Midl>
 98 |     <ClCompile>
 99 |       <Optimization>Disabled</Optimization>
100 |       <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
101 |       <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;STRICT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
102 |       <MinimalRebuild>false</MinimalRebuild>
103 |       <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
104 |       <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
105 |       <WarningLevel>Level3</WarningLevel>
106 |       <DebugInformationFormat>None</DebugInformationFormat>
107 |       <EnableEnhancedInstructionSet>NotSet</EnableEnhancedInstructionSet>
108 |     </ClCompile>
109 |     <Lib />
110 |   </ItemDefinitionGroup>
111 |   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
112 |     <ClCompile>
113 |       <Optimization>MinSpace</Optimization>
114 |       <IntrinsicFunctions>true</IntrinsicFunctions>
115 |       <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
116 |       <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;STRICT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
117 |       <MinimalRebuild>false</MinimalRebuild>
118 |       <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
119 |       <FunctionLevelLinking>true</FunctionLevelLinking>
120 |       <WarningLevel>Level3</WarningLevel>
121 |       <DebugInformationFormat>None</DebugInformationFormat>
122 |       <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
123 |       <WholeProgramOptimization>true</WholeProgramOptimization>
124 |       <EnableEnhancedInstructionSet>NoExtensions</EnableEnhancedInstructionSet>
125 |     </ClCompile>
126 |     <Lib />
127 |   </ItemDefinitionGroup>
128 |   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
129 |     <Midl>
130 |       <TargetEnvironment>X64</TargetEnvironment>
131 |     </Midl>
132 |     <ClCompile>
133 |       <Optimization>MinSpace</Optimization>
134 |       <IntrinsicFunctions>true</IntrinsicFunctions>
135 |       <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
136 |       <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;STRICT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
137 |       <MinimalRebuild>false</MinimalRebuild>
138 |       <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
139 |       <FunctionLevelLinking>true</FunctionLevelLinking>
140 |       <WarningLevel>Level3</WarningLevel>
141 |       <DebugInformationFormat>None</DebugInformationFormat>
142 |       <WholeProgramOptimization>true</WholeProgramOptimization>
143 |       <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
144 |     </ClCompile>
145 |     <Lib />
146 |   </ItemDefinitionGroup>
147 |   <ItemGroup>
148 |     <ClCompile Include="..\..\src\buffer.c" />
149 |     <ClCompile Include="..\..\src\HDE\hde32.c">
150 |       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
151 |       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
152 |     </ClCompile>
153 |     <ClCompile Include="..\..\src\HDE\hde64.c">
154 |       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
155 |       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
156 |     </ClCompile>
157 |     <ClCompile Include="..\..\src\hook.c" />
158 |     <ClCompile Include="..\..\src\trampoline.c" />
159 |   </ItemGroup>
160 |   <ItemGroup>
161 |     <ClInclude Include="..\..\include\MinHook.h" />
162 |     <ClInclude Include="..\..\src\buffer.h" />
163 |     <ClInclude Include="..\..\src\HDE\hde32.h" />
164 |     <ClInclude Include="..\..\src\HDE\hde64.h" />
165 |     <ClInclude Include="..\..\src\HDE\pstdint.h" />
166 |     <ClInclude Include="..\..\src\HDE\table32.h" />
167 |     <ClInclude Include="..\..\src\HDE\table64.h" />
168 |     <ClInclude Include="..\..\src\trampoline.h" />
169 |   </ItemGroup>
170 |   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
171 |   <ImportGroup Label="ExtensionTargets">
172 |   </ImportGroup>
173 | </Project>


--------------------------------------------------------------------------------
/build/VC14/libMinHook.vcxproj.filters:
--------------------------------------------------------------------------------
 1 | <?xml version="1.0" encoding="utf-8"?>
 2 | <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
 3 |   <ItemGroup>
 4 |     <ClCompile Include="..\..\src\buffer.c">
 5 |       <Filter>Source Files</Filter>
 6 |     </ClCompile>
 7 |     <ClCompile Include="..\..\src\hook.c">
 8 |       <Filter>Source Files</Filter>
 9 |     </ClCompile>
10 |     <ClCompile Include="..\..\src\trampoline.c">
11 |       <Filter>Source Files</Filter>
12 |     </ClCompile>
13 |     <ClCompile Include="..\..\src\HDE\hde32.c">
14 |       <Filter>HDE</Filter>
15 |     </ClCompile>
16 |     <ClCompile Include="..\..\src\HDE\hde64.c">
17 |       <Filter>HDE</Filter>
18 |     </ClCompile>
19 |   </ItemGroup>
20 |   <ItemGroup>
21 |     <ClInclude Include="..\..\src\trampoline.h">
22 |       <Filter>Header Files</Filter>
23 |     </ClInclude>
24 |     <ClInclude Include="..\..\src\buffer.h">
25 |       <Filter>Header Files</Filter>
26 |     </ClInclude>
27 |     <ClInclude Include="..\..\include\MinHook.h" />
28 |     <ClInclude Include="..\..\src\HDE\hde32.h">
29 |       <Filter>HDE</Filter>
30 |     </ClInclude>
31 |     <ClInclude Include="..\..\src\HDE\hde64.h">
32 |       <Filter>HDE</Filter>
33 |     </ClInclude>
34 |     <ClInclude Include="..\..\src\HDE\pstdint.h">
35 |       <Filter>HDE</Filter>
36 |     </ClInclude>
37 |     <ClInclude Include="..\..\src\HDE\table32.h">
38 |       <Filter>HDE</Filter>
39 |     </ClInclude>
40 |     <ClInclude Include="..\..\src\HDE\table64.h">
41 |       <Filter>HDE</Filter>
42 |     </ClInclude>
43 |   </ItemGroup>
44 |   <ItemGroup>
45 |     <Filter Include="Source Files">
46 |       <UniqueIdentifier>{9d24b740-be2e-4cfd-b9a4-340a50946ee9}</UniqueIdentifier>
47 |     </Filter>
48 |     <Filter Include="Header Files">
49 |       <UniqueIdentifier>{76381bc7-2863-4cc5-aede-926ec2c506e4}</UniqueIdentifier>
50 |     </Filter>
51 |     <Filter Include="HDE">
52 |       <UniqueIdentifier>{56ddb326-6179-430d-ae19-e13bfd767bfa}</UniqueIdentifier>
53 |     </Filter>
54 |   </ItemGroup>
55 | </Project>


--------------------------------------------------------------------------------
/build/VC15/MinHookVC15.sln:
--------------------------------------------------------------------------------
 1 | 
 2 | Microsoft Visual Studio Solution File, Format Version 12.00
 3 | # Visual Studio 15
 4 | VisualStudioVersion = 15.0.25123.0
 5 | MinimumVisualStudioVersion = 10.0.40219.1
 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libMinHook", "libMinHook.vcxproj", "{F142A341-5EE0-442D-A15F-98AE9B48DBAE}"
 7 | EndProject
 8 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MinHook", "MinHook.vcxproj", "{027FAC75-3FDB-4044-8DD0-BC297BD4C461}"
 9 | 	ProjectSection(ProjectDependencies) = postProject
10 | 		{F142A341-5EE0-442D-A15F-98AE9B48DBAE} = {F142A341-5EE0-442D-A15F-98AE9B48DBAE}
11 | 	EndProjectSection
12 | EndProject
13 | Global
14 | 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
15 | 		Debug|Win32 = Debug|Win32
16 | 		Debug|x64 = Debug|x64
17 | 		Release|Win32 = Release|Win32
18 | 		Release|x64 = Release|x64
19 | 	EndGlobalSection
20 | 	GlobalSection(ProjectConfigurationPlatforms) = postSolution
21 | 		{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Debug|Win32.ActiveCfg = Debug|Win32
22 | 		{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Debug|Win32.Build.0 = Debug|Win32
23 | 		{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Debug|x64.ActiveCfg = Debug|x64
24 | 		{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Debug|x64.Build.0 = Debug|x64
25 | 		{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Release|Win32.ActiveCfg = Release|Win32
26 | 		{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Release|Win32.Build.0 = Release|Win32
27 | 		{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Release|x64.ActiveCfg = Release|x64
28 | 		{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Release|x64.Build.0 = Release|x64
29 | 		{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Debug|Win32.ActiveCfg = Debug|Win32
30 | 		{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Debug|Win32.Build.0 = Debug|Win32
31 | 		{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Debug|x64.ActiveCfg = Debug|x64
32 | 		{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Debug|x64.Build.0 = Debug|x64
33 | 		{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Release|Win32.ActiveCfg = Release|Win32
34 | 		{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Release|Win32.Build.0 = Release|Win32
35 | 		{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Release|x64.ActiveCfg = Release|x64
36 | 		{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Release|x64.Build.0 = Release|x64
37 | 	EndGlobalSection
38 | 	GlobalSection(SolutionProperties) = preSolution
39 | 		HideSolutionNode = FALSE
40 | 	EndGlobalSection
41 | EndGlobal
42 | 


--------------------------------------------------------------------------------
/build/VC15/libMinHook.vcxproj:
--------------------------------------------------------------------------------
  1 | <?xml version="1.0" encoding="utf-8"?>
  2 | <Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  3 |   <ItemGroup Label="ProjectConfigurations">
  4 |     <ProjectConfiguration Include="Debug|Win32">
  5 |       <Configuration>Debug</Configuration>
  6 |       <Platform>Win32</Platform>
  7 |     </ProjectConfiguration>
  8 |     <ProjectConfiguration Include="Debug|x64">
  9 |       <Configuration>Debug</Configuration>
 10 |       <Platform>x64</Platform>
 11 |     </ProjectConfiguration>
 12 |     <ProjectConfiguration Include="Release|Win32">
 13 |       <Configuration>Release</Configuration>
 14 |       <Platform>Win32</Platform>
 15 |     </ProjectConfiguration>
 16 |     <ProjectConfiguration Include="Release|x64">
 17 |       <Configuration>Release</Configuration>
 18 |       <Platform>x64</Platform>
 19 |     </ProjectConfiguration>
 20 |   </ItemGroup>
 21 |   <PropertyGroup Label="Globals">
 22 |     <ProjectGuid>{F142A341-5EE0-442D-A15F-98AE9B48DBAE}</ProjectGuid>
 23 |     <RootNamespace>libMinHook</RootNamespace>
 24 |     <Keyword>Win32Proj</Keyword>
 25 |   </PropertyGroup>
 26 |   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
 27 |   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
 28 |     <ConfigurationType>StaticLibrary</ConfigurationType>
 29 |     <CharacterSet>Unicode</CharacterSet>
 30 |     <WholeProgramOptimization>true</WholeProgramOptimization>
 31 |     <PlatformToolset>v141_xp</PlatformToolset>
 32 |   </PropertyGroup>
 33 |   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
 34 |     <ConfigurationType>StaticLibrary</ConfigurationType>
 35 |     <CharacterSet>Unicode</CharacterSet>
 36 |     <PlatformToolset>v141_xp</PlatformToolset>
 37 |   </PropertyGroup>
 38 |   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
 39 |     <ConfigurationType>StaticLibrary</ConfigurationType>
 40 |     <CharacterSet>Unicode</CharacterSet>
 41 |     <WholeProgramOptimization>true</WholeProgramOptimization>
 42 |     <PlatformToolset>v141_xp</PlatformToolset>
 43 |   </PropertyGroup>
 44 |   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
 45 |     <ConfigurationType>StaticLibrary</ConfigurationType>
 46 |     <CharacterSet>Unicode</CharacterSet>
 47 |     <PlatformToolset>v141_xp</PlatformToolset>
 48 |   </PropertyGroup>
 49 |   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
 50 |   <ImportGroup Label="ExtensionSettings">
 51 |   </ImportGroup>
 52 |   <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
 53 |     <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
 54 |   </ImportGroup>
 55 |   <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
 56 |     <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
 57 |   </ImportGroup>
 58 |   <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
 59 |     <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
 60 |   </ImportGroup>
 61 |   <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
 62 |     <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
 63 |   </ImportGroup>
 64 |   <PropertyGroup Label="UserMacros" />
 65 |   <PropertyGroup>
 66 |     <_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
 67 |     <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)lib\$(Configuration)\</OutDir>
 68 |     <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
 69 |     <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)lib\$(Configuration)\</OutDir>
 70 |     <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
 71 |     <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)lib\$(Configuration)\</OutDir>
 72 |     <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
 73 |     <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)lib\$(Configuration)\</OutDir>
 74 |     <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
 75 |     <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectName).x86</TargetName>
 76 |     <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectName).x86</TargetName>
 77 |     <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(ProjectName).x64</TargetName>
 78 |     <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(ProjectName).x64</TargetName>
 79 |   </PropertyGroup>
 80 |   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
 81 |     <ClCompile>
 82 |       <Optimization>Disabled</Optimization>
 83 |       <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
 84 |       <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;STRICT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
 85 |       <MinimalRebuild>false</MinimalRebuild>
 86 |       <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
 87 |       <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
 88 |       <WarningLevel>Level3</WarningLevel>
 89 |       <DebugInformationFormat>None</DebugInformationFormat>
 90 |       <EnableEnhancedInstructionSet>NoExtensions</EnableEnhancedInstructionSet>
 91 |     </ClCompile>
 92 |     <Lib />
 93 |   </ItemDefinitionGroup>
 94 |   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
 95 |     <Midl>
 96 |       <TargetEnvironment>X64</TargetEnvironment>
 97 |     </Midl>
 98 |     <ClCompile>
 99 |       <Optimization>Disabled</Optimization>
100 |       <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
101 |       <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;STRICT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
102 |       <MinimalRebuild>false</MinimalRebuild>
103 |       <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
104 |       <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
105 |       <WarningLevel>Level3</WarningLevel>
106 |       <DebugInformationFormat>None</DebugInformationFormat>
107 |       <EnableEnhancedInstructionSet>NotSet</EnableEnhancedInstructionSet>
108 |     </ClCompile>
109 |     <Lib />
110 |   </ItemDefinitionGroup>
111 |   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
112 |     <ClCompile>
113 |       <Optimization>MinSpace</Optimization>
114 |       <IntrinsicFunctions>true</IntrinsicFunctions>
115 |       <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
116 |       <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;STRICT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
117 |       <MinimalRebuild>false</MinimalRebuild>
118 |       <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
119 |       <FunctionLevelLinking>true</FunctionLevelLinking>
120 |       <WarningLevel>Level3</WarningLevel>
121 |       <DebugInformationFormat>None</DebugInformationFormat>
122 |       <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
123 |       <WholeProgramOptimization>true</WholeProgramOptimization>
124 |       <EnableEnhancedInstructionSet>NoExtensions</EnableEnhancedInstructionSet>
125 |     </ClCompile>
126 |     <Lib />
127 |   </ItemDefinitionGroup>
128 |   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
129 |     <Midl>
130 |       <TargetEnvironment>X64</TargetEnvironment>
131 |     </Midl>
132 |     <ClCompile>
133 |       <Optimization>MinSpace</Optimization>
134 |       <IntrinsicFunctions>true</IntrinsicFunctions>
135 |       <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
136 |       <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;STRICT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
137 |       <MinimalRebuild>false</MinimalRebuild>
138 |       <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
139 |       <FunctionLevelLinking>true</FunctionLevelLinking>
140 |       <WarningLevel>Level3</WarningLevel>
141 |       <DebugInformationFormat>None</DebugInformationFormat>
142 |       <WholeProgramOptimization>true</WholeProgramOptimization>
143 |       <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
144 |     </ClCompile>
145 |     <Lib />
146 |   </ItemDefinitionGroup>
147 |   <ItemGroup>
148 |     <ClCompile Include="..\..\src\buffer.c" />
149 |     <ClCompile Include="..\..\src\HDE\hde32.c">
150 |       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
151 |       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
152 |     </ClCompile>
153 |     <ClCompile Include="..\..\src\HDE\hde64.c">
154 |       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
155 |       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
156 |     </ClCompile>
157 |     <ClCompile Include="..\..\src\hook.c" />
158 |     <ClCompile Include="..\..\src\trampoline.c" />
159 |   </ItemGroup>
160 |   <ItemGroup>
161 |     <ClInclude Include="..\..\include\MinHook.h" />
162 |     <ClInclude Include="..\..\src\buffer.h" />
163 |     <ClInclude Include="..\..\src\HDE\hde32.h" />
164 |     <ClInclude Include="..\..\src\HDE\hde64.h" />
165 |     <ClInclude Include="..\..\src\HDE\pstdint.h" />
166 |     <ClInclude Include="..\..\src\HDE\table32.h" />
167 |     <ClInclude Include="..\..\src\HDE\table64.h" />
168 |     <ClInclude Include="..\..\src\trampoline.h" />
169 |   </ItemGroup>
170 |   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
171 |   <ImportGroup Label="ExtensionTargets">
172 |   </ImportGroup>
173 | </Project>
174 | 


--------------------------------------------------------------------------------
/build/VC15/libMinHook.vcxproj.filters:
--------------------------------------------------------------------------------
 1 | <?xml version="1.0" encoding="utf-8"?>
 2 | <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
 3 |   <ItemGroup>
 4 |     <ClCompile Include="..\..\src\buffer.c">
 5 |       <Filter>Source Files</Filter>
 6 |     </ClCompile>
 7 |     <ClCompile Include="..\..\src\hook.c">
 8 |       <Filter>Source Files</Filter>
 9 |     </ClCompile>
10 |     <ClCompile Include="..\..\src\trampoline.c">
11 |       <Filter>Source Files</Filter>
12 |     </ClCompile>
13 |     <ClCompile Include="..\..\src\HDE\hde32.c">
14 |       <Filter>HDE</Filter>
15 |     </ClCompile>
16 |     <ClCompile Include="..\..\src\HDE\hde64.c">
17 |       <Filter>HDE</Filter>
18 |     </ClCompile>
19 |   </ItemGroup>
20 |   <ItemGroup>
21 |     <ClInclude Include="..\..\src\trampoline.h">
22 |       <Filter>Header Files</Filter>
23 |     </ClInclude>
24 |     <ClInclude Include="..\..\src\buffer.h">
25 |       <Filter>Header Files</Filter>
26 |     </ClInclude>
27 |     <ClInclude Include="..\..\include\MinHook.h" />
28 |     <ClInclude Include="..\..\src\HDE\hde32.h">
29 |       <Filter>HDE</Filter>
30 |     </ClInclude>
31 |     <ClInclude Include="..\..\src\HDE\hde64.h">
32 |       <Filter>HDE</Filter>
33 |     </ClInclude>
34 |     <ClInclude Include="..\..\src\HDE\pstdint.h">
35 |       <Filter>HDE</Filter>
36 |     </ClInclude>
37 |     <ClInclude Include="..\..\src\HDE\table32.h">
38 |       <Filter>HDE</Filter>
39 |     </ClInclude>
40 |     <ClInclude Include="..\..\src\HDE\table64.h">
41 |       <Filter>HDE</Filter>
42 |     </ClInclude>
43 |   </ItemGroup>
44 |   <ItemGroup>
45 |     <Filter Include="Source Files">
46 |       <UniqueIdentifier>{9d24b740-be2e-4cfd-b9a4-340a50946ee9}</UniqueIdentifier>
47 |     </Filter>
48 |     <Filter Include="Header Files">
49 |       <UniqueIdentifier>{76381bc7-2863-4cc5-aede-926ec2c506e4}</UniqueIdentifier>
50 |     </Filter>
51 |     <Filter Include="HDE">
52 |       <UniqueIdentifier>{56ddb326-6179-430d-ae19-e13bfd767bfa}</UniqueIdentifier>
53 |     </Filter>
54 |   </ItemGroup>
55 | </Project>


--------------------------------------------------------------------------------
/build/VC16/MinHookVC16.sln:
--------------------------------------------------------------------------------
 1 | 
 2 | Microsoft Visual Studio Solution File, Format Version 12.00
 3 | # Visual Studio Version 16
 4 | VisualStudioVersion = 16.0.28803.352
 5 | MinimumVisualStudioVersion = 10.0.40219.1
 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libMinHook", "libMinHook.vcxproj", "{F142A341-5EE0-442D-A15F-98AE9B48DBAE}"
 7 | EndProject
 8 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MinHook", "MinHook.vcxproj", "{027FAC75-3FDB-4044-8DD0-BC297BD4C461}"
 9 | 	ProjectSection(ProjectDependencies) = postProject
10 | 		{F142A341-5EE0-442D-A15F-98AE9B48DBAE} = {F142A341-5EE0-442D-A15F-98AE9B48DBAE}
11 | 	EndProjectSection
12 | EndProject
13 | Global
14 | 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
15 | 		Debug|Win32 = Debug|Win32
16 | 		Debug|x64 = Debug|x64
17 | 		Release|Win32 = Release|Win32
18 | 		Release|x64 = Release|x64
19 | 	EndGlobalSection
20 | 	GlobalSection(ProjectConfigurationPlatforms) = postSolution
21 | 		{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Debug|Win32.ActiveCfg = Debug|Win32
22 | 		{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Debug|Win32.Build.0 = Debug|Win32
23 | 		{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Debug|x64.ActiveCfg = Debug|x64
24 | 		{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Debug|x64.Build.0 = Debug|x64
25 | 		{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Release|Win32.ActiveCfg = Release|Win32
26 | 		{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Release|Win32.Build.0 = Release|Win32
27 | 		{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Release|x64.ActiveCfg = Release|x64
28 | 		{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Release|x64.Build.0 = Release|x64
29 | 		{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Debug|Win32.ActiveCfg = Debug|Win32
30 | 		{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Debug|Win32.Build.0 = Debug|Win32
31 | 		{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Debug|x64.ActiveCfg = Debug|x64
32 | 		{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Debug|x64.Build.0 = Debug|x64
33 | 		{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Release|Win32.ActiveCfg = Release|Win32
34 | 		{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Release|Win32.Build.0 = Release|Win32
35 | 		{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Release|x64.ActiveCfg = Release|x64
36 | 		{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Release|x64.Build.0 = Release|x64
37 | 	EndGlobalSection
38 | 	GlobalSection(SolutionProperties) = preSolution
39 | 		HideSolutionNode = FALSE
40 | 	EndGlobalSection
41 | EndGlobal
42 | 


--------------------------------------------------------------------------------
/build/VC16/libMinHook.vcxproj:
--------------------------------------------------------------------------------
  1 | <?xml version="1.0" encoding="utf-8"?>
  2 | <Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  3 |   <ItemGroup Label="ProjectConfigurations">
  4 |     <ProjectConfiguration Include="Debug|Win32">
  5 |       <Configuration>Debug</Configuration>
  6 |       <Platform>Win32</Platform>
  7 |     </ProjectConfiguration>
  8 |     <ProjectConfiguration Include="Debug|x64">
  9 |       <Configuration>Debug</Configuration>
 10 |       <Platform>x64</Platform>
 11 |     </ProjectConfiguration>
 12 |     <ProjectConfiguration Include="Release|Win32">
 13 |       <Configuration>Release</Configuration>
 14 |       <Platform>Win32</Platform>
 15 |     </ProjectConfiguration>
 16 |     <ProjectConfiguration Include="Release|x64">
 17 |       <Configuration>Release</Configuration>
 18 |       <Platform>x64</Platform>
 19 |     </ProjectConfiguration>
 20 |   </ItemGroup>
 21 |   <PropertyGroup Label="Globals">
 22 |     <ProjectGuid>{F142A341-5EE0-442D-A15F-98AE9B48DBAE}</ProjectGuid>
 23 |     <RootNamespace>libMinHook</RootNamespace>
 24 |     <Keyword>Win32Proj</Keyword>
 25 |   </PropertyGroup>
 26 |   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
 27 |   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
 28 |     <ConfigurationType>StaticLibrary</ConfigurationType>
 29 |     <CharacterSet>Unicode</CharacterSet>
 30 |     <WholeProgramOptimization>true</WholeProgramOptimization>
 31 |     <PlatformToolset>v142</PlatformToolset>
 32 |   </PropertyGroup>
 33 |   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
 34 |     <ConfigurationType>StaticLibrary</ConfigurationType>
 35 |     <CharacterSet>Unicode</CharacterSet>
 36 |     <PlatformToolset>v142</PlatformToolset>
 37 |   </PropertyGroup>
 38 |   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
 39 |     <ConfigurationType>StaticLibrary</ConfigurationType>
 40 |     <CharacterSet>Unicode</CharacterSet>
 41 |     <WholeProgramOptimization>true</WholeProgramOptimization>
 42 |     <PlatformToolset>v142</PlatformToolset>
 43 |   </PropertyGroup>
 44 |   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
 45 |     <ConfigurationType>StaticLibrary</ConfigurationType>
 46 |     <CharacterSet>Unicode</CharacterSet>
 47 |     <PlatformToolset>v142</PlatformToolset>
 48 |   </PropertyGroup>
 49 |   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
 50 |   <ImportGroup Label="ExtensionSettings">
 51 |   </ImportGroup>
 52 |   <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
 53 |     <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
 54 |   </ImportGroup>
 55 |   <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
 56 |     <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
 57 |   </ImportGroup>
 58 |   <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
 59 |     <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
 60 |   </ImportGroup>
 61 |   <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
 62 |     <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
 63 |   </ImportGroup>
 64 |   <PropertyGroup Label="UserMacros" />
 65 |   <PropertyGroup>
 66 |     <_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
 67 |     <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)lib\$(Configuration)\</OutDir>
 68 |     <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
 69 |     <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)lib\$(Configuration)\</OutDir>
 70 |     <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
 71 |     <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)lib\$(Configuration)\</OutDir>
 72 |     <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
 73 |     <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)lib\$(Configuration)\</OutDir>
 74 |     <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
 75 |     <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectName).x86</TargetName>
 76 |     <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectName).x86</TargetName>
 77 |     <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(ProjectName).x64</TargetName>
 78 |     <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(ProjectName).x64</TargetName>
 79 |   </PropertyGroup>
 80 |   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
 81 |     <ClCompile>
 82 |       <Optimization>Disabled</Optimization>
 83 |       <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
 84 |       <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;STRICT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
 85 |       <MinimalRebuild>false</MinimalRebuild>
 86 |       <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
 87 |       <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
 88 |       <WarningLevel>Level3</WarningLevel>
 89 |       <DebugInformationFormat>None</DebugInformationFormat>
 90 |       <EnableEnhancedInstructionSet>NoExtensions</EnableEnhancedInstructionSet>
 91 |     </ClCompile>
 92 |     <Lib />
 93 |   </ItemDefinitionGroup>
 94 |   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
 95 |     <Midl>
 96 |       <TargetEnvironment>X64</TargetEnvironment>
 97 |     </Midl>
 98 |     <ClCompile>
 99 |       <Optimization>Disabled</Optimization>
100 |       <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
101 |       <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;STRICT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
102 |       <MinimalRebuild>false</MinimalRebuild>
103 |       <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
104 |       <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
105 |       <WarningLevel>Level3</WarningLevel>
106 |       <DebugInformationFormat>None</DebugInformationFormat>
107 |       <EnableEnhancedInstructionSet>NotSet</EnableEnhancedInstructionSet>
108 |     </ClCompile>
109 |     <Lib />
110 |   </ItemDefinitionGroup>
111 |   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
112 |     <ClCompile>
113 |       <Optimization>MinSpace</Optimization>
114 |       <IntrinsicFunctions>true</IntrinsicFunctions>
115 |       <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
116 |       <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;STRICT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
117 |       <MinimalRebuild>false</MinimalRebuild>
118 |       <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
119 |       <FunctionLevelLinking>true</FunctionLevelLinking>
120 |       <WarningLevel>Level3</WarningLevel>
121 |       <DebugInformationFormat>None</DebugInformationFormat>
122 |       <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
123 |       <WholeProgramOptimization>true</WholeProgramOptimization>
124 |       <EnableEnhancedInstructionSet>NoExtensions</EnableEnhancedInstructionSet>
125 |     </ClCompile>
126 |     <Lib />
127 |   </ItemDefinitionGroup>
128 |   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
129 |     <Midl>
130 |       <TargetEnvironment>X64</TargetEnvironment>
131 |     </Midl>
132 |     <ClCompile>
133 |       <Optimization>MinSpace</Optimization>
134 |       <IntrinsicFunctions>true</IntrinsicFunctions>
135 |       <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
136 |       <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;STRICT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
137 |       <MinimalRebuild>false</MinimalRebuild>
138 |       <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
139 |       <FunctionLevelLinking>true</FunctionLevelLinking>
140 |       <WarningLevel>Level3</WarningLevel>
141 |       <DebugInformationFormat>None</DebugInformationFormat>
142 |       <WholeProgramOptimization>true</WholeProgramOptimization>
143 |       <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
144 |     </ClCompile>
145 |     <Lib />
146 |   </ItemDefinitionGroup>
147 |   <ItemGroup>
148 |     <ClCompile Include="..\..\src\buffer.c" />
149 |     <ClCompile Include="..\..\src\HDE\hde32.c">
150 |       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
151 |       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
152 |     </ClCompile>
153 |     <ClCompile Include="..\..\src\HDE\hde64.c">
154 |       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
155 |       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
156 |     </ClCompile>
157 |     <ClCompile Include="..\..\src\hook.c" />
158 |     <ClCompile Include="..\..\src\trampoline.c" />
159 |   </ItemGroup>
160 |   <ItemGroup>
161 |     <ClInclude Include="..\..\include\MinHook.h" />
162 |     <ClInclude Include="..\..\src\buffer.h" />
163 |     <ClInclude Include="..\..\src\HDE\hde32.h" />
164 |     <ClInclude Include="..\..\src\HDE\hde64.h" />
165 |     <ClInclude Include="..\..\src\HDE\pstdint.h" />
166 |     <ClInclude Include="..\..\src\HDE\table32.h" />
167 |     <ClInclude Include="..\..\src\HDE\table64.h" />
168 |     <ClInclude Include="..\..\src\trampoline.h" />
169 |   </ItemGroup>
170 |   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
171 |   <ImportGroup Label="ExtensionTargets">
172 |   </ImportGroup>
173 | </Project>


--------------------------------------------------------------------------------
/build/VC16/libMinHook.vcxproj.filters:
--------------------------------------------------------------------------------
 1 | <?xml version="1.0" encoding="utf-8"?>
 2 | <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
 3 |   <ItemGroup>
 4 |     <ClCompile Include="..\..\src\buffer.c">
 5 |       <Filter>Source Files</Filter>
 6 |     </ClCompile>
 7 |     <ClCompile Include="..\..\src\hook.c">
 8 |       <Filter>Source Files</Filter>
 9 |     </ClCompile>
10 |     <ClCompile Include="..\..\src\trampoline.c">
11 |       <Filter>Source Files</Filter>
12 |     </ClCompile>
13 |     <ClCompile Include="..\..\src\HDE\hde32.c">
14 |       <Filter>HDE</Filter>
15 |     </ClCompile>
16 |     <ClCompile Include="..\..\src\HDE\hde64.c">
17 |       <Filter>HDE</Filter>
18 |     </ClCompile>
19 |   </ItemGroup>
20 |   <ItemGroup>
21 |     <ClInclude Include="..\..\src\trampoline.h">
22 |       <Filter>Header Files</Filter>
23 |     </ClInclude>
24 |     <ClInclude Include="..\..\src\buffer.h">
25 |       <Filter>Header Files</Filter>
26 |     </ClInclude>
27 |     <ClInclude Include="..\..\include\MinHook.h" />
28 |     <ClInclude Include="..\..\src\HDE\hde32.h">
29 |       <Filter>HDE</Filter>
30 |     </ClInclude>
31 |     <ClInclude Include="..\..\src\HDE\hde64.h">
32 |       <Filter>HDE</Filter>
33 |     </ClInclude>
34 |     <ClInclude Include="..\..\src\HDE\pstdint.h">
35 |       <Filter>HDE</Filter>
36 |     </ClInclude>
37 |     <ClInclude Include="..\..\src\HDE\table32.h">
38 |       <Filter>HDE</Filter>
39 |     </ClInclude>
40 |     <ClInclude Include="..\..\src\HDE\table64.h">
41 |       <Filter>HDE</Filter>
42 |     </ClInclude>
43 |   </ItemGroup>
44 |   <ItemGroup>
45 |     <Filter Include="Source Files">
46 |       <UniqueIdentifier>{9d24b740-be2e-4cfd-b9a4-340a50946ee9}</UniqueIdentifier>
47 |     </Filter>
48 |     <Filter Include="Header Files">
49 |       <UniqueIdentifier>{76381bc7-2863-4cc5-aede-926ec2c506e4}</UniqueIdentifier>
50 |     </Filter>
51 |     <Filter Include="HDE">
52 |       <UniqueIdentifier>{56ddb326-6179-430d-ae19-e13bfd767bfa}</UniqueIdentifier>
53 |     </Filter>
54 |   </ItemGroup>
55 | </Project>


--------------------------------------------------------------------------------
/build/VC17/MinHookVC17.sln:
--------------------------------------------------------------------------------
 1 | 
 2 | Microsoft Visual Studio Solution File, Format Version 12.00
 3 | # Visual Studio Version 17
 4 | VisualStudioVersion = 17.3.32901.215
 5 | MinimumVisualStudioVersion = 10.0.40219.1
 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libMinHook", "libMinHook.vcxproj", "{F142A341-5EE0-442D-A15F-98AE9B48DBAE}"
 7 | EndProject
 8 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MinHook", "MinHook.vcxproj", "{027FAC75-3FDB-4044-8DD0-BC297BD4C461}"
 9 | 	ProjectSection(ProjectDependencies) = postProject
10 | 		{F142A341-5EE0-442D-A15F-98AE9B48DBAE} = {F142A341-5EE0-442D-A15F-98AE9B48DBAE}
11 | 	EndProjectSection
12 | EndProject
13 | Global
14 | 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
15 | 		Debug|Win32 = Debug|Win32
16 | 		Debug|x64 = Debug|x64
17 | 		Release|Win32 = Release|Win32
18 | 		Release|x64 = Release|x64
19 | 	EndGlobalSection
20 | 	GlobalSection(ProjectConfigurationPlatforms) = postSolution
21 | 		{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Debug|Win32.ActiveCfg = Debug|Win32
22 | 		{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Debug|Win32.Build.0 = Debug|Win32
23 | 		{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Debug|x64.ActiveCfg = Debug|x64
24 | 		{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Debug|x64.Build.0 = Debug|x64
25 | 		{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Release|Win32.ActiveCfg = Release|Win32
26 | 		{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Release|Win32.Build.0 = Release|Win32
27 | 		{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Release|x64.ActiveCfg = Release|x64
28 | 		{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Release|x64.Build.0 = Release|x64
29 | 		{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Debug|Win32.ActiveCfg = Debug|Win32
30 | 		{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Debug|Win32.Build.0 = Debug|Win32
31 | 		{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Debug|x64.ActiveCfg = Debug|x64
32 | 		{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Debug|x64.Build.0 = Debug|x64
33 | 		{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Release|Win32.ActiveCfg = Release|Win32
34 | 		{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Release|Win32.Build.0 = Release|Win32
35 | 		{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Release|x64.ActiveCfg = Release|x64
36 | 		{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Release|x64.Build.0 = Release|x64
37 | 	EndGlobalSection
38 | 	GlobalSection(SolutionProperties) = preSolution
39 | 		HideSolutionNode = FALSE
40 | 	EndGlobalSection
41 | EndGlobal
42 | 


--------------------------------------------------------------------------------
/build/VC17/libMinHook.vcxproj:
--------------------------------------------------------------------------------
  1 | <?xml version="1.0" encoding="utf-8"?>
  2 | <Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  3 |   <ItemGroup Label="ProjectConfigurations">
  4 |     <ProjectConfiguration Include="Debug|Win32">
  5 |       <Configuration>Debug</Configuration>
  6 |       <Platform>Win32</Platform>
  7 |     </ProjectConfiguration>
  8 |     <ProjectConfiguration Include="Debug|x64">
  9 |       <Configuration>Debug</Configuration>
 10 |       <Platform>x64</Platform>
 11 |     </ProjectConfiguration>
 12 |     <ProjectConfiguration Include="Release|Win32">
 13 |       <Configuration>Release</Configuration>
 14 |       <Platform>Win32</Platform>
 15 |     </ProjectConfiguration>
 16 |     <ProjectConfiguration Include="Release|x64">
 17 |       <Configuration>Release</Configuration>
 18 |       <Platform>x64</Platform>
 19 |     </ProjectConfiguration>
 20 |   </ItemGroup>
 21 |   <PropertyGroup Label="Globals">
 22 |     <ProjectGuid>{F142A341-5EE0-442D-A15F-98AE9B48DBAE}</ProjectGuid>
 23 |     <RootNamespace>libMinHook</RootNamespace>
 24 |     <Keyword>Win32Proj</Keyword>
 25 |     <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
 26 |   </PropertyGroup>
 27 |   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
 28 |   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
 29 |     <ConfigurationType>StaticLibrary</ConfigurationType>
 30 |     <CharacterSet>Unicode</CharacterSet>
 31 |     <WholeProgramOptimization>true</WholeProgramOptimization>
 32 |     <PlatformToolset>v143</PlatformToolset>
 33 |   </PropertyGroup>
 34 |   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
 35 |     <ConfigurationType>StaticLibrary</ConfigurationType>
 36 |     <CharacterSet>Unicode</CharacterSet>
 37 |     <PlatformToolset>v143</PlatformToolset>
 38 |   </PropertyGroup>
 39 |   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
 40 |     <ConfigurationType>StaticLibrary</ConfigurationType>
 41 |     <CharacterSet>Unicode</CharacterSet>
 42 |     <WholeProgramOptimization>true</WholeProgramOptimization>
 43 |     <PlatformToolset>v143</PlatformToolset>
 44 |   </PropertyGroup>
 45 |   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
 46 |     <ConfigurationType>StaticLibrary</ConfigurationType>
 47 |     <CharacterSet>Unicode</CharacterSet>
 48 |     <PlatformToolset>v143</PlatformToolset>
 49 |   </PropertyGroup>
 50 |   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
 51 |   <ImportGroup Label="ExtensionSettings">
 52 |   </ImportGroup>
 53 |   <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
 54 |     <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
 55 |   </ImportGroup>
 56 |   <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
 57 |     <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
 58 |   </ImportGroup>
 59 |   <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
 60 |     <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
 61 |   </ImportGroup>
 62 |   <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
 63 |     <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
 64 |   </ImportGroup>
 65 |   <PropertyGroup Label="UserMacros" />
 66 |   <PropertyGroup>
 67 |     <_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
 68 |     <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)lib\$(Configuration)\</OutDir>
 69 |     <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
 70 |     <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)lib\$(Configuration)\</OutDir>
 71 |     <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
 72 |     <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)lib\$(Configuration)\</OutDir>
 73 |     <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
 74 |     <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)lib\$(Configuration)\</OutDir>
 75 |     <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
 76 |     <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectName).x86</TargetName>
 77 |     <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectName).x86</TargetName>
 78 |     <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(ProjectName).x64</TargetName>
 79 |     <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(ProjectName).x64</TargetName>
 80 |   </PropertyGroup>
 81 |   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
 82 |     <ClCompile>
 83 |       <Optimization>Disabled</Optimization>
 84 |       <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
 85 |       <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;STRICT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
 86 |       <MinimalRebuild>false</MinimalRebuild>
 87 |       <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
 88 |       <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
 89 |       <WarningLevel>Level3</WarningLevel>
 90 |       <DebugInformationFormat>None</DebugInformationFormat>
 91 |       <EnableEnhancedInstructionSet>NoExtensions</EnableEnhancedInstructionSet>
 92 |     </ClCompile>
 93 |     <Lib />
 94 |   </ItemDefinitionGroup>
 95 |   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
 96 |     <Midl>
 97 |       <TargetEnvironment>X64</TargetEnvironment>
 98 |     </Midl>
 99 |     <ClCompile>
100 |       <Optimization>Disabled</Optimization>
101 |       <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
102 |       <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;STRICT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
103 |       <MinimalRebuild>false</MinimalRebuild>
104 |       <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
105 |       <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
106 |       <WarningLevel>Level3</WarningLevel>
107 |       <DebugInformationFormat>None</DebugInformationFormat>
108 |       <EnableEnhancedInstructionSet>NotSet</EnableEnhancedInstructionSet>
109 |     </ClCompile>
110 |     <Lib />
111 |   </ItemDefinitionGroup>
112 |   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
113 |     <ClCompile>
114 |       <Optimization>MinSpace</Optimization>
115 |       <IntrinsicFunctions>true</IntrinsicFunctions>
116 |       <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
117 |       <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;STRICT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
118 |       <MinimalRebuild>false</MinimalRebuild>
119 |       <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
120 |       <FunctionLevelLinking>true</FunctionLevelLinking>
121 |       <WarningLevel>Level3</WarningLevel>
122 |       <DebugInformationFormat>None</DebugInformationFormat>
123 |       <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
124 |       <WholeProgramOptimization>true</WholeProgramOptimization>
125 |       <EnableEnhancedInstructionSet>NoExtensions</EnableEnhancedInstructionSet>
126 |     </ClCompile>
127 |     <Lib />
128 |   </ItemDefinitionGroup>
129 |   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
130 |     <Midl>
131 |       <TargetEnvironment>X64</TargetEnvironment>
132 |     </Midl>
133 |     <ClCompile>
134 |       <Optimization>MinSpace</Optimization>
135 |       <IntrinsicFunctions>true</IntrinsicFunctions>
136 |       <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
137 |       <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;STRICT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
138 |       <MinimalRebuild>false</MinimalRebuild>
139 |       <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
140 |       <FunctionLevelLinking>true</FunctionLevelLinking>
141 |       <WarningLevel>Level3</WarningLevel>
142 |       <DebugInformationFormat>None</DebugInformationFormat>
143 |       <WholeProgramOptimization>true</WholeProgramOptimization>
144 |       <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
145 |     </ClCompile>
146 |     <Lib />
147 |   </ItemDefinitionGroup>
148 |   <ItemGroup>
149 |     <ClCompile Include="..\..\src\buffer.c" />
150 |     <ClCompile Include="..\..\src\HDE\hde32.c">
151 |       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
152 |       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
153 |     </ClCompile>
154 |     <ClCompile Include="..\..\src\HDE\hde64.c">
155 |       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
156 |       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
157 |     </ClCompile>
158 |     <ClCompile Include="..\..\src\hook.c" />
159 |     <ClCompile Include="..\..\src\trampoline.c" />
160 |   </ItemGroup>
161 |   <ItemGroup>
162 |     <ClInclude Include="..\..\include\MinHook.h" />
163 |     <ClInclude Include="..\..\src\buffer.h" />
164 |     <ClInclude Include="..\..\src\HDE\hde32.h" />
165 |     <ClInclude Include="..\..\src\HDE\hde64.h" />
166 |     <ClInclude Include="..\..\src\HDE\pstdint.h" />
167 |     <ClInclude Include="..\..\src\HDE\table32.h" />
168 |     <ClInclude Include="..\..\src\HDE\table64.h" />
169 |     <ClInclude Include="..\..\src\trampoline.h" />
170 |   </ItemGroup>
171 |   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
172 |   <ImportGroup Label="ExtensionTargets">
173 |   </ImportGroup>
174 | </Project>


--------------------------------------------------------------------------------
/build/VC17/libMinHook.vcxproj.filters:
--------------------------------------------------------------------------------
 1 | <?xml version="1.0" encoding="utf-8"?>
 2 | <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
 3 |   <ItemGroup>
 4 |     <ClCompile Include="..\..\src\buffer.c">
 5 |       <Filter>Source Files</Filter>
 6 |     </ClCompile>
 7 |     <ClCompile Include="..\..\src\hook.c">
 8 |       <Filter>Source Files</Filter>
 9 |     </ClCompile>
10 |     <ClCompile Include="..\..\src\trampoline.c">
11 |       <Filter>Source Files</Filter>
12 |     </ClCompile>
13 |     <ClCompile Include="..\..\src\HDE\hde32.c">
14 |       <Filter>HDE</Filter>
15 |     </ClCompile>
16 |     <ClCompile Include="..\..\src\HDE\hde64.c">
17 |       <Filter>HDE</Filter>
18 |     </ClCompile>
19 |   </ItemGroup>
20 |   <ItemGroup>
21 |     <ClInclude Include="..\..\src\trampoline.h">
22 |       <Filter>Header Files</Filter>
23 |     </ClInclude>
24 |     <ClInclude Include="..\..\src\buffer.h">
25 |       <Filter>Header Files</Filter>
26 |     </ClInclude>
27 |     <ClInclude Include="..\..\include\MinHook.h" />
28 |     <ClInclude Include="..\..\src\HDE\hde32.h">
29 |       <Filter>HDE</Filter>
30 |     </ClInclude>
31 |     <ClInclude Include="..\..\src\HDE\hde64.h">
32 |       <Filter>HDE</Filter>
33 |     </ClInclude>
34 |     <ClInclude Include="..\..\src\HDE\pstdint.h">
35 |       <Filter>HDE</Filter>
36 |     </ClInclude>
37 |     <ClInclude Include="..\..\src\HDE\table32.h">
38 |       <Filter>HDE</Filter>
39 |     </ClInclude>
40 |     <ClInclude Include="..\..\src\HDE\table64.h">
41 |       <Filter>HDE</Filter>
42 |     </ClInclude>
43 |   </ItemGroup>
44 |   <ItemGroup>
45 |     <Filter Include="Source Files">
46 |       <UniqueIdentifier>{9d24b740-be2e-4cfd-b9a4-340a50946ee9}</UniqueIdentifier>
47 |     </Filter>
48 |     <Filter Include="Header Files">
49 |       <UniqueIdentifier>{76381bc7-2863-4cc5-aede-926ec2c506e4}</UniqueIdentifier>
50 |     </Filter>
51 |     <Filter Include="HDE">
52 |       <UniqueIdentifier>{56ddb326-6179-430d-ae19-e13bfd767bfa}</UniqueIdentifier>
53 |     </Filter>
54 |   </ItemGroup>
55 | </Project>


--------------------------------------------------------------------------------
/build/VC9/MinHook.vcproj:
--------------------------------------------------------------------------------
  1 | <?xml version="1.0" encoding="shift_jis"?>
  2 | <VisualStudioProject
  3 | 	ProjectType="Visual C++"
  4 | 	Version="9.00"
  5 | 	Name="MinHook"
  6 | 	ProjectGUID="{027FAC75-3FDB-4044-8DD0-BC297BD4C461}"
  7 | 	RootNamespace="MinHook"
  8 | 	Keyword="Win32Proj"
  9 | 	TargetFrameworkVersion="196613"
 10 | 	>
 11 | 	<Platforms>
 12 | 		<Platform
 13 | 			Name="Win32"
 14 | 		/>
 15 | 		<Platform
 16 | 			Name="x64"
 17 | 		/>
 18 | 	</Platforms>
 19 | 	<ToolFiles>
 20 | 	</ToolFiles>
 21 | 	<Configurations>
 22 | 		<Configuration
 23 | 			Name="Debug|Win32"
 24 | 			OutputDirectory="$(SolutionDir)bin\$(ConfigurationName)"
 25 | 			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)\$(ProjectName)"
 26 | 			ConfigurationType="2"
 27 | 			CharacterSet="1"
 28 | 			>
 29 | 			<Tool
 30 | 				Name="VCPreBuildEventTool"
 31 | 			/>
 32 | 			<Tool
 33 | 				Name="VCCustomBuildTool"
 34 | 			/>
 35 | 			<Tool
 36 | 				Name="VCXMLDataGeneratorTool"
 37 | 			/>
 38 | 			<Tool
 39 | 				Name="VCWebServiceProxyGeneratorTool"
 40 | 			/>
 41 | 			<Tool
 42 | 				Name="VCMIDLTool"
 43 | 			/>
 44 | 			<Tool
 45 | 				Name="VCCLCompilerTool"
 46 | 				Optimization="0"
 47 | 				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;MINHOOK_EXPORTS"
 48 | 				MinimalRebuild="false"
 49 | 				BasicRuntimeChecks="3"
 50 | 				RuntimeLibrary="1"
 51 | 				UsePrecompiledHeader="0"
 52 | 				WarningLevel="3"
 53 | 				DebugInformationFormat="4"
 54 | 			/>
 55 | 			<Tool
 56 | 				Name="VCManagedResourceCompilerTool"
 57 | 			/>
 58 | 			<Tool
 59 | 				Name="VCResourceCompilerTool"
 60 | 			/>
 61 | 			<Tool
 62 | 				Name="VCPreLinkEventTool"
 63 | 			/>
 64 | 			<Tool
 65 | 				Name="VCLinkerTool"
 66 | 				OutputFile="$(OutDir)\$(ProjectName).x86.dll"
 67 | 				LinkIncremental="2"
 68 | 				ModuleDefinitionFile="$(SolutionDir)..\..\dll_resources\MinHook.def"
 69 | 				GenerateDebugInformation="false"
 70 | 				SubSystem="2"
 71 | 				TargetMachine="1"
 72 | 			/>
 73 | 			<Tool
 74 | 				Name="VCALinkTool"
 75 | 			/>
 76 | 			<Tool
 77 | 				Name="VCManifestTool"
 78 | 			/>
 79 | 			<Tool
 80 | 				Name="VCXDCMakeTool"
 81 | 			/>
 82 | 			<Tool
 83 | 				Name="VCBscMakeTool"
 84 | 			/>
 85 | 			<Tool
 86 | 				Name="VCFxCopTool"
 87 | 			/>
 88 | 			<Tool
 89 | 				Name="VCAppVerifierTool"
 90 | 			/>
 91 | 			<Tool
 92 | 				Name="VCPostBuildEventTool"
 93 | 			/>
 94 | 		</Configuration>
 95 | 		<Configuration
 96 | 			Name="Debug|x64"
 97 | 			OutputDirectory="$(SolutionDir)bin\$(ConfigurationName)"
 98 | 			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)\$(ProjectName)"
 99 | 			ConfigurationType="2"
100 | 			CharacterSet="1"
101 | 			>
102 | 			<Tool
103 | 				Name="VCPreBuildEventTool"
104 | 			/>
105 | 			<Tool
106 | 				Name="VCCustomBuildTool"
107 | 			/>
108 | 			<Tool
109 | 				Name="VCXMLDataGeneratorTool"
110 | 			/>
111 | 			<Tool
112 | 				Name="VCWebServiceProxyGeneratorTool"
113 | 			/>
114 | 			<Tool
115 | 				Name="VCMIDLTool"
116 | 				TargetEnvironment="3"
117 | 			/>
118 | 			<Tool
119 | 				Name="VCCLCompilerTool"
120 | 				Optimization="0"
121 | 				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;MINHOOK_EXPORTS"
122 | 				MinimalRebuild="false"
123 | 				BasicRuntimeChecks="3"
124 | 				RuntimeLibrary="1"
125 | 				UsePrecompiledHeader="0"
126 | 				WarningLevel="3"
127 | 				DebugInformationFormat="3"
128 | 			/>
129 | 			<Tool
130 | 				Name="VCManagedResourceCompilerTool"
131 | 			/>
132 | 			<Tool
133 | 				Name="VCResourceCompilerTool"
134 | 			/>
135 | 			<Tool
136 | 				Name="VCPreLinkEventTool"
137 | 			/>
138 | 			<Tool
139 | 				Name="VCLinkerTool"
140 | 				OutputFile="$(OutDir)\$(ProjectName).x64.dll"
141 | 				LinkIncremental="2"
142 | 				ModuleDefinitionFile="$(SolutionDir)..\..\dll_resources\MinHook.def"
143 | 				GenerateDebugInformation="false"
144 | 				SubSystem="2"
145 | 				TargetMachine="17"
146 | 			/>
147 | 			<Tool
148 | 				Name="VCALinkTool"
149 | 			/>
150 | 			<Tool
151 | 				Name="VCManifestTool"
152 | 			/>
153 | 			<Tool
154 | 				Name="VCXDCMakeTool"
155 | 			/>
156 | 			<Tool
157 | 				Name="VCBscMakeTool"
158 | 			/>
159 | 			<Tool
160 | 				Name="VCFxCopTool"
161 | 			/>
162 | 			<Tool
163 | 				Name="VCAppVerifierTool"
164 | 			/>
165 | 			<Tool
166 | 				Name="VCPostBuildEventTool"
167 | 			/>
168 | 		</Configuration>
169 | 		<Configuration
170 | 			Name="Release|Win32"
171 | 			OutputDirectory="$(SolutionDir)bin\$(ConfigurationName)"
172 | 			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)\$(ProjectName)"
173 | 			ConfigurationType="2"
174 | 			CharacterSet="1"
175 | 			WholeProgramOptimization="1"
176 | 			>
177 | 			<Tool
178 | 				Name="VCPreBuildEventTool"
179 | 			/>
180 | 			<Tool
181 | 				Name="VCCustomBuildTool"
182 | 			/>
183 | 			<Tool
184 | 				Name="VCXMLDataGeneratorTool"
185 | 			/>
186 | 			<Tool
187 | 				Name="VCWebServiceProxyGeneratorTool"
188 | 			/>
189 | 			<Tool
190 | 				Name="VCMIDLTool"
191 | 			/>
192 | 			<Tool
193 | 				Name="VCCLCompilerTool"
194 | 				Optimization="1"
195 | 				EnableIntrinsicFunctions="true"
196 | 				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;MINHOOK_EXPORTS"
197 | 				MinimalRebuild="false"
198 | 				RuntimeLibrary="0"
199 | 				EnableFunctionLevelLinking="true"
200 | 				UsePrecompiledHeader="0"
201 | 				WarningLevel="3"
202 | 				DebugInformationFormat="3"
203 | 			/>
204 | 			<Tool
205 | 				Name="VCManagedResourceCompilerTool"
206 | 			/>
207 | 			<Tool
208 | 				Name="VCResourceCompilerTool"
209 | 			/>
210 | 			<Tool
211 | 				Name="VCPreLinkEventTool"
212 | 			/>
213 | 			<Tool
214 | 				Name="VCLinkerTool"
215 | 				OutputFile="$(OutDir)\$(ProjectName).x86.dll"
216 | 				LinkIncremental="1"
217 | 				ModuleDefinitionFile="$(SolutionDir)..\..\dll_resources\MinHook.def"
218 | 				GenerateDebugInformation="false"
219 | 				SubSystem="2"
220 | 				OptimizeReferences="2"
221 | 				EnableCOMDATFolding="2"
222 | 				ResourceOnlyDLL="true"
223 | 				MergeSections=".CRT=.text"
224 | 				TargetMachine="1"
225 | 			/>
226 | 			<Tool
227 | 				Name="VCALinkTool"
228 | 			/>
229 | 			<Tool
230 | 				Name="VCManifestTool"
231 | 			/>
232 | 			<Tool
233 | 				Name="VCXDCMakeTool"
234 | 			/>
235 | 			<Tool
236 | 				Name="VCBscMakeTool"
237 | 			/>
238 | 			<Tool
239 | 				Name="VCFxCopTool"
240 | 			/>
241 | 			<Tool
242 | 				Name="VCAppVerifierTool"
243 | 			/>
244 | 			<Tool
245 | 				Name="VCPostBuildEventTool"
246 | 			/>
247 | 		</Configuration>
248 | 		<Configuration
249 | 			Name="Release|x64"
250 | 			OutputDirectory="$(SolutionDir)bin\$(ConfigurationName)"
251 | 			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)\$(ProjectName)"
252 | 			ConfigurationType="2"
253 | 			CharacterSet="1"
254 | 			WholeProgramOptimization="1"
255 | 			>
256 | 			<Tool
257 | 				Name="VCPreBuildEventTool"
258 | 			/>
259 | 			<Tool
260 | 				Name="VCCustomBuildTool"
261 | 			/>
262 | 			<Tool
263 | 				Name="VCXMLDataGeneratorTool"
264 | 			/>
265 | 			<Tool
266 | 				Name="VCWebServiceProxyGeneratorTool"
267 | 			/>
268 | 			<Tool
269 | 				Name="VCMIDLTool"
270 | 				TargetEnvironment="3"
271 | 			/>
272 | 			<Tool
273 | 				Name="VCCLCompilerTool"
274 | 				Optimization="1"
275 | 				EnableIntrinsicFunctions="true"
276 | 				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;MINHOOK_EXPORTS"
277 | 				MinimalRebuild="false"
278 | 				RuntimeLibrary="0"
279 | 				EnableFunctionLevelLinking="true"
280 | 				UsePrecompiledHeader="0"
281 | 				WarningLevel="3"
282 | 				DebugInformationFormat="3"
283 | 			/>
284 | 			<Tool
285 | 				Name="VCManagedResourceCompilerTool"
286 | 			/>
287 | 			<Tool
288 | 				Name="VCResourceCompilerTool"
289 | 			/>
290 | 			<Tool
291 | 				Name="VCPreLinkEventTool"
292 | 			/>
293 | 			<Tool
294 | 				Name="VCLinkerTool"
295 | 				OutputFile="$(OutDir)\$(ProjectName).x64.dll"
296 | 				LinkIncremental="1"
297 | 				ModuleDefinitionFile="$(SolutionDir)..\..\dll_resources\MinHook.def"
298 | 				GenerateDebugInformation="false"
299 | 				SubSystem="2"
300 | 				OptimizeReferences="2"
301 | 				EnableCOMDATFolding="2"
302 | 				ResourceOnlyDLL="true"
303 | 				MergeSections=".CRT=.text"
304 | 				TargetMachine="17"
305 | 			/>
306 | 			<Tool
307 | 				Name="VCALinkTool"
308 | 			/>
309 | 			<Tool
310 | 				Name="VCManifestTool"
311 | 			/>
312 | 			<Tool
313 | 				Name="VCXDCMakeTool"
314 | 			/>
315 | 			<Tool
316 | 				Name="VCBscMakeTool"
317 | 			/>
318 | 			<Tool
319 | 				Name="VCFxCopTool"
320 | 			/>
321 | 			<Tool
322 | 				Name="VCAppVerifierTool"
323 | 			/>
324 | 			<Tool
325 | 				Name="VCPostBuildEventTool"
326 | 			/>
327 | 		</Configuration>
328 | 	</Configurations>
329 | 	<References>
330 | 	</References>
331 | 	<Files>
332 | 		<File
333 | 			RelativePath="..\..\dll_resources\MinHook.def"
334 | 			>
335 | 		</File>
336 | 		<File
337 | 			RelativePath="..\..\dll_resources\MinHook.rc"
338 | 			>
339 | 		</File>
340 | 	</Files>
341 | 	<Globals>
342 | 	</Globals>
343 | </VisualStudioProject>
344 | 


--------------------------------------------------------------------------------
/build/VC9/MinHookVC9.sln:
--------------------------------------------------------------------------------
 1 | 
 2 | Microsoft Visual Studio Solution File, Format Version 10.00
 3 | # Visual Studio 2008
 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libMinHook", "libMinHook.vcproj", "{F142A341-5EE0-442D-A15F-98AE9B48DBAE}"
 5 | EndProject
 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MinHook", "MinHook.vcproj", "{027FAC75-3FDB-4044-8DD0-BC297BD4C461}"
 7 | 	ProjectSection(ProjectDependencies) = postProject
 8 | 		{F142A341-5EE0-442D-A15F-98AE9B48DBAE} = {F142A341-5EE0-442D-A15F-98AE9B48DBAE}
 9 | 	EndProjectSection
10 | EndProject
11 | Global
12 | 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
13 | 		Debug|Win32 = Debug|Win32
14 | 		Debug|x64 = Debug|x64
15 | 		Release|Win32 = Release|Win32
16 | 		Release|x64 = Release|x64
17 | 	EndGlobalSection
18 | 	GlobalSection(ProjectConfigurationPlatforms) = postSolution
19 | 		{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Debug|Win32.ActiveCfg = Debug|Win32
20 | 		{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Debug|Win32.Build.0 = Debug|Win32
21 | 		{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Debug|x64.ActiveCfg = Debug|x64
22 | 		{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Debug|x64.Build.0 = Debug|x64
23 | 		{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Release|Win32.ActiveCfg = Release|Win32
24 | 		{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Release|Win32.Build.0 = Release|Win32
25 | 		{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Release|x64.ActiveCfg = Release|x64
26 | 		{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Release|x64.Build.0 = Release|x64
27 | 		{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Debug|Win32.ActiveCfg = Debug|Win32
28 | 		{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Debug|Win32.Build.0 = Debug|Win32
29 | 		{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Debug|x64.ActiveCfg = Debug|x64
30 | 		{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Debug|x64.Build.0 = Debug|x64
31 | 		{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Release|Win32.ActiveCfg = Release|Win32
32 | 		{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Release|Win32.Build.0 = Release|Win32
33 | 		{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Release|x64.ActiveCfg = Release|x64
34 | 		{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Release|x64.Build.0 = Release|x64
35 | 	EndGlobalSection
36 | 	GlobalSection(SolutionProperties) = preSolution
37 | 		HideSolutionNode = FALSE
38 | 	EndGlobalSection
39 | EndGlobal
40 | 


--------------------------------------------------------------------------------
/build/VC9/libMinHook.vcproj:
--------------------------------------------------------------------------------
  1 | <?xml version="1.0" encoding="shift_jis"?>
  2 | <VisualStudioProject
  3 | 	ProjectType="Visual C++"
  4 | 	Version="9.00"
  5 | 	Name="libMinHook"
  6 | 	ProjectGUID="{F142A341-5EE0-442D-A15F-98AE9B48DBAE}"
  7 | 	RootNamespace="libMinHook"
  8 | 	Keyword="Win32Proj"
  9 | 	TargetFrameworkVersion="196613"
 10 | 	>
 11 | 	<Platforms>
 12 | 		<Platform
 13 | 			Name="Win32"
 14 | 		/>
 15 | 		<Platform
 16 | 			Name="x64"
 17 | 		/>
 18 | 	</Platforms>
 19 | 	<ToolFiles>
 20 | 	</ToolFiles>
 21 | 	<Configurations>
 22 | 		<Configuration
 23 | 			Name="Debug|Win32"
 24 | 			OutputDirectory="$(SolutionDir)lib\$(ConfigurationName)"
 25 | 			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)\$(ProjectName)"
 26 | 			ConfigurationType="4"
 27 | 			CharacterSet="1"
 28 | 			>
 29 | 			<Tool
 30 | 				Name="VCPreBuildEventTool"
 31 | 			/>
 32 | 			<Tool
 33 | 				Name="VCCustomBuildTool"
 34 | 			/>
 35 | 			<Tool
 36 | 				Name="VCXMLDataGeneratorTool"
 37 | 			/>
 38 | 			<Tool
 39 | 				Name="VCWebServiceProxyGeneratorTool"
 40 | 			/>
 41 | 			<Tool
 42 | 				Name="VCMIDLTool"
 43 | 			/>
 44 | 			<Tool
 45 | 				Name="VCCLCompilerTool"
 46 | 				Optimization="0"
 47 | 				AdditionalIncludeDirectories=""
 48 | 				PreprocessorDefinitions="WIN32;_DEBUG;_LIB;STRICT"
 49 | 				MinimalRebuild="false"
 50 | 				BasicRuntimeChecks="3"
 51 | 				RuntimeLibrary="1"
 52 | 				UsePrecompiledHeader="0"
 53 | 				WarningLevel="3"
 54 | 				DebugInformationFormat="0"
 55 | 			/>
 56 | 			<Tool
 57 | 				Name="VCManagedResourceCompilerTool"
 58 | 			/>
 59 | 			<Tool
 60 | 				Name="VCResourceCompilerTool"
 61 | 			/>
 62 | 			<Tool
 63 | 				Name="VCPreLinkEventTool"
 64 | 			/>
 65 | 			<Tool
 66 | 				Name="VCLibrarianTool"
 67 | 				OutputFile="$(OutDir)\$(ProjectName).x86.lib"
 68 | 			/>
 69 | 			<Tool
 70 | 				Name="VCALinkTool"
 71 | 			/>
 72 | 			<Tool
 73 | 				Name="VCXDCMakeTool"
 74 | 			/>
 75 | 			<Tool
 76 | 				Name="VCBscMakeTool"
 77 | 			/>
 78 | 			<Tool
 79 | 				Name="VCFxCopTool"
 80 | 			/>
 81 | 			<Tool
 82 | 				Name="VCPostBuildEventTool"
 83 | 			/>
 84 | 		</Configuration>
 85 | 		<Configuration
 86 | 			Name="Debug|x64"
 87 | 			OutputDirectory="$(SolutionDir)lib\$(ConfigurationName)"
 88 | 			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)\$(ProjectName)"
 89 | 			ConfigurationType="4"
 90 | 			CharacterSet="1"
 91 | 			>
 92 | 			<Tool
 93 | 				Name="VCPreBuildEventTool"
 94 | 			/>
 95 | 			<Tool
 96 | 				Name="VCCustomBuildTool"
 97 | 			/>
 98 | 			<Tool
 99 | 				Name="VCXMLDataGeneratorTool"
100 | 			/>
101 | 			<Tool
102 | 				Name="VCWebServiceProxyGeneratorTool"
103 | 			/>
104 | 			<Tool
105 | 				Name="VCMIDLTool"
106 | 				TargetEnvironment="3"
107 | 			/>
108 | 			<Tool
109 | 				Name="VCCLCompilerTool"
110 | 				Optimization="0"
111 | 				WholeProgramOptimization="false"
112 | 				AdditionalIncludeDirectories=""
113 | 				PreprocessorDefinitions="WIN32;_DEBUG;_LIB;STRICT"
114 | 				MinimalRebuild="false"
115 | 				BasicRuntimeChecks="3"
116 | 				RuntimeLibrary="1"
117 | 				UsePrecompiledHeader="0"
118 | 				WarningLevel="3"
119 | 				DebugInformationFormat="0"
120 | 			/>
121 | 			<Tool
122 | 				Name="VCManagedResourceCompilerTool"
123 | 			/>
124 | 			<Tool
125 | 				Name="VCResourceCompilerTool"
126 | 			/>
127 | 			<Tool
128 | 				Name="VCPreLinkEventTool"
129 | 			/>
130 | 			<Tool
131 | 				Name="VCLibrarianTool"
132 | 				OutputFile="$(OutDir)\$(ProjectName).x64.lib"
133 | 			/>
134 | 			<Tool
135 | 				Name="VCALinkTool"
136 | 			/>
137 | 			<Tool
138 | 				Name="VCXDCMakeTool"
139 | 			/>
140 | 			<Tool
141 | 				Name="VCBscMakeTool"
142 | 			/>
143 | 			<Tool
144 | 				Name="VCFxCopTool"
145 | 			/>
146 | 			<Tool
147 | 				Name="VCPostBuildEventTool"
148 | 			/>
149 | 		</Configuration>
150 | 		<Configuration
151 | 			Name="Release|Win32"
152 | 			OutputDirectory="$(SolutionDir)lib\$(ConfigurationName)"
153 | 			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)\$(ProjectName)"
154 | 			ConfigurationType="4"
155 | 			CharacterSet="1"
156 | 			WholeProgramOptimization="1"
157 | 			>
158 | 			<Tool
159 | 				Name="VCPreBuildEventTool"
160 | 			/>
161 | 			<Tool
162 | 				Name="VCCustomBuildTool"
163 | 			/>
164 | 			<Tool
165 | 				Name="VCXMLDataGeneratorTool"
166 | 			/>
167 | 			<Tool
168 | 				Name="VCWebServiceProxyGeneratorTool"
169 | 			/>
170 | 			<Tool
171 | 				Name="VCMIDLTool"
172 | 			/>
173 | 			<Tool
174 | 				Name="VCCLCompilerTool"
175 | 				Optimization="1"
176 | 				InlineFunctionExpansion="2"
177 | 				EnableIntrinsicFunctions="true"
178 | 				WholeProgramOptimization="true"
179 | 				AdditionalIncludeDirectories=""
180 | 				PreprocessorDefinitions="WIN32;NDEBUG;_LIB;STRICT"
181 | 				MinimalRebuild="false"
182 | 				RuntimeLibrary="0"
183 | 				EnableFunctionLevelLinking="true"
184 | 				UsePrecompiledHeader="0"
185 | 				AssemblerOutput="2"
186 | 				WarningLevel="3"
187 | 				DebugInformationFormat="0"
188 | 			/>
189 | 			<Tool
190 | 				Name="VCManagedResourceCompilerTool"
191 | 			/>
192 | 			<Tool
193 | 				Name="VCResourceCompilerTool"
194 | 			/>
195 | 			<Tool
196 | 				Name="VCPreLinkEventTool"
197 | 			/>
198 | 			<Tool
199 | 				Name="VCLibrarianTool"
200 | 				OutputFile="$(OutDir)\$(ProjectName).x86.lib"
201 | 			/>
202 | 			<Tool
203 | 				Name="VCALinkTool"
204 | 			/>
205 | 			<Tool
206 | 				Name="VCXDCMakeTool"
207 | 			/>
208 | 			<Tool
209 | 				Name="VCBscMakeTool"
210 | 			/>
211 | 			<Tool
212 | 				Name="VCFxCopTool"
213 | 			/>
214 | 			<Tool
215 | 				Name="VCPostBuildEventTool"
216 | 			/>
217 | 		</Configuration>
218 | 		<Configuration
219 | 			Name="Release|x64"
220 | 			OutputDirectory="$(SolutionDir)lib\$(ConfigurationName)"
221 | 			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)\$(ProjectName)"
222 | 			ConfigurationType="4"
223 | 			CharacterSet="1"
224 | 			WholeProgramOptimization="1"
225 | 			>
226 | 			<Tool
227 | 				Name="VCPreBuildEventTool"
228 | 			/>
229 | 			<Tool
230 | 				Name="VCCustomBuildTool"
231 | 			/>
232 | 			<Tool
233 | 				Name="VCXMLDataGeneratorTool"
234 | 			/>
235 | 			<Tool
236 | 				Name="VCWebServiceProxyGeneratorTool"
237 | 			/>
238 | 			<Tool
239 | 				Name="VCMIDLTool"
240 | 				TargetEnvironment="3"
241 | 			/>
242 | 			<Tool
243 | 				Name="VCCLCompilerTool"
244 | 				Optimization="1"
245 | 				InlineFunctionExpansion="2"
246 | 				EnableIntrinsicFunctions="true"
247 | 				WholeProgramOptimization="true"
248 | 				AdditionalIncludeDirectories=""
249 | 				PreprocessorDefinitions="WIN32;NDEBUG;_LIB;STRICT"
250 | 				MinimalRebuild="false"
251 | 				RuntimeLibrary="0"
252 | 				EnableFunctionLevelLinking="true"
253 | 				UsePrecompiledHeader="0"
254 | 				AssemblerOutput="2"
255 | 				WarningLevel="3"
256 | 				DebugInformationFormat="0"
257 | 			/>
258 | 			<Tool
259 | 				Name="VCManagedResourceCompilerTool"
260 | 			/>
261 | 			<Tool
262 | 				Name="VCResourceCompilerTool"
263 | 			/>
264 | 			<Tool
265 | 				Name="VCPreLinkEventTool"
266 | 			/>
267 | 			<Tool
268 | 				Name="VCLibrarianTool"
269 | 				OutputFile="$(OutDir)\$(ProjectName).x64.lib"
270 | 			/>
271 | 			<Tool
272 | 				Name="VCALinkTool"
273 | 			/>
274 | 			<Tool
275 | 				Name="VCXDCMakeTool"
276 | 			/>
277 | 			<Tool
278 | 				Name="VCBscMakeTool"
279 | 			/>
280 | 			<Tool
281 | 				Name="VCFxCopTool"
282 | 			/>
283 | 			<Tool
284 | 				Name="VCPostBuildEventTool"
285 | 			/>
286 | 		</Configuration>
287 | 	</Configurations>
288 | 	<References>
289 | 	</References>
290 | 	<Files>
291 | 		<Filter
292 | 			Name="Source Files"
293 | 			Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
294 | 			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
295 | 			>
296 | 			<File
297 | 				RelativePath="..\..\src\buffer.c"
298 | 				>
299 | 			</File>
300 | 			<File
301 | 				RelativePath="..\..\src\hook.c"
302 | 				>
303 | 				<FileConfiguration
304 | 					Name="Release|Win32"
305 | 					>
306 | 					<Tool
307 | 						Name="VCCLCompilerTool"
308 | 						Optimization="2"
309 | 					/>
310 | 				</FileConfiguration>
311 | 				<FileConfiguration
312 | 					Name="Release|x64"
313 | 					>
314 | 					<Tool
315 | 						Name="VCCLCompilerTool"
316 | 						Optimization="2"
317 | 					/>
318 | 				</FileConfiguration>
319 | 			</File>
320 | 			<File
321 | 				RelativePath="..\..\src\trampoline.c"
322 | 				>
323 | 			</File>
324 | 		</Filter>
325 | 		<Filter
326 | 			Name="Header Files"
327 | 			Filter="h;hpp;hxx;hm;inl;inc;xsd"
328 | 			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
329 | 			>
330 | 			<File
331 | 				RelativePath="..\..\src\buffer.h"
332 | 				>
333 | 			</File>
334 | 			<File
335 | 				RelativePath="..\..\src\trampoline.h"
336 | 				>
337 | 			</File>
338 | 		</Filter>
339 | 		<Filter
340 | 			Name="HDE"
341 | 			>
342 | 			<File
343 | 				RelativePath="..\..\src\HDE\hde32.c"
344 | 				>
345 | 				<FileConfiguration
346 | 					Name="Debug|x64"
347 | 					ExcludedFromBuild="true"
348 | 					>
349 | 					<Tool
350 | 						Name="VCCLCompilerTool"
351 | 					/>
352 | 				</FileConfiguration>
353 | 				<FileConfiguration
354 | 					Name="Release|x64"
355 | 					ExcludedFromBuild="true"
356 | 					>
357 | 					<Tool
358 | 						Name="VCCLCompilerTool"
359 | 					/>
360 | 				</FileConfiguration>
361 | 			</File>
362 | 			<File
363 | 				RelativePath="..\..\src\HDE\hde32.h"
364 | 				>
365 | 			</File>
366 | 			<File
367 | 				RelativePath="..\..\src\HDE\hde64.c"
368 | 				>
369 | 				<FileConfiguration
370 | 					Name="Debug|Win32"
371 | 					ExcludedFromBuild="true"
372 | 					>
373 | 					<Tool
374 | 						Name="VCCLCompilerTool"
375 | 					/>
376 | 				</FileConfiguration>
377 | 				<FileConfiguration
378 | 					Name="Release|Win32"
379 | 					ExcludedFromBuild="true"
380 | 					>
381 | 					<Tool
382 | 						Name="VCCLCompilerTool"
383 | 					/>
384 | 				</FileConfiguration>
385 | 			</File>
386 | 			<File
387 | 				RelativePath="..\..\src\HDE\hde64.h"
388 | 				>
389 | 			</File>
390 | 			<File
391 | 				RelativePath="..\..\src\HDE\pstdint.h"
392 | 				>
393 | 			</File>
394 | 			<File
395 | 				RelativePath="..\..\src\HDE\table32.h"
396 | 				>
397 | 			</File>
398 | 			<File
399 | 				RelativePath="..\..\src\HDE\table64.h"
400 | 				>
401 | 			</File>
402 | 		</Filter>
403 | 		<File
404 | 			RelativePath="..\..\include\MinHook.h"
405 | 			>
406 | 		</File>
407 | 	</Files>
408 | 	<Globals>
409 | 	</Globals>
410 | </VisualStudioProject>
411 | 


--------------------------------------------------------------------------------
/cmake/minhook-config.cmake.in:
--------------------------------------------------------------------------------
 1 | #  MinHook - The Minimalistic API Hooking Library for x64/x86
 2 | #  Copyright (C) 2009-2017 Tsuda Kageyu.
 3 | #  All rights reserved.
 4 | #
 5 | #  Redistribution and use in source and binary forms, with or without
 6 | #  modification, are permitted provided that the following conditions
 7 | #  are met:
 8 | #
 9 | #   1. Redistributions of source code must retain the above copyright
10 | #      notice, this list of conditions and the following disclaimer.
11 | #   2. Redistributions in binary form must reproduce the above copyright
12 | #      notice, this list of conditions and the following disclaimer in the
13 | #      documentation and/or other materials provided with the distribution.
14 | #
15 | #  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
16 | #  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
17 | #  TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
18 | #  PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER
19 | #  OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
20 | #  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
21 | #  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
22 | #  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
23 | #  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
24 | #  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 | #  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | 
27 | set(MINHOOK_MAJOR_VERSION "@MINHOOK_MAJOR_VERSION@")
28 | set(MINHOOK_MINOR_VERSION "@MINHOOK_MINOR_VERSION@")
29 | set(MINHOOK_PATCH_VERSION "@MINHOOK_PATCH_VERSION@")
30 | set(MINHOOK_VERSION "@MINHOOK_VERSION@")
31 | 
32 | @PACKAGE_INIT@
33 |  
34 | set(MINHOOK_FOUND ON)
35 | 
36 | set_and_check(MINHOOK_INCLUDE_DIRS  "${PACKAGE_PREFIX_DIR}/include/")
37 | set_and_check(MINHOOK_LIBRARY_DIRS  "${PACKAGE_PREFIX_DIR}/lib")
38 |  
39 | include("${PACKAGE_PREFIX_DIR}/share/minhook/minhook-targets.cmake")
40 | 


--------------------------------------------------------------------------------
/dll_resources/MinHook.def:
--------------------------------------------------------------------------------
 1 | EXPORTS
 2 |     MH_Initialize
 3 |     MH_Uninitialize
 4 | 
 5 |     MH_CreateHook
 6 |     MH_CreateHookApi
 7 |     MH_CreateHookApiEx
 8 |     MH_RemoveHook
 9 |     MH_EnableHook
10 |     MH_DisableHook
11 |     MH_QueueEnableHook
12 |     MH_QueueDisableHook
13 |     MH_ApplyQueued
14 |     MH_StatusToString
15 | 


--------------------------------------------------------------------------------
/dll_resources/MinHook.rc:
--------------------------------------------------------------------------------
 1 | 1 VERSIONINFO
 2 |  FILEVERSION 1,3,4,0
 3 |  PRODUCTVERSION 1,3,4,0
 4 |  FILEFLAGSMASK 0x17L
 5 | #ifdef _DEBUG
 6 |  FILEFLAGS 0x1L
 7 | #else
 8 |  FILEFLAGS 0x0L
 9 | #endif
10 |  FILEOS 0x4L
11 |  FILETYPE 0x2L
12 |  FILESUBTYPE 0x0L
13 | BEGIN
14 |     BLOCK "StringFileInfo"
15 |     BEGIN
16 |         BLOCK "040904b0"
17 |         BEGIN
18 |             VALUE "CompanyName", "Tsuda Kageyu"
19 |             VALUE "FileDescription", "MinHook - The Minimalistic API Hook Library for x64/x86"
20 |             VALUE "FileVersion", "1.3.4.0"
21 |             VALUE "InternalName", "MinHookD"
22 |             VALUE "LegalCopyright", "Copyright (C) 2009-2017 Tsuda Kageyu. All rights reserved."
23 |             VALUE "LegalTrademarks", "Tsuda Kageyu"
24 |             VALUE "ProductName", "MinHook DLL"
25 |             VALUE "ProductVersion", "1.3.4.0"
26 |         END
27 |     END
28 |     BLOCK "VarFileInfo"
29 |     BEGIN
30 |         VALUE "Translation", 0x409, 1200
31 |     END
32 | END
33 | 


--------------------------------------------------------------------------------
/include/MinHook.h:
--------------------------------------------------------------------------------
  1 | /*
  2 |  *  MinHook - The Minimalistic API Hooking Library for x64/x86
  3 |  *  Copyright (C) 2009-2017 Tsuda Kageyu.
  4 |  *  All rights reserved.
  5 |  *
  6 |  *  Redistribution and use in source and binary forms, with or without
  7 |  *  modification, are permitted provided that the following conditions
  8 |  *  are met:
  9 |  *
 10 |  *   1. Redistributions of source code must retain the above copyright
 11 |  *      notice, this list of conditions and the following disclaimer.
 12 |  *   2. Redistributions in binary form must reproduce the above copyright
 13 |  *      notice, this list of conditions and the following disclaimer in the
 14 |  *      documentation and/or other materials provided with the distribution.
 15 |  *
 16 |  *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 17 |  *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
 18 |  *  TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
 19 |  *  PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER
 20 |  *  OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 21 |  *  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 22 |  *  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 23 |  *  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
 24 |  *  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 25 |  *  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 26 |  *  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 27 |  */
 28 | 
 29 | #pragma once
 30 | 
 31 | #if !(defined _M_IX86) && !(defined _M_X64) && !(defined __i386__) && !(defined __x86_64__)
 32 |     #error MinHook supports only x86 and x64 systems.
 33 | #endif
 34 | 
 35 | #include <windows.h>
 36 | 
 37 | // MinHook Error Codes.
 38 | typedef enum MH_STATUS
 39 | {
 40 |     // Unknown error. Should not be returned.
 41 |     MH_UNKNOWN = -1,
 42 | 
 43 |     // Successful.
 44 |     MH_OK = 0,
 45 | 
 46 |     // MinHook is already initialized.
 47 |     MH_ERROR_ALREADY_INITIALIZED,
 48 | 
 49 |     // MinHook is not initialized yet, or already uninitialized.
 50 |     MH_ERROR_NOT_INITIALIZED,
 51 | 
 52 |     // The hook for the specified target function is already created.
 53 |     MH_ERROR_ALREADY_CREATED,
 54 | 
 55 |     // The hook for the specified target function is not created yet.
 56 |     MH_ERROR_NOT_CREATED,
 57 | 
 58 |     // The hook for the specified target function is already enabled.
 59 |     MH_ERROR_ENABLED,
 60 | 
 61 |     // The hook for the specified target function is not enabled yet, or already
 62 |     // disabled.
 63 |     MH_ERROR_DISABLED,
 64 | 
 65 |     // The specified pointer is invalid. It points the address of non-allocated
 66 |     // and/or non-executable region.
 67 |     MH_ERROR_NOT_EXECUTABLE,
 68 | 
 69 |     // The specified target function cannot be hooked.
 70 |     MH_ERROR_UNSUPPORTED_FUNCTION,
 71 | 
 72 |     // Failed to allocate memory.
 73 |     MH_ERROR_MEMORY_ALLOC,
 74 | 
 75 |     // Failed to change the memory protection.
 76 |     MH_ERROR_MEMORY_PROTECT,
 77 | 
 78 |     // The specified module is not loaded.
 79 |     MH_ERROR_MODULE_NOT_FOUND,
 80 | 
 81 |     // The specified function is not found.
 82 |     MH_ERROR_FUNCTION_NOT_FOUND
 83 | }
 84 | MH_STATUS;
 85 | 
 86 | // Can be passed as a parameter to MH_EnableHook, MH_DisableHook,
 87 | // MH_QueueEnableHook or MH_QueueDisableHook.
 88 | #define MH_ALL_HOOKS NULL
 89 | 
 90 | #ifdef __cplusplus
 91 | extern "C" {
 92 | #endif
 93 | 
 94 |     // Initialize the MinHook library. You must call this function EXACTLY ONCE
 95 |     // at the beginning of your program.
 96 |     MH_STATUS WINAPI MH_Initialize(VOID);
 97 | 
 98 |     // Uninitialize the MinHook library. You must call this function EXACTLY
 99 |     // ONCE at the end of your program.
100 |     MH_STATUS WINAPI MH_Uninitialize(VOID);
101 | 
102 |     // Creates a hook for the specified target function, in disabled state.
103 |     // Parameters:
104 |     //   pTarget     [in]  A pointer to the target function, which will be
105 |     //                     overridden by the detour function.
106 |     //   pDetour     [in]  A pointer to the detour function, which will override
107 |     //                     the target function.
108 |     //   ppOriginal  [out] A pointer to the trampoline function, which will be
109 |     //                     used to call the original target function.
110 |     //                     This parameter can be NULL.
111 |     MH_STATUS WINAPI MH_CreateHook(LPVOID pTarget, LPVOID pDetour, LPVOID *ppOriginal);
112 | 
113 |     // Creates a hook for the specified API function, in disabled state.
114 |     // Parameters:
115 |     //   pszModule   [in]  A pointer to the loaded module name which contains the
116 |     //                     target function.
117 |     //   pszProcName [in]  A pointer to the target function name, which will be
118 |     //                     overridden by the detour function.
119 |     //   pDetour     [in]  A pointer to the detour function, which will override
120 |     //                     the target function.
121 |     //   ppOriginal  [out] A pointer to the trampoline function, which will be
122 |     //                     used to call the original target function.
123 |     //                     This parameter can be NULL.
124 |     MH_STATUS WINAPI MH_CreateHookApi(
125 |         LPCWSTR pszModule, LPCSTR pszProcName, LPVOID pDetour, LPVOID *ppOriginal);
126 | 
127 |     // Creates a hook for the specified API function, in disabled state.
128 |     // Parameters:
129 |     //   pszModule   [in]  A pointer to the loaded module name which contains the
130 |     //                     target function.
131 |     //   pszProcName [in]  A pointer to the target function name, which will be
132 |     //                     overridden by the detour function.
133 |     //   pDetour     [in]  A pointer to the detour function, which will override
134 |     //                     the target function.
135 |     //   ppOriginal  [out] A pointer to the trampoline function, which will be
136 |     //                     used to call the original target function.
137 |     //                     This parameter can be NULL.
138 |     //   ppTarget    [out] A pointer to the target function, which will be used
139 |     //                     with other functions.
140 |     //                     This parameter can be NULL.
141 |     MH_STATUS WINAPI MH_CreateHookApiEx(
142 |         LPCWSTR pszModule, LPCSTR pszProcName, LPVOID pDetour, LPVOID *ppOriginal, LPVOID *ppTarget);
143 | 
144 |     // Removes an already created hook.
145 |     // Parameters:
146 |     //   pTarget [in] A pointer to the target function.
147 |     MH_STATUS WINAPI MH_RemoveHook(LPVOID pTarget);
148 | 
149 |     // Enables an already created hook.
150 |     // Parameters:
151 |     //   pTarget [in] A pointer to the target function.
152 |     //                If this parameter is MH_ALL_HOOKS, all created hooks are
153 |     //                enabled in one go.
154 |     MH_STATUS WINAPI MH_EnableHook(LPVOID pTarget);
155 | 
156 |     // Disables an already created hook.
157 |     // Parameters:
158 |     //   pTarget [in] A pointer to the target function.
159 |     //                If this parameter is MH_ALL_HOOKS, all created hooks are
160 |     //                disabled in one go.
161 |     MH_STATUS WINAPI MH_DisableHook(LPVOID pTarget);
162 | 
163 |     // Queues to enable an already created hook.
164 |     // Parameters:
165 |     //   pTarget [in] A pointer to the target function.
166 |     //                If this parameter is MH_ALL_HOOKS, all created hooks are
167 |     //                queued to be enabled.
168 |     MH_STATUS WINAPI MH_QueueEnableHook(LPVOID pTarget);
169 | 
170 |     // Queues to disable an already created hook.
171 |     // Parameters:
172 |     //   pTarget [in] A pointer to the target function.
173 |     //                If this parameter is MH_ALL_HOOKS, all created hooks are
174 |     //                queued to be disabled.
175 |     MH_STATUS WINAPI MH_QueueDisableHook(LPVOID pTarget);
176 | 
177 |     // Applies all queued changes in one go.
178 |     MH_STATUS WINAPI MH_ApplyQueued(VOID);
179 | 
180 |     // Translates the MH_STATUS to its name as a string.
181 |     const char *WINAPI MH_StatusToString(MH_STATUS status);
182 | 
183 | #ifdef __cplusplus
184 | }
185 | #endif
186 | 


--------------------------------------------------------------------------------
/src/buffer.c:
--------------------------------------------------------------------------------
  1 | /*
  2 |  *  MinHook - The Minimalistic API Hooking Library for x64/x86
  3 |  *  Copyright (C) 2009-2017 Tsuda Kageyu.
  4 |  *  All rights reserved.
  5 |  *
  6 |  *  Redistribution and use in source and binary forms, with or without
  7 |  *  modification, are permitted provided that the following conditions
  8 |  *  are met:
  9 |  *
 10 |  *   1. Redistributions of source code must retain the above copyright
 11 |  *      notice, this list of conditions and the following disclaimer.
 12 |  *   2. Redistributions in binary form must reproduce the above copyright
 13 |  *      notice, this list of conditions and the following disclaimer in the
 14 |  *      documentation and/or other materials provided with the distribution.
 15 |  *
 16 |  *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 17 |  *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
 18 |  *  TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
 19 |  *  PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER
 20 |  *  OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 21 |  *  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 22 |  *  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 23 |  *  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
 24 |  *  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 25 |  *  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 26 |  *  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 27 |  */
 28 | 
 29 | #include <windows.h>
 30 | #include "buffer.h"
 31 | 
 32 | // Size of each memory block. (= page size of VirtualAlloc)
 33 | #define MEMORY_BLOCK_SIZE 0x1000
 34 | 
 35 | // Max range for seeking a memory block. (= 1024MB)
 36 | #define MAX_MEMORY_RANGE 0x40000000
 37 | 
 38 | // Memory protection flags to check the executable address.
 39 | #define PAGE_EXECUTE_FLAGS \
 40 |     (PAGE_EXECUTE | PAGE_EXECUTE_READ | PAGE_EXECUTE_READWRITE | PAGE_EXECUTE_WRITECOPY)
 41 | 
 42 | // Memory slot.
 43 | typedef struct _MEMORY_SLOT
 44 | {
 45 |     union
 46 |     {
 47 |         struct _MEMORY_SLOT *pNext;
 48 |         UINT8 buffer[MEMORY_SLOT_SIZE];
 49 |     };
 50 | } MEMORY_SLOT, *PMEMORY_SLOT;
 51 | 
 52 | // Memory block info. Placed at the head of each block.
 53 | typedef struct _MEMORY_BLOCK
 54 | {
 55 |     struct _MEMORY_BLOCK *pNext;
 56 |     PMEMORY_SLOT pFree;         // First element of the free slot list.
 57 |     UINT usedCount;
 58 | } MEMORY_BLOCK, *PMEMORY_BLOCK;
 59 | 
 60 | //-------------------------------------------------------------------------
 61 | // Global Variables:
 62 | //-------------------------------------------------------------------------
 63 | 
 64 | // First element of the memory block list.
 65 | static PMEMORY_BLOCK g_pMemoryBlocks;
 66 | 
 67 | //-------------------------------------------------------------------------
 68 | VOID InitializeBuffer(VOID)
 69 | {
 70 |     // Nothing to do for now.
 71 | }
 72 | 
 73 | //-------------------------------------------------------------------------
 74 | VOID UninitializeBuffer(VOID)
 75 | {
 76 |     PMEMORY_BLOCK pBlock = g_pMemoryBlocks;
 77 |     g_pMemoryBlocks = NULL;
 78 | 
 79 |     while (pBlock)
 80 |     {
 81 |         PMEMORY_BLOCK pNext = pBlock->pNext;
 82 |         VirtualFree(pBlock, 0, MEM_RELEASE);
 83 |         pBlock = pNext;
 84 |     }
 85 | }
 86 | 
 87 | //-------------------------------------------------------------------------
 88 | #if defined(_M_X64) || defined(__x86_64__)
 89 | static LPVOID FindPrevFreeRegion(LPVOID pAddress, LPVOID pMinAddr, DWORD dwAllocationGranularity)
 90 | {
 91 |     ULONG_PTR tryAddr = (ULONG_PTR)pAddress;
 92 | 
 93 |     // Round down to the allocation granularity.
 94 |     tryAddr -= tryAddr % dwAllocationGranularity;
 95 | 
 96 |     // Start from the previous allocation granularity multiply.
 97 |     tryAddr -= dwAllocationGranularity;
 98 | 
 99 |     while (tryAddr >= (ULONG_PTR)pMinAddr)
100 |     {
101 |         MEMORY_BASIC_INFORMATION mbi;
102 |         if (VirtualQuery((LPVOID)tryAddr, &mbi, sizeof(mbi)) == 0)
103 |             break;
104 | 
105 |         if (mbi.State == MEM_FREE)
106 |             return (LPVOID)tryAddr;
107 | 
108 |         if ((ULONG_PTR)mbi.AllocationBase < dwAllocationGranularity)
109 |             break;
110 | 
111 |         tryAddr = (ULONG_PTR)mbi.AllocationBase - dwAllocationGranularity;
112 |     }
113 | 
114 |     return NULL;
115 | }
116 | #endif
117 | 
118 | //-------------------------------------------------------------------------
119 | #if defined(_M_X64) || defined(__x86_64__)
120 | static LPVOID FindNextFreeRegion(LPVOID pAddress, LPVOID pMaxAddr, DWORD dwAllocationGranularity)
121 | {
122 |     ULONG_PTR tryAddr = (ULONG_PTR)pAddress;
123 | 
124 |     // Round down to the allocation granularity.
125 |     tryAddr -= tryAddr % dwAllocationGranularity;
126 | 
127 |     // Start from the next allocation granularity multiply.
128 |     tryAddr += dwAllocationGranularity;
129 | 
130 |     while (tryAddr <= (ULONG_PTR)pMaxAddr)
131 |     {
132 |         MEMORY_BASIC_INFORMATION mbi;
133 |         if (VirtualQuery((LPVOID)tryAddr, &mbi, sizeof(mbi)) == 0)
134 |             break;
135 | 
136 |         if (mbi.State == MEM_FREE)
137 |             return (LPVOID)tryAddr;
138 | 
139 |         tryAddr = (ULONG_PTR)mbi.BaseAddress + mbi.RegionSize;
140 | 
141 |         // Round up to the next allocation granularity.
142 |         tryAddr += dwAllocationGranularity - 1;
143 |         tryAddr -= tryAddr % dwAllocationGranularity;
144 |     }
145 | 
146 |     return NULL;
147 | }
148 | #endif
149 | 
150 | //-------------------------------------------------------------------------
151 | static PMEMORY_BLOCK GetMemoryBlock(LPVOID pOrigin)
152 | {
153 |     PMEMORY_BLOCK pBlock;
154 | #if defined(_M_X64) || defined(__x86_64__)
155 |     ULONG_PTR minAddr;
156 |     ULONG_PTR maxAddr;
157 | 
158 |     SYSTEM_INFO si;
159 |     GetSystemInfo(&si);
160 |     minAddr = (ULONG_PTR)si.lpMinimumApplicationAddress;
161 |     maxAddr = (ULONG_PTR)si.lpMaximumApplicationAddress;
162 | 
163 |     // pOrigin ± 512MB
164 |     if ((ULONG_PTR)pOrigin > MAX_MEMORY_RANGE && minAddr < (ULONG_PTR)pOrigin - MAX_MEMORY_RANGE)
165 |         minAddr = (ULONG_PTR)pOrigin - MAX_MEMORY_RANGE;
166 | 
167 |     if (maxAddr > (ULONG_PTR)pOrigin + MAX_MEMORY_RANGE)
168 |         maxAddr = (ULONG_PTR)pOrigin + MAX_MEMORY_RANGE;
169 | 
170 |     // Make room for MEMORY_BLOCK_SIZE bytes.
171 |     maxAddr -= MEMORY_BLOCK_SIZE - 1;
172 | #endif
173 | 
174 |     // Look the registered blocks for a reachable one.
175 |     for (pBlock = g_pMemoryBlocks; pBlock != NULL; pBlock = pBlock->pNext)
176 |     {
177 | #if defined(_M_X64) || defined(__x86_64__)
178 |         // Ignore the blocks too far.
179 |         if ((ULONG_PTR)pBlock < minAddr || (ULONG_PTR)pBlock >= maxAddr)
180 |             continue;
181 | #endif
182 |         // The block has at least one unused slot.
183 |         if (pBlock->pFree != NULL)
184 |             return pBlock;
185 |     }
186 | 
187 | #if defined(_M_X64) || defined(__x86_64__)
188 |     // Alloc a new block above if not found.
189 |     {
190 |         LPVOID pAlloc = pOrigin;
191 |         while ((ULONG_PTR)pAlloc >= minAddr)
192 |         {
193 |             pAlloc = FindPrevFreeRegion(pAlloc, (LPVOID)minAddr, si.dwAllocationGranularity);
194 |             if (pAlloc == NULL)
195 |                 break;
196 | 
197 |             pBlock = (PMEMORY_BLOCK)VirtualAlloc(
198 |                 pAlloc, MEMORY_BLOCK_SIZE, MEM_COMMIT | MEM_RESERVE, PAGE_EXECUTE_READWRITE);
199 |             if (pBlock != NULL)
200 |                 break;
201 |         }
202 |     }
203 | 
204 |     // Alloc a new block below if not found.
205 |     if (pBlock == NULL)
206 |     {
207 |         LPVOID pAlloc = pOrigin;
208 |         while ((ULONG_PTR)pAlloc <= maxAddr)
209 |         {
210 |             pAlloc = FindNextFreeRegion(pAlloc, (LPVOID)maxAddr, si.dwAllocationGranularity);
211 |             if (pAlloc == NULL)
212 |                 break;
213 | 
214 |             pBlock = (PMEMORY_BLOCK)VirtualAlloc(
215 |                 pAlloc, MEMORY_BLOCK_SIZE, MEM_COMMIT | MEM_RESERVE, PAGE_EXECUTE_READWRITE);
216 |             if (pBlock != NULL)
217 |                 break;
218 |         }
219 |     }
220 | #else
221 |     // In x86 mode, a memory block can be placed anywhere.
222 |     pBlock = (PMEMORY_BLOCK)VirtualAlloc(
223 |         NULL, MEMORY_BLOCK_SIZE, MEM_COMMIT | MEM_RESERVE, PAGE_EXECUTE_READWRITE);
224 | #endif
225 | 
226 |     if (pBlock != NULL)
227 |     {
228 |         // Build a linked list of all the slots.
229 |         PMEMORY_SLOT pSlot = (PMEMORY_SLOT)pBlock + 1;
230 |         pBlock->pFree = NULL;
231 |         pBlock->usedCount = 0;
232 |         do
233 |         {
234 |             pSlot->pNext = pBlock->pFree;
235 |             pBlock->pFree = pSlot;
236 |             pSlot++;
237 |         } while ((ULONG_PTR)pSlot - (ULONG_PTR)pBlock <= MEMORY_BLOCK_SIZE - MEMORY_SLOT_SIZE);
238 | 
239 |         pBlock->pNext = g_pMemoryBlocks;
240 |         g_pMemoryBlocks = pBlock;
241 |     }
242 | 
243 |     return pBlock;
244 | }
245 | 
246 | //-------------------------------------------------------------------------
247 | LPVOID AllocateBuffer(LPVOID pOrigin)
248 | {
249 |     PMEMORY_SLOT  pSlot;
250 |     PMEMORY_BLOCK pBlock = GetMemoryBlock(pOrigin);
251 |     if (pBlock == NULL)
252 |         return NULL;
253 | 
254 |     // Remove an unused slot from the list.
255 |     pSlot = pBlock->pFree;
256 |     pBlock->pFree = pSlot->pNext;
257 |     pBlock->usedCount++;
258 | #ifdef _DEBUG
259 |     // Fill the slot with INT3 for debugging.
260 |     memset(pSlot, 0xCC, sizeof(MEMORY_SLOT));
261 | #endif
262 |     return pSlot;
263 | }
264 | 
265 | //-------------------------------------------------------------------------
266 | VOID FreeBuffer(LPVOID pBuffer)
267 | {
268 |     PMEMORY_BLOCK pBlock = g_pMemoryBlocks;
269 |     PMEMORY_BLOCK pPrev = NULL;
270 |     ULONG_PTR pTargetBlock = ((ULONG_PTR)pBuffer / MEMORY_BLOCK_SIZE) * MEMORY_BLOCK_SIZE;
271 | 
272 |     while (pBlock != NULL)
273 |     {
274 |         if ((ULONG_PTR)pBlock == pTargetBlock)
275 |         {
276 |             PMEMORY_SLOT pSlot = (PMEMORY_SLOT)pBuffer;
277 | #ifdef _DEBUG
278 |             // Clear the released slot for debugging.
279 |             memset(pSlot, 0x00, sizeof(MEMORY_SLOT));
280 | #endif
281 |             // Restore the released slot to the list.
282 |             pSlot->pNext = pBlock->pFree;
283 |             pBlock->pFree = pSlot;
284 |             pBlock->usedCount--;
285 | 
286 |             // Free if unused.
287 |             if (pBlock->usedCount == 0)
288 |             {
289 |                 if (pPrev)
290 |                     pPrev->pNext = pBlock->pNext;
291 |                 else
292 |                     g_pMemoryBlocks = pBlock->pNext;
293 | 
294 |                 VirtualFree(pBlock, 0, MEM_RELEASE);
295 |             }
296 | 
297 |             break;
298 |         }
299 | 
300 |         pPrev = pBlock;
301 |         pBlock = pBlock->pNext;
302 |     }
303 | }
304 | 
305 | //-------------------------------------------------------------------------
306 | BOOL IsExecutableAddress(LPVOID pAddress)
307 | {
308 |     MEMORY_BASIC_INFORMATION mi;
309 |     VirtualQuery(pAddress, &mi, sizeof(mi));
310 | 
311 |     return (mi.State == MEM_COMMIT && (mi.Protect & PAGE_EXECUTE_FLAGS));
312 | }
313 | 


--------------------------------------------------------------------------------
/src/buffer.h:
--------------------------------------------------------------------------------
 1 | /*
 2 |  *  MinHook - The Minimalistic API Hooking Library for x64/x86
 3 |  *  Copyright (C) 2009-2017 Tsuda Kageyu.
 4 |  *  All rights reserved.
 5 |  *
 6 |  *  Redistribution and use in source and binary forms, with or without
 7 |  *  modification, are permitted provided that the following conditions
 8 |  *  are met:
 9 |  *
10 |  *   1. Redistributions of source code must retain the above copyright
11 |  *      notice, this list of conditions and the following disclaimer.
12 |  *   2. Redistributions in binary form must reproduce the above copyright
13 |  *      notice, this list of conditions and the following disclaimer in the
14 |  *      documentation and/or other materials provided with the distribution.
15 |  *
16 |  *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17 |  *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
18 |  *  TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
19 |  *  PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER
20 |  *  OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21 |  *  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22 |  *  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23 |  *  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
24 |  *  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
25 |  *  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26 |  *  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 |  */
28 | 
29 | #pragma once
30 | 
31 | // Size of each memory slot.
32 | #if defined(_M_X64) || defined(__x86_64__)
33 |     #define MEMORY_SLOT_SIZE 64
34 | #else
35 |     #define MEMORY_SLOT_SIZE 32
36 | #endif
37 | 
38 | VOID   InitializeBuffer(VOID);
39 | VOID   UninitializeBuffer(VOID);
40 | LPVOID AllocateBuffer(LPVOID pOrigin);
41 | VOID   FreeBuffer(LPVOID pBuffer);
42 | BOOL   IsExecutableAddress(LPVOID pAddress);
43 | 


--------------------------------------------------------------------------------
/src/hde/hde32.c:
--------------------------------------------------------------------------------
  1 | /*
  2 |  * Hacker Disassembler Engine 32 C
  3 |  * Copyright (c) 2008-2009, Vyacheslav Patkov.
  4 |  * All rights reserved.
  5 |  *
  6 |  */
  7 | 
  8 | #if defined(_M_IX86) || defined(__i386__)
  9 | 
 10 | #include <string.h>
 11 | #include "hde32.h"
 12 | #include "table32.h"
 13 | 
 14 | unsigned int hde32_disasm(const void *code, hde32s *hs)
 15 | {
 16 |     uint8_t x, c, *p = (uint8_t *)code, cflags, opcode, pref = 0;
 17 |     uint8_t *ht = hde32_table, m_mod, m_reg, m_rm, disp_size = 0;
 18 | 
 19 |     memset(hs, 0, sizeof(hde32s));
 20 | 
 21 |     for (x = 16; x; x--)
 22 |         switch (c = *p++) {
 23 |             case 0xf3:
 24 |                 hs->p_rep = c;
 25 |                 pref |= PRE_F3;
 26 |                 break;
 27 |             case 0xf2:
 28 |                 hs->p_rep = c;
 29 |                 pref |= PRE_F2;
 30 |                 break;
 31 |             case 0xf0:
 32 |                 hs->p_lock = c;
 33 |                 pref |= PRE_LOCK;
 34 |                 break;
 35 |             case 0x26: case 0x2e: case 0x36:
 36 |             case 0x3e: case 0x64: case 0x65:
 37 |                 hs->p_seg = c;
 38 |                 pref |= PRE_SEG;
 39 |                 break;
 40 |             case 0x66:
 41 |                 hs->p_66 = c;
 42 |                 pref |= PRE_66;
 43 |                 break;
 44 |             case 0x67:
 45 |                 hs->p_67 = c;
 46 |                 pref |= PRE_67;
 47 |                 break;
 48 |             default:
 49 |                 goto pref_done;
 50 |         }
 51 |   pref_done:
 52 | 
 53 |     hs->flags = (uint32_t)pref << 23;
 54 | 
 55 |     if (!pref)
 56 |         pref |= PRE_NONE;
 57 | 
 58 |     if ((hs->opcode = c) == 0x0f) {
 59 |         hs->opcode2 = c = *p++;
 60 |         ht += DELTA_OPCODES;
 61 |     } else if (c >= 0xa0 && c <= 0xa3) {
 62 |         if (pref & PRE_67)
 63 |             pref |= PRE_66;
 64 |         else
 65 |             pref &= ~PRE_66;
 66 |     }
 67 | 
 68 |     opcode = c;
 69 |     cflags = ht[ht[opcode / 4] + (opcode % 4)];
 70 | 
 71 |     if (cflags == C_ERROR) {
 72 |         hs->flags |= F_ERROR | F_ERROR_OPCODE;
 73 |         cflags = 0;
 74 |         if ((opcode & -3) == 0x24)
 75 |             cflags++;
 76 |     }
 77 | 
 78 |     x = 0;
 79 |     if (cflags & C_GROUP) {
 80 |         uint16_t t;
 81 |         t = *(uint16_t *)(ht + (cflags & 0x7f));
 82 |         cflags = (uint8_t)t;
 83 |         x = (uint8_t)(t >> 8);
 84 |     }
 85 | 
 86 |     if (hs->opcode2) {
 87 |         ht = hde32_table + DELTA_PREFIXES;
 88 |         if (ht[ht[opcode / 4] + (opcode % 4)] & pref)
 89 |             hs->flags |= F_ERROR | F_ERROR_OPCODE;
 90 |     }
 91 | 
 92 |     if (cflags & C_MODRM) {
 93 |         hs->flags |= F_MODRM;
 94 |         hs->modrm = c = *p++;
 95 |         hs->modrm_mod = m_mod = c >> 6;
 96 |         hs->modrm_rm = m_rm = c & 7;
 97 |         hs->modrm_reg = m_reg = (c & 0x3f) >> 3;
 98 | 
 99 |         if (x && ((x << m_reg) & 0x80))
100 |             hs->flags |= F_ERROR | F_ERROR_OPCODE;
101 | 
102 |         if (!hs->opcode2 && opcode >= 0xd9 && opcode <= 0xdf) {
103 |             uint8_t t = opcode - 0xd9;
104 |             if (m_mod == 3) {
105 |                 ht = hde32_table + DELTA_FPU_MODRM + t*8;
106 |                 t = ht[m_reg] << m_rm;
107 |             } else {
108 |                 ht = hde32_table + DELTA_FPU_REG;
109 |                 t = ht[t] << m_reg;
110 |             }
111 |             if (t & 0x80)
112 |                 hs->flags |= F_ERROR | F_ERROR_OPCODE;
113 |         }
114 | 
115 |         if (pref & PRE_LOCK) {
116 |             if (m_mod == 3) {
117 |                 hs->flags |= F_ERROR | F_ERROR_LOCK;
118 |             } else {
119 |                 uint8_t *table_end, op = opcode;
120 |                 if (hs->opcode2) {
121 |                     ht = hde32_table + DELTA_OP2_LOCK_OK;
122 |                     table_end = ht + DELTA_OP_ONLY_MEM - DELTA_OP2_LOCK_OK;
123 |                 } else {
124 |                     ht = hde32_table + DELTA_OP_LOCK_OK;
125 |                     table_end = ht + DELTA_OP2_LOCK_OK - DELTA_OP_LOCK_OK;
126 |                     op &= -2;
127 |                 }
128 |                 for (; ht != table_end; ht++)
129 |                     if (*ht++ == op) {
130 |                         if (!((*ht << m_reg) & 0x80))
131 |                             goto no_lock_error;
132 |                         else
133 |                             break;
134 |                     }
135 |                 hs->flags |= F_ERROR | F_ERROR_LOCK;
136 |               no_lock_error:
137 |                 ;
138 |             }
139 |         }
140 | 
141 |         if (hs->opcode2) {
142 |             switch (opcode) {
143 |                 case 0x20: case 0x22:
144 |                     m_mod = 3;
145 |                     if (m_reg > 4 || m_reg == 1)
146 |                         goto error_operand;
147 |                     else
148 |                         goto no_error_operand;
149 |                 case 0x21: case 0x23:
150 |                     m_mod = 3;
151 |                     if (m_reg == 4 || m_reg == 5)
152 |                         goto error_operand;
153 |                     else
154 |                         goto no_error_operand;
155 |             }
156 |         } else {
157 |             switch (opcode) {
158 |                 case 0x8c:
159 |                     if (m_reg > 5)
160 |                         goto error_operand;
161 |                     else
162 |                         goto no_error_operand;
163 |                 case 0x8e:
164 |                     if (m_reg == 1 || m_reg > 5)
165 |                         goto error_operand;
166 |                     else
167 |                         goto no_error_operand;
168 |             }
169 |         }
170 | 
171 |         if (m_mod == 3) {
172 |             uint8_t *table_end;
173 |             if (hs->opcode2) {
174 |                 ht = hde32_table + DELTA_OP2_ONLY_MEM;
175 |                 table_end = ht + sizeof(hde32_table) - DELTA_OP2_ONLY_MEM;
176 |             } else {
177 |                 ht = hde32_table + DELTA_OP_ONLY_MEM;
178 |                 table_end = ht + DELTA_OP2_ONLY_MEM - DELTA_OP_ONLY_MEM;
179 |             }
180 |             for (; ht != table_end; ht += 2)
181 |                 if (*ht++ == opcode) {
182 |                     if ((*ht++ & pref) && !((*ht << m_reg) & 0x80))
183 |                         goto error_operand;
184 |                     else
185 |                         break;
186 |                 }
187 |             goto no_error_operand;
188 |         } else if (hs->opcode2) {
189 |             switch (opcode) {
190 |                 case 0x50: case 0xd7: case 0xf7:
191 |                     if (pref & (PRE_NONE | PRE_66))
192 |                         goto error_operand;
193 |                     break;
194 |                 case 0xd6:
195 |                     if (pref & (PRE_F2 | PRE_F3))
196 |                         goto error_operand;
197 |                     break;
198 |                 case 0xc5:
199 |                     goto error_operand;
200 |             }
201 |             goto no_error_operand;
202 |         } else
203 |             goto no_error_operand;
204 | 
205 |       error_operand:
206 |         hs->flags |= F_ERROR | F_ERROR_OPERAND;
207 |       no_error_operand:
208 | 
209 |         c = *p++;
210 |         if (m_reg <= 1) {
211 |             if (opcode == 0xf6)
212 |                 cflags |= C_IMM8;
213 |             else if (opcode == 0xf7)
214 |                 cflags |= C_IMM_P66;
215 |         }
216 | 
217 |         switch (m_mod) {
218 |             case 0:
219 |                 if (pref & PRE_67) {
220 |                     if (m_rm == 6)
221 |                         disp_size = 2;
222 |                 } else
223 |                     if (m_rm == 5)
224 |                         disp_size = 4;
225 |                 break;
226 |             case 1:
227 |                 disp_size = 1;
228 |                 break;
229 |             case 2:
230 |                 disp_size = 2;
231 |                 if (!(pref & PRE_67))
232 |                     disp_size <<= 1;
233 |                 break;
234 |         }
235 | 
236 |         if (m_mod != 3 && m_rm == 4 && !(pref & PRE_67)) {
237 |             hs->flags |= F_SIB;
238 |             p++;
239 |             hs->sib = c;
240 |             hs->sib_scale = c >> 6;
241 |             hs->sib_index = (c & 0x3f) >> 3;
242 |             if ((hs->sib_base = c & 7) == 5 && !(m_mod & 1))
243 |                 disp_size = 4;
244 |         }
245 | 
246 |         p--;
247 |         switch (disp_size) {
248 |             case 1:
249 |                 hs->flags |= F_DISP8;
250 |                 hs->disp.disp8 = *p;
251 |                 break;
252 |             case 2:
253 |                 hs->flags |= F_DISP16;
254 |                 hs->disp.disp16 = *(uint16_t *)p;
255 |                 break;
256 |             case 4:
257 |                 hs->flags |= F_DISP32;
258 |                 hs->disp.disp32 = *(uint32_t *)p;
259 |                 break;
260 |         }
261 |         p += disp_size;
262 |     } else if (pref & PRE_LOCK)
263 |         hs->flags |= F_ERROR | F_ERROR_LOCK;
264 | 
265 |     if (cflags & C_IMM_P66) {
266 |         if (cflags & C_REL32) {
267 |             if (pref & PRE_66) {
268 |                 hs->flags |= F_IMM16 | F_RELATIVE;
269 |                 hs->imm.imm16 = *(uint16_t *)p;
270 |                 p += 2;
271 |                 goto disasm_done;
272 |             }
273 |             goto rel32_ok;
274 |         }
275 |         if (pref & PRE_66) {
276 |             hs->flags |= F_IMM16;
277 |             hs->imm.imm16 = *(uint16_t *)p;
278 |             p += 2;
279 |         } else {
280 |             hs->flags |= F_IMM32;
281 |             hs->imm.imm32 = *(uint32_t *)p;
282 |             p += 4;
283 |         }
284 |     }
285 | 
286 |     if (cflags & C_IMM16) {
287 |         if (hs->flags & F_IMM32) {
288 |             hs->flags |= F_IMM16;
289 |             hs->disp.disp16 = *(uint16_t *)p;
290 |         } else if (hs->flags & F_IMM16) {
291 |             hs->flags |= F_2IMM16;
292 |             hs->disp.disp16 = *(uint16_t *)p;
293 |         } else {
294 |             hs->flags |= F_IMM16;
295 |             hs->imm.imm16 = *(uint16_t *)p;
296 |         }
297 |         p += 2;
298 |     }
299 |     if (cflags & C_IMM8) {
300 |         hs->flags |= F_IMM8;
301 |         hs->imm.imm8 = *p++;
302 |     }
303 | 
304 |     if (cflags & C_REL32) {
305 |       rel32_ok:
306 |         hs->flags |= F_IMM32 | F_RELATIVE;
307 |         hs->imm.imm32 = *(uint32_t *)p;
308 |         p += 4;
309 |     } else if (cflags & C_REL8) {
310 |         hs->flags |= F_IMM8 | F_RELATIVE;
311 |         hs->imm.imm8 = *p++;
312 |     }
313 | 
314 |   disasm_done:
315 | 
316 |     if ((hs->len = (uint8_t)(p-(uint8_t *)code)) > 15) {
317 |         hs->flags |= F_ERROR | F_ERROR_LENGTH;
318 |         hs->len = 15;
319 |     }
320 | 
321 |     return (unsigned int)hs->len;
322 | }
323 | 
324 | #endif // defined(_M_IX86) || defined(__i386__)
325 | 


--------------------------------------------------------------------------------
/src/hde/hde32.h:
--------------------------------------------------------------------------------
  1 | /*
  2 |  * Hacker Disassembler Engine 32
  3 |  * Copyright (c) 2006-2009, Vyacheslav Patkov.
  4 |  * All rights reserved.
  5 |  *
  6 |  * hde32.h: C/C++ header file
  7 |  *
  8 |  */
  9 | 
 10 | #ifndef _HDE32_H_
 11 | #define _HDE32_H_
 12 | 
 13 | /* stdint.h - C99 standard header
 14 |  * http://en.wikipedia.org/wiki/stdint.h
 15 |  *
 16 |  * if your compiler doesn't contain "stdint.h" header (for
 17 |  * example, Microsoft Visual C++), you can download file:
 18 |  *   http://www.azillionmonkeys.com/qed/pstdint.h
 19 |  * and change next line to:
 20 |  *   #include "pstdint.h"
 21 |  */
 22 | #include "pstdint.h"
 23 | 
 24 | #define F_MODRM         0x00000001
 25 | #define F_SIB           0x00000002
 26 | #define F_IMM8          0x00000004
 27 | #define F_IMM16         0x00000008
 28 | #define F_IMM32         0x00000010
 29 | #define F_DISP8         0x00000020
 30 | #define F_DISP16        0x00000040
 31 | #define F_DISP32        0x00000080
 32 | #define F_RELATIVE      0x00000100
 33 | #define F_2IMM16        0x00000800
 34 | #define F_ERROR         0x00001000
 35 | #define F_ERROR_OPCODE  0x00002000
 36 | #define F_ERROR_LENGTH  0x00004000
 37 | #define F_ERROR_LOCK    0x00008000
 38 | #define F_ERROR_OPERAND 0x00010000
 39 | #define F_PREFIX_REPNZ  0x01000000
 40 | #define F_PREFIX_REPX   0x02000000
 41 | #define F_PREFIX_REP    0x03000000
 42 | #define F_PREFIX_66     0x04000000
 43 | #define F_PREFIX_67     0x08000000
 44 | #define F_PREFIX_LOCK   0x10000000
 45 | #define F_PREFIX_SEG    0x20000000
 46 | #define F_PREFIX_ANY    0x3f000000
 47 | 
 48 | #define PREFIX_SEGMENT_CS   0x2e
 49 | #define PREFIX_SEGMENT_SS   0x36
 50 | #define PREFIX_SEGMENT_DS   0x3e
 51 | #define PREFIX_SEGMENT_ES   0x26
 52 | #define PREFIX_SEGMENT_FS   0x64
 53 | #define PREFIX_SEGMENT_GS   0x65
 54 | #define PREFIX_LOCK         0xf0
 55 | #define PREFIX_REPNZ        0xf2
 56 | #define PREFIX_REPX         0xf3
 57 | #define PREFIX_OPERAND_SIZE 0x66
 58 | #define PREFIX_ADDRESS_SIZE 0x67
 59 | 
 60 | #pragma pack(push,1)
 61 | 
 62 | typedef struct {
 63 |     uint8_t len;
 64 |     uint8_t p_rep;
 65 |     uint8_t p_lock;
 66 |     uint8_t p_seg;
 67 |     uint8_t p_66;
 68 |     uint8_t p_67;
 69 |     uint8_t opcode;
 70 |     uint8_t opcode2;
 71 |     uint8_t modrm;
 72 |     uint8_t modrm_mod;
 73 |     uint8_t modrm_reg;
 74 |     uint8_t modrm_rm;
 75 |     uint8_t sib;
 76 |     uint8_t sib_scale;
 77 |     uint8_t sib_index;
 78 |     uint8_t sib_base;
 79 |     union {
 80 |         uint8_t imm8;
 81 |         uint16_t imm16;
 82 |         uint32_t imm32;
 83 |     } imm;
 84 |     union {
 85 |         uint8_t disp8;
 86 |         uint16_t disp16;
 87 |         uint32_t disp32;
 88 |     } disp;
 89 |     uint32_t flags;
 90 | } hde32s;
 91 | 
 92 | #pragma pack(pop)
 93 | 
 94 | #ifdef __cplusplus
 95 | extern "C" {
 96 | #endif
 97 | 
 98 | /* __cdecl */
 99 | unsigned int hde32_disasm(const void *code, hde32s *hs);
100 | 
101 | #ifdef __cplusplus
102 | }
103 | #endif
104 | 
105 | #endif /* _HDE32_H_ */
106 | 


--------------------------------------------------------------------------------
/src/hde/hde64.c:
--------------------------------------------------------------------------------
  1 | /*
  2 |  * Hacker Disassembler Engine 64 C
  3 |  * Copyright (c) 2008-2009, Vyacheslav Patkov.
  4 |  * All rights reserved.
  5 |  *
  6 |  */
  7 | 
  8 | #if defined(_M_X64) || defined(__x86_64__)
  9 | 
 10 | #include <string.h>
 11 | #include "hde64.h"
 12 | #include "table64.h"
 13 | 
 14 | unsigned int hde64_disasm(const void *code, hde64s *hs)
 15 | {
 16 |     uint8_t x, c, *p = (uint8_t *)code, cflags, opcode, pref = 0;
 17 |     uint8_t *ht = hde64_table, m_mod, m_reg, m_rm, disp_size = 0;
 18 |     uint8_t op64 = 0;
 19 | 
 20 |     memset(hs, 0, sizeof(hde64s));
 21 | 
 22 |     for (x = 16; x; x--)
 23 |         switch (c = *p++) {
 24 |             case 0xf3:
 25 |                 hs->p_rep = c;
 26 |                 pref |= PRE_F3;
 27 |                 break;
 28 |             case 0xf2:
 29 |                 hs->p_rep = c;
 30 |                 pref |= PRE_F2;
 31 |                 break;
 32 |             case 0xf0:
 33 |                 hs->p_lock = c;
 34 |                 pref |= PRE_LOCK;
 35 |                 break;
 36 |             case 0x26: case 0x2e: case 0x36:
 37 |             case 0x3e: case 0x64: case 0x65:
 38 |                 hs->p_seg = c;
 39 |                 pref |= PRE_SEG;
 40 |                 break;
 41 |             case 0x66:
 42 |                 hs->p_66 = c;
 43 |                 pref |= PRE_66;
 44 |                 break;
 45 |             case 0x67:
 46 |                 hs->p_67 = c;
 47 |                 pref |= PRE_67;
 48 |                 break;
 49 |             default:
 50 |                 goto pref_done;
 51 |         }
 52 |   pref_done:
 53 | 
 54 |     hs->flags = (uint32_t)pref << 23;
 55 | 
 56 |     if (!pref)
 57 |         pref |= PRE_NONE;
 58 | 
 59 |     if ((c & 0xf0) == 0x40) {
 60 |         hs->flags |= F_PREFIX_REX;
 61 |         if ((hs->rex_w = (c & 0xf) >> 3) && (*p & 0xf8) == 0xb8)
 62 |             op64++;
 63 |         hs->rex_r = (c & 7) >> 2;
 64 |         hs->rex_x = (c & 3) >> 1;
 65 |         hs->rex_b = c & 1;
 66 |         if (((c = *p++) & 0xf0) == 0x40) {
 67 |             opcode = c;
 68 |             goto error_opcode;
 69 |         }
 70 |     }
 71 | 
 72 |     if ((hs->opcode = c) == 0x0f) {
 73 |         hs->opcode2 = c = *p++;
 74 |         ht += DELTA_OPCODES;
 75 |     } else if (c >= 0xa0 && c <= 0xa3) {
 76 |         op64++;
 77 |         if (pref & PRE_67)
 78 |             pref |= PRE_66;
 79 |         else
 80 |             pref &= ~PRE_66;
 81 |     }
 82 | 
 83 |     opcode = c;
 84 |     cflags = ht[ht[opcode / 4] + (opcode % 4)];
 85 | 
 86 |     if (cflags == C_ERROR) {
 87 |       error_opcode:
 88 |         hs->flags |= F_ERROR | F_ERROR_OPCODE;
 89 |         cflags = 0;
 90 |         if ((opcode & -3) == 0x24)
 91 |             cflags++;
 92 |     }
 93 | 
 94 |     x = 0;
 95 |     if (cflags & C_GROUP) {
 96 |         uint16_t t;
 97 |         t = *(uint16_t *)(ht + (cflags & 0x7f));
 98 |         cflags = (uint8_t)t;
 99 |         x = (uint8_t)(t >> 8);
100 |     }
101 | 
102 |     if (hs->opcode2) {
103 |         ht = hde64_table + DELTA_PREFIXES;
104 |         if (ht[ht[opcode / 4] + (opcode % 4)] & pref)
105 |             hs->flags |= F_ERROR | F_ERROR_OPCODE;
106 |     }
107 | 
108 |     if (cflags & C_MODRM) {
109 |         hs->flags |= F_MODRM;
110 |         hs->modrm = c = *p++;
111 |         hs->modrm_mod = m_mod = c >> 6;
112 |         hs->modrm_rm = m_rm = c & 7;
113 |         hs->modrm_reg = m_reg = (c & 0x3f) >> 3;
114 | 
115 |         if (x && ((x << m_reg) & 0x80))
116 |             hs->flags |= F_ERROR | F_ERROR_OPCODE;
117 | 
118 |         if (!hs->opcode2 && opcode >= 0xd9 && opcode <= 0xdf) {
119 |             uint8_t t = opcode - 0xd9;
120 |             if (m_mod == 3) {
121 |                 ht = hde64_table + DELTA_FPU_MODRM + t*8;
122 |                 t = ht[m_reg] << m_rm;
123 |             } else {
124 |                 ht = hde64_table + DELTA_FPU_REG;
125 |                 t = ht[t] << m_reg;
126 |             }
127 |             if (t & 0x80)
128 |                 hs->flags |= F_ERROR | F_ERROR_OPCODE;
129 |         }
130 | 
131 |         if (pref & PRE_LOCK) {
132 |             if (m_mod == 3) {
133 |                 hs->flags |= F_ERROR | F_ERROR_LOCK;
134 |             } else {
135 |                 uint8_t *table_end, op = opcode;
136 |                 if (hs->opcode2) {
137 |                     ht = hde64_table + DELTA_OP2_LOCK_OK;
138 |                     table_end = ht + DELTA_OP_ONLY_MEM - DELTA_OP2_LOCK_OK;
139 |                 } else {
140 |                     ht = hde64_table + DELTA_OP_LOCK_OK;
141 |                     table_end = ht + DELTA_OP2_LOCK_OK - DELTA_OP_LOCK_OK;
142 |                     op &= -2;
143 |                 }
144 |                 for (; ht != table_end; ht++)
145 |                     if (*ht++ == op) {
146 |                         if (!((*ht << m_reg) & 0x80))
147 |                             goto no_lock_error;
148 |                         else
149 |                             break;
150 |                     }
151 |                 hs->flags |= F_ERROR | F_ERROR_LOCK;
152 |               no_lock_error:
153 |                 ;
154 |             }
155 |         }
156 | 
157 |         if (hs->opcode2) {
158 |             switch (opcode) {
159 |                 case 0x20: case 0x22:
160 |                     m_mod = 3;
161 |                     if (m_reg > 4 || m_reg == 1)
162 |                         goto error_operand;
163 |                     else
164 |                         goto no_error_operand;
165 |                 case 0x21: case 0x23:
166 |                     m_mod = 3;
167 |                     if (m_reg == 4 || m_reg == 5)
168 |                         goto error_operand;
169 |                     else
170 |                         goto no_error_operand;
171 |             }
172 |         } else {
173 |             switch (opcode) {
174 |                 case 0x8c:
175 |                     if (m_reg > 5)
176 |                         goto error_operand;
177 |                     else
178 |                         goto no_error_operand;
179 |                 case 0x8e:
180 |                     if (m_reg == 1 || m_reg > 5)
181 |                         goto error_operand;
182 |                     else
183 |                         goto no_error_operand;
184 |             }
185 |         }
186 | 
187 |         if (m_mod == 3) {
188 |             uint8_t *table_end;
189 |             if (hs->opcode2) {
190 |                 ht = hde64_table + DELTA_OP2_ONLY_MEM;
191 |                 table_end = ht + sizeof(hde64_table) - DELTA_OP2_ONLY_MEM;
192 |             } else {
193 |                 ht = hde64_table + DELTA_OP_ONLY_MEM;
194 |                 table_end = ht + DELTA_OP2_ONLY_MEM - DELTA_OP_ONLY_MEM;
195 |             }
196 |             for (; ht != table_end; ht += 2)
197 |                 if (*ht++ == opcode) {
198 |                     if ((*ht++ & pref) && !((*ht << m_reg) & 0x80))
199 |                         goto error_operand;
200 |                     else
201 |                         break;
202 |                 }
203 |             goto no_error_operand;
204 |         } else if (hs->opcode2) {
205 |             switch (opcode) {
206 |                 case 0x50: case 0xd7: case 0xf7:
207 |                     if (pref & (PRE_NONE | PRE_66))
208 |                         goto error_operand;
209 |                     break;
210 |                 case 0xd6:
211 |                     if (pref & (PRE_F2 | PRE_F3))
212 |                         goto error_operand;
213 |                     break;
214 |                 case 0xc5:
215 |                     goto error_operand;
216 |             }
217 |             goto no_error_operand;
218 |         } else
219 |             goto no_error_operand;
220 | 
221 |       error_operand:
222 |         hs->flags |= F_ERROR | F_ERROR_OPERAND;
223 |       no_error_operand:
224 | 
225 |         c = *p++;
226 |         if (m_reg <= 1) {
227 |             if (opcode == 0xf6)
228 |                 cflags |= C_IMM8;
229 |             else if (opcode == 0xf7)
230 |                 cflags |= C_IMM_P66;
231 |         }
232 | 
233 |         switch (m_mod) {
234 |             case 0:
235 |                 if (pref & PRE_67) {
236 |                     if (m_rm == 6)
237 |                         disp_size = 2;
238 |                 } else
239 |                     if (m_rm == 5)
240 |                         disp_size = 4;
241 |                 break;
242 |             case 1:
243 |                 disp_size = 1;
244 |                 break;
245 |             case 2:
246 |                 disp_size = 2;
247 |                 if (!(pref & PRE_67))
248 |                     disp_size <<= 1;
249 |                 break;
250 |         }
251 | 
252 |         if (m_mod != 3 && m_rm == 4) {
253 |             hs->flags |= F_SIB;
254 |             p++;
255 |             hs->sib = c;
256 |             hs->sib_scale = c >> 6;
257 |             hs->sib_index = (c & 0x3f) >> 3;
258 |             if ((hs->sib_base = c & 7) == 5 && !(m_mod & 1))
259 |                 disp_size = 4;
260 |         }
261 | 
262 |         p--;
263 |         switch (disp_size) {
264 |             case 1:
265 |                 hs->flags |= F_DISP8;
266 |                 hs->disp.disp8 = *p;
267 |                 break;
268 |             case 2:
269 |                 hs->flags |= F_DISP16;
270 |                 hs->disp.disp16 = *(uint16_t *)p;
271 |                 break;
272 |             case 4:
273 |                 hs->flags |= F_DISP32;
274 |                 hs->disp.disp32 = *(uint32_t *)p;
275 |                 break;
276 |         }
277 |         p += disp_size;
278 |     } else if (pref & PRE_LOCK)
279 |         hs->flags |= F_ERROR | F_ERROR_LOCK;
280 | 
281 |     if (cflags & C_IMM_P66) {
282 |         if (cflags & C_REL32) {
283 |             if (pref & PRE_66) {
284 |                 hs->flags |= F_IMM16 | F_RELATIVE;
285 |                 hs->imm.imm16 = *(uint16_t *)p;
286 |                 p += 2;
287 |                 goto disasm_done;
288 |             }
289 |             goto rel32_ok;
290 |         }
291 |         if (op64) {
292 |             hs->flags |= F_IMM64;
293 |             hs->imm.imm64 = *(uint64_t *)p;
294 |             p += 8;
295 |         } else if (!(pref & PRE_66)) {
296 |             hs->flags |= F_IMM32;
297 |             hs->imm.imm32 = *(uint32_t *)p;
298 |             p += 4;
299 |         } else
300 |             goto imm16_ok;
301 |     }
302 | 
303 | 
304 |     if (cflags & C_IMM16) {
305 |       imm16_ok:
306 |         hs->flags |= F_IMM16;
307 |         hs->imm.imm16 = *(uint16_t *)p;
308 |         p += 2;
309 |     }
310 |     if (cflags & C_IMM8) {
311 |         hs->flags |= F_IMM8;
312 |         hs->imm.imm8 = *p++;
313 |     }
314 | 
315 |     if (cflags & C_REL32) {
316 |       rel32_ok:
317 |         hs->flags |= F_IMM32 | F_RELATIVE;
318 |         hs->imm.imm32 = *(uint32_t *)p;
319 |         p += 4;
320 |     } else if (cflags & C_REL8) {
321 |         hs->flags |= F_IMM8 | F_RELATIVE;
322 |         hs->imm.imm8 = *p++;
323 |     }
324 | 
325 |   disasm_done:
326 | 
327 |     if ((hs->len = (uint8_t)(p-(uint8_t *)code)) > 15) {
328 |         hs->flags |= F_ERROR | F_ERROR_LENGTH;
329 |         hs->len = 15;
330 |     }
331 | 
332 |     return (unsigned int)hs->len;
333 | }
334 | 
335 | #endif // defined(_M_X64) || defined(__x86_64__)
336 | 


--------------------------------------------------------------------------------
/src/hde/hde64.h:
--------------------------------------------------------------------------------
  1 | /*
  2 |  * Hacker Disassembler Engine 64
  3 |  * Copyright (c) 2008-2009, Vyacheslav Patkov.
  4 |  * All rights reserved.
  5 |  *
  6 |  * hde64.h: C/C++ header file
  7 |  *
  8 |  */
  9 | 
 10 | #ifndef _HDE64_H_
 11 | #define _HDE64_H_
 12 | 
 13 | /* stdint.h - C99 standard header
 14 |  * http://en.wikipedia.org/wiki/stdint.h
 15 |  *
 16 |  * if your compiler doesn't contain "stdint.h" header (for
 17 |  * example, Microsoft Visual C++), you can download file:
 18 |  *   http://www.azillionmonkeys.com/qed/pstdint.h
 19 |  * and change next line to:
 20 |  *   #include "pstdint.h"
 21 |  */
 22 | #include "pstdint.h"
 23 | 
 24 | #define F_MODRM         0x00000001
 25 | #define F_SIB           0x00000002
 26 | #define F_IMM8          0x00000004
 27 | #define F_IMM16         0x00000008
 28 | #define F_IMM32         0x00000010
 29 | #define F_IMM64         0x00000020
 30 | #define F_DISP8         0x00000040
 31 | #define F_DISP16        0x00000080
 32 | #define F_DISP32        0x00000100
 33 | #define F_RELATIVE      0x00000200
 34 | #define F_ERROR         0x00001000
 35 | #define F_ERROR_OPCODE  0x00002000
 36 | #define F_ERROR_LENGTH  0x00004000
 37 | #define F_ERROR_LOCK    0x00008000
 38 | #define F_ERROR_OPERAND 0x00010000
 39 | #define F_PREFIX_REPNZ  0x01000000
 40 | #define F_PREFIX_REPX   0x02000000
 41 | #define F_PREFIX_REP    0x03000000
 42 | #define F_PREFIX_66     0x04000000
 43 | #define F_PREFIX_67     0x08000000
 44 | #define F_PREFIX_LOCK   0x10000000
 45 | #define F_PREFIX_SEG    0x20000000
 46 | #define F_PREFIX_REX    0x40000000
 47 | #define F_PREFIX_ANY    0x7f000000
 48 | 
 49 | #define PREFIX_SEGMENT_CS   0x2e
 50 | #define PREFIX_SEGMENT_SS   0x36
 51 | #define PREFIX_SEGMENT_DS   0x3e
 52 | #define PREFIX_SEGMENT_ES   0x26
 53 | #define PREFIX_SEGMENT_FS   0x64
 54 | #define PREFIX_SEGMENT_GS   0x65
 55 | #define PREFIX_LOCK         0xf0
 56 | #define PREFIX_REPNZ        0xf2
 57 | #define PREFIX_REPX         0xf3
 58 | #define PREFIX_OPERAND_SIZE 0x66
 59 | #define PREFIX_ADDRESS_SIZE 0x67
 60 | 
 61 | #pragma pack(push,1)
 62 | 
 63 | typedef struct {
 64 |     uint8_t len;
 65 |     uint8_t p_rep;
 66 |     uint8_t p_lock;
 67 |     uint8_t p_seg;
 68 |     uint8_t p_66;
 69 |     uint8_t p_67;
 70 |     uint8_t rex;
 71 |     uint8_t rex_w;
 72 |     uint8_t rex_r;
 73 |     uint8_t rex_x;
 74 |     uint8_t rex_b;
 75 |     uint8_t opcode;
 76 |     uint8_t opcode2;
 77 |     uint8_t modrm;
 78 |     uint8_t modrm_mod;
 79 |     uint8_t modrm_reg;
 80 |     uint8_t modrm_rm;
 81 |     uint8_t sib;
 82 |     uint8_t sib_scale;
 83 |     uint8_t sib_index;
 84 |     uint8_t sib_base;
 85 |     union {
 86 |         uint8_t imm8;
 87 |         uint16_t imm16;
 88 |         uint32_t imm32;
 89 |         uint64_t imm64;
 90 |     } imm;
 91 |     union {
 92 |         uint8_t disp8;
 93 |         uint16_t disp16;
 94 |         uint32_t disp32;
 95 |     } disp;
 96 |     uint32_t flags;
 97 | } hde64s;
 98 | 
 99 | #pragma pack(pop)
100 | 
101 | #ifdef __cplusplus
102 | extern "C" {
103 | #endif
104 | 
105 | /* __cdecl */
106 | unsigned int hde64_disasm(const void *code, hde64s *hs);
107 | 
108 | #ifdef __cplusplus
109 | }
110 | #endif
111 | 
112 | #endif /* _HDE64_H_ */
113 | 


--------------------------------------------------------------------------------
/src/hde/pstdint.h:
--------------------------------------------------------------------------------
 1 | /*
 2 |  *  MinHook - The Minimalistic API Hooking Library for x64/x86
 3 |  *  Copyright (C) 2009-2017 Tsuda Kageyu. All rights reserved.
 4 |  *
 5 |  *  Redistribution and use in source and binary forms, with or without
 6 |  *  modification, are permitted provided that the following conditions
 7 |  *  are met:
 8 |  *
 9 |  *  1. Redistributions of source code must retain the above copyright
10 |  *     notice, this list of conditions and the following disclaimer.
11 |  *  2. Redistributions in binary form must reproduce the above copyright
12 |  *     notice, this list of conditions and the following disclaimer in the
13 |  *     documentation and/or other materials provided with the distribution.
14 |  *
15 |  *  THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR
16 |  *  IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17 |  *  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18 |  *  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19 |  *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20 |  *  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 |  *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 |  *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 |  *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 |  *  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 |  */
26 | 
27 | #pragma once
28 | 
29 | #include <windows.h>
30 | 
31 | // Integer types for HDE.
32 | typedef INT8   int8_t;
33 | typedef INT16  int16_t;
34 | typedef INT32  int32_t;
35 | typedef INT64  int64_t;
36 | typedef UINT8  uint8_t;
37 | typedef UINT16 uint16_t;
38 | typedef UINT32 uint32_t;
39 | typedef UINT64 uint64_t;
40 | 


--------------------------------------------------------------------------------
/src/hde/table32.h:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Hacker Disassembler Engine 32 C
 3 |  * Copyright (c) 2008-2009, Vyacheslav Patkov.
 4 |  * All rights reserved.
 5 |  *
 6 |  */
 7 | 
 8 | #define C_NONE    0x00
 9 | #define C_MODRM   0x01
10 | #define C_IMM8    0x02
11 | #define C_IMM16   0x04
12 | #define C_IMM_P66 0x10
13 | #define C_REL8    0x20
14 | #define C_REL32   0x40
15 | #define C_GROUP   0x80
16 | #define C_ERROR   0xff
17 | 
18 | #define PRE_ANY  0x00
19 | #define PRE_NONE 0x01
20 | #define PRE_F2   0x02
21 | #define PRE_F3   0x04
22 | #define PRE_66   0x08
23 | #define PRE_67   0x10
24 | #define PRE_LOCK 0x20
25 | #define PRE_SEG  0x40
26 | #define PRE_ALL  0xff
27 | 
28 | #define DELTA_OPCODES      0x4a
29 | #define DELTA_FPU_REG      0xf1
30 | #define DELTA_FPU_MODRM    0xf8
31 | #define DELTA_PREFIXES     0x130
32 | #define DELTA_OP_LOCK_OK   0x1a1
33 | #define DELTA_OP2_LOCK_OK  0x1b9
34 | #define DELTA_OP_ONLY_MEM  0x1cb
35 | #define DELTA_OP2_ONLY_MEM 0x1da
36 | 
37 | unsigned char hde32_table[] = {
38 |   0xa3,0xa8,0xa3,0xa8,0xa3,0xa8,0xa3,0xa8,0xa3,0xa8,0xa3,0xa8,0xa3,0xa8,0xa3,
39 |   0xa8,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xac,0xaa,0xb2,0xaa,0x9f,0x9f,
40 |   0x9f,0x9f,0xb5,0xa3,0xa3,0xa4,0xaa,0xaa,0xba,0xaa,0x96,0xaa,0xa8,0xaa,0xc3,
41 |   0xc3,0x96,0x96,0xb7,0xae,0xd6,0xbd,0xa3,0xc5,0xa3,0xa3,0x9f,0xc3,0x9c,0xaa,
42 |   0xaa,0xac,0xaa,0xbf,0x03,0x7f,0x11,0x7f,0x01,0x7f,0x01,0x3f,0x01,0x01,0x90,
43 |   0x82,0x7d,0x97,0x59,0x59,0x59,0x59,0x59,0x7f,0x59,0x59,0x60,0x7d,0x7f,0x7f,
44 |   0x59,0x59,0x59,0x59,0x59,0x59,0x59,0x59,0x59,0x59,0x59,0x59,0x9a,0x88,0x7d,
45 |   0x59,0x50,0x50,0x50,0x50,0x59,0x59,0x59,0x59,0x61,0x94,0x61,0x9e,0x59,0x59,
46 |   0x85,0x59,0x92,0xa3,0x60,0x60,0x59,0x59,0x59,0x59,0x59,0x59,0x59,0x59,0x59,
47 |   0x59,0x59,0x9f,0x01,0x03,0x01,0x04,0x03,0xd5,0x03,0xcc,0x01,0xbc,0x03,0xf0,
48 |   0x10,0x10,0x10,0x10,0x50,0x50,0x50,0x50,0x14,0x20,0x20,0x20,0x20,0x01,0x01,
49 |   0x01,0x01,0xc4,0x02,0x10,0x00,0x00,0x00,0x00,0x01,0x01,0xc0,0xc2,0x10,0x11,
50 |   0x02,0x03,0x11,0x03,0x03,0x04,0x00,0x00,0x14,0x00,0x02,0x00,0x00,0xc6,0xc8,
51 |   0x02,0x02,0x02,0x02,0x00,0x00,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0xff,0xca,
52 |   0x01,0x01,0x01,0x00,0x06,0x00,0x04,0x00,0xc0,0xc2,0x01,0x01,0x03,0x01,0xff,
53 |   0xff,0x01,0x00,0x03,0xc4,0xc4,0xc6,0x03,0x01,0x01,0x01,0xff,0x03,0x03,0x03,
54 |   0xc8,0x40,0x00,0x0a,0x00,0x04,0x00,0x00,0x00,0x00,0x7f,0x00,0x33,0x01,0x00,
55 |   0x00,0x00,0x00,0x00,0x00,0xff,0xbf,0xff,0xff,0x00,0x00,0x00,0x00,0x07,0x00,
56 |   0x00,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
57 |   0x00,0xff,0xff,0x00,0x00,0x00,0xbf,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
58 |   0x7f,0x00,0x00,0xff,0x4a,0x4a,0x4a,0x4a,0x4b,0x52,0x4a,0x4a,0x4a,0x4a,0x4f,
59 |   0x4c,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,0x55,0x45,0x40,0x4a,0x4a,0x4a,
60 |   0x45,0x59,0x4d,0x46,0x4a,0x5d,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,
61 |   0x4a,0x4a,0x4a,0x4a,0x4a,0x61,0x63,0x67,0x4e,0x4a,0x4a,0x6b,0x6d,0x4a,0x4a,
62 |   0x45,0x6d,0x4a,0x4a,0x44,0x45,0x4a,0x4a,0x00,0x00,0x00,0x02,0x0d,0x06,0x06,
63 |   0x06,0x06,0x0e,0x00,0x00,0x00,0x00,0x06,0x06,0x06,0x00,0x06,0x06,0x02,0x06,
64 |   0x00,0x0a,0x0a,0x07,0x07,0x06,0x02,0x05,0x05,0x02,0x02,0x00,0x00,0x04,0x04,
65 |   0x04,0x04,0x00,0x00,0x00,0x0e,0x05,0x06,0x06,0x06,0x01,0x06,0x00,0x00,0x08,
66 |   0x00,0x10,0x00,0x18,0x00,0x20,0x00,0x28,0x00,0x30,0x00,0x80,0x01,0x82,0x01,
67 |   0x86,0x00,0xf6,0xcf,0xfe,0x3f,0xab,0x00,0xb0,0x00,0xb1,0x00,0xb3,0x00,0xba,
68 |   0xf8,0xbb,0x00,0xc0,0x00,0xc1,0x00,0xc7,0xbf,0x62,0xff,0x00,0x8d,0xff,0x00,
69 |   0xc4,0xff,0x00,0xc5,0xff,0x00,0xff,0xff,0xeb,0x01,0xff,0x0e,0x12,0x08,0x00,
70 |   0x13,0x09,0x00,0x16,0x08,0x00,0x17,0x09,0x00,0x2b,0x09,0x00,0xae,0xff,0x07,
71 |   0xb2,0xff,0x00,0xb4,0xff,0x00,0xb5,0xff,0x00,0xc3,0x01,0x00,0xc7,0xff,0xbf,
72 |   0xe7,0x08,0x00,0xf0,0x02,0x00
73 | };
74 | 


--------------------------------------------------------------------------------
/src/hde/table64.h:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Hacker Disassembler Engine 64 C
 3 |  * Copyright (c) 2008-2009, Vyacheslav Patkov.
 4 |  * All rights reserved.
 5 |  *
 6 |  */
 7 | 
 8 | #define C_NONE    0x00
 9 | #define C_MODRM   0x01
10 | #define C_IMM8    0x02
11 | #define C_IMM16   0x04
12 | #define C_IMM_P66 0x10
13 | #define C_REL8    0x20
14 | #define C_REL32   0x40
15 | #define C_GROUP   0x80
16 | #define C_ERROR   0xff
17 | 
18 | #define PRE_ANY  0x00
19 | #define PRE_NONE 0x01
20 | #define PRE_F2   0x02
21 | #define PRE_F3   0x04
22 | #define PRE_66   0x08
23 | #define PRE_67   0x10
24 | #define PRE_LOCK 0x20
25 | #define PRE_SEG  0x40
26 | #define PRE_ALL  0xff
27 | 
28 | #define DELTA_OPCODES      0x4a
29 | #define DELTA_FPU_REG      0xfd
30 | #define DELTA_FPU_MODRM    0x104
31 | #define DELTA_PREFIXES     0x13c
32 | #define DELTA_OP_LOCK_OK   0x1ae
33 | #define DELTA_OP2_LOCK_OK  0x1c6
34 | #define DELTA_OP_ONLY_MEM  0x1d8
35 | #define DELTA_OP2_ONLY_MEM 0x1e7
36 | 
37 | unsigned char hde64_table[] = {
38 |   0xa5,0xaa,0xa5,0xb8,0xa5,0xaa,0xa5,0xaa,0xa5,0xb8,0xa5,0xb8,0xa5,0xb8,0xa5,
39 |   0xb8,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xac,0xc0,0xcc,0xc0,0xa1,0xa1,
40 |   0xa1,0xa1,0xb1,0xa5,0xa5,0xa6,0xc0,0xc0,0xd7,0xda,0xe0,0xc0,0xe4,0xc0,0xea,
41 |   0xea,0xe0,0xe0,0x98,0xc8,0xee,0xf1,0xa5,0xd3,0xa5,0xa5,0xa1,0xea,0x9e,0xc0,
42 |   0xc0,0xc2,0xc0,0xe6,0x03,0x7f,0x11,0x7f,0x01,0x7f,0x01,0x3f,0x01,0x01,0xab,
43 |   0x8b,0x90,0x64,0x5b,0x5b,0x5b,0x5b,0x5b,0x92,0x5b,0x5b,0x76,0x90,0x92,0x92,
44 |   0x5b,0x5b,0x5b,0x5b,0x5b,0x5b,0x5b,0x5b,0x5b,0x5b,0x5b,0x5b,0x6a,0x73,0x90,
45 |   0x5b,0x52,0x52,0x52,0x52,0x5b,0x5b,0x5b,0x5b,0x77,0x7c,0x77,0x85,0x5b,0x5b,
46 |   0x70,0x5b,0x7a,0xaf,0x76,0x76,0x5b,0x5b,0x5b,0x5b,0x5b,0x5b,0x5b,0x5b,0x5b,
47 |   0x5b,0x5b,0x86,0x01,0x03,0x01,0x04,0x03,0xd5,0x03,0xd5,0x03,0xcc,0x01,0xbc,
48 |   0x03,0xf0,0x03,0x03,0x04,0x00,0x50,0x50,0x50,0x50,0xff,0x20,0x20,0x20,0x20,
49 |   0x01,0x01,0x01,0x01,0xc4,0x02,0x10,0xff,0xff,0xff,0x01,0x00,0x03,0x11,0xff,
50 |   0x03,0xc4,0xc6,0xc8,0x02,0x10,0x00,0xff,0xcc,0x01,0x01,0x01,0x00,0x00,0x00,
51 |   0x00,0x01,0x01,0x03,0x01,0xff,0xff,0xc0,0xc2,0x10,0x11,0x02,0x03,0x01,0x01,
52 |   0x01,0xff,0xff,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0xff,0xff,0xff,0xff,0x10,
53 |   0x10,0x10,0x10,0x02,0x10,0x00,0x00,0xc6,0xc8,0x02,0x02,0x02,0x02,0x06,0x00,
54 |   0x04,0x00,0x02,0xff,0x00,0xc0,0xc2,0x01,0x01,0x03,0x03,0x03,0xca,0x40,0x00,
55 |   0x0a,0x00,0x04,0x00,0x00,0x00,0x00,0x7f,0x00,0x33,0x01,0x00,0x00,0x00,0x00,
56 |   0x00,0x00,0xff,0xbf,0xff,0xff,0x00,0x00,0x00,0x00,0x07,0x00,0x00,0xff,0x00,
57 |   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,
58 |   0x00,0x00,0x00,0xbf,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7f,0x00,0x00,
59 |   0xff,0x40,0x40,0x40,0x40,0x41,0x49,0x40,0x40,0x40,0x40,0x4c,0x42,0x40,0x40,
60 |   0x40,0x40,0x40,0x40,0x40,0x40,0x4f,0x44,0x53,0x40,0x40,0x40,0x44,0x57,0x43,
61 |   0x5c,0x40,0x60,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
62 |   0x40,0x40,0x64,0x66,0x6e,0x6b,0x40,0x40,0x6a,0x46,0x40,0x40,0x44,0x46,0x40,
63 |   0x40,0x5b,0x44,0x40,0x40,0x00,0x00,0x00,0x00,0x06,0x06,0x06,0x06,0x01,0x06,
64 |   0x06,0x02,0x06,0x06,0x00,0x06,0x00,0x0a,0x0a,0x00,0x00,0x00,0x02,0x07,0x07,
65 |   0x06,0x02,0x0d,0x06,0x06,0x06,0x0e,0x05,0x05,0x02,0x02,0x00,0x00,0x04,0x04,
66 |   0x04,0x04,0x05,0x06,0x06,0x06,0x00,0x00,0x00,0x0e,0x00,0x00,0x08,0x00,0x10,
67 |   0x00,0x18,0x00,0x20,0x00,0x28,0x00,0x30,0x00,0x80,0x01,0x82,0x01,0x86,0x00,
68 |   0xf6,0xcf,0xfe,0x3f,0xab,0x00,0xb0,0x00,0xb1,0x00,0xb3,0x00,0xba,0xf8,0xbb,
69 |   0x00,0xc0,0x00,0xc1,0x00,0xc7,0xbf,0x62,0xff,0x00,0x8d,0xff,0x00,0xc4,0xff,
70 |   0x00,0xc5,0xff,0x00,0xff,0xff,0xeb,0x01,0xff,0x0e,0x12,0x08,0x00,0x13,0x09,
71 |   0x00,0x16,0x08,0x00,0x17,0x09,0x00,0x2b,0x09,0x00,0xae,0xff,0x07,0xb2,0xff,
72 |   0x00,0xb4,0xff,0x00,0xb5,0xff,0x00,0xc3,0x01,0x00,0xc7,0xff,0xbf,0xe7,0x08,
73 |   0x00,0xf0,0x02,0x00
74 | };
75 | 


--------------------------------------------------------------------------------
/src/trampoline.h:
--------------------------------------------------------------------------------
  1 | /*
  2 |  *  MinHook - The Minimalistic API Hooking Library for x64/x86
  3 |  *  Copyright (C) 2009-2017 Tsuda Kageyu.
  4 |  *  All rights reserved.
  5 |  *
  6 |  *  Redistribution and use in source and binary forms, with or without
  7 |  *  modification, are permitted provided that the following conditions
  8 |  *  are met:
  9 |  *
 10 |  *   1. Redistributions of source code must retain the above copyright
 11 |  *      notice, this list of conditions and the following disclaimer.
 12 |  *   2. Redistributions in binary form must reproduce the above copyright
 13 |  *      notice, this list of conditions and the following disclaimer in the
 14 |  *      documentation and/or other materials provided with the distribution.
 15 |  *
 16 |  *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 17 |  *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
 18 |  *  TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
 19 |  *  PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER
 20 |  *  OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 21 |  *  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 22 |  *  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 23 |  *  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
 24 |  *  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 25 |  *  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 26 |  *  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 27 |  */
 28 | 
 29 | #pragma once
 30 | 
 31 | #pragma pack(push, 1)
 32 | 
 33 | // Structs for writing x86/x64 instructions.
 34 | 
 35 | // 8-bit relative jump.
 36 | typedef struct _JMP_REL_SHORT
 37 | {
 38 |     UINT8  opcode;      // EB xx: JMP +2+xx
 39 |     INT8   operand;     // Relative destination address
 40 | } JMP_REL_SHORT, *PJMP_REL_SHORT;
 41 | 
 42 | // 32-bit direct relative jump/call.
 43 | typedef struct _JMP_REL
 44 | {
 45 |     UINT8  opcode;      // E9/E8 xxxxxxxx: JMP/CALL +5+xxxxxxxx
 46 |     INT32  operand;     // Relative destination address
 47 | } JMP_REL, *PJMP_REL, CALL_REL;
 48 | 
 49 | // 64-bit indirect absolute jump.
 50 | typedef struct _JMP_ABS
 51 | {
 52 |     UINT8  opcode0;     // FF25 00000000: JMP [+6]
 53 |     UINT8  opcode1;
 54 |     UINT32 dummy;
 55 |     UINT64 address;     // Absolute destination address
 56 | } JMP_ABS, *PJMP_ABS;
 57 | 
 58 | // 64-bit indirect absolute call.
 59 | typedef struct _CALL_ABS
 60 | {
 61 |     UINT8  opcode0;     // FF15 00000002: CALL [+6]
 62 |     UINT8  opcode1;
 63 |     UINT32 dummy0;
 64 |     UINT8  dummy1;      // EB 08:         JMP +10
 65 |     UINT8  dummy2;
 66 |     UINT64 address;     // Absolute destination address
 67 | } CALL_ABS;
 68 | 
 69 | // 32-bit direct relative conditional jumps.
 70 | typedef struct _JCC_REL
 71 | {
 72 |     UINT8  opcode0;     // 0F8* xxxxxxxx: J** +6+xxxxxxxx
 73 |     UINT8  opcode1;
 74 |     INT32  operand;     // Relative destination address
 75 | } JCC_REL;
 76 | 
 77 | // 64bit indirect absolute conditional jumps that x64 lacks.
 78 | typedef struct _JCC_ABS
 79 | {
 80 |     UINT8  opcode;      // 7* 0E:         J** +16
 81 |     UINT8  dummy0;
 82 |     UINT8  dummy1;      // FF25 00000000: JMP [+6]
 83 |     UINT8  dummy2;
 84 |     UINT32 dummy3;
 85 |     UINT64 address;     // Absolute destination address
 86 | } JCC_ABS;
 87 | 
 88 | #pragma pack(pop)
 89 | 
 90 | typedef struct _TRAMPOLINE
 91 | {
 92 |     LPVOID pTarget;         // [In] Address of the target function.
 93 |     LPVOID pDetour;         // [In] Address of the detour function.
 94 |     LPVOID pTrampoline;     // [In] Buffer address for the trampoline and relay function.
 95 | 
 96 | #if defined(_M_X64) || defined(__x86_64__)
 97 |     LPVOID pRelay;          // [Out] Address of the relay function.
 98 | #endif
 99 |     BOOL   patchAbove;      // [Out] Should use the hot patch area?
100 |     UINT   nIP;             // [Out] Number of the instruction boundaries.
101 |     UINT8  oldIPs[8];       // [Out] Instruction boundaries of the target function.
102 |     UINT8  newIPs[8];       // [Out] Instruction boundaries of the trampoline function.
103 | } TRAMPOLINE, *PTRAMPOLINE;
104 | 
105 | BOOL CreateTrampolineFunction(PTRAMPOLINE ct);
106 | 


--------------------------------------------------------------------------------