Compare commits
42 commits
Author | SHA1 | Date | |
---|---|---|---|
e463304365 | |||
409d223465 | |||
6caa8027d2 | |||
9e486fc986 | |||
e8db5d2923 | |||
9c5f81cc27 | |||
7619ef4806 | |||
0bf518084a | |||
31d3d351a9 | |||
5626c52c43 | |||
09d3764182 | |||
6017b1c08f | |||
3f5d4d4737 | |||
3bca88bd72 | |||
2249c4cdb0 | |||
240ee9a015 | |||
511e343535 | |||
e9bbbf04b5 | |||
308d4a9464 | |||
6723a31b6a | |||
e8c64649b5 | |||
ee30d54edb | |||
8898ba5013 | |||
94be154c77 | |||
53cbce83a2 | |||
5a551b80b9 | |||
3a844cc3ca | |||
d389cc6dec | |||
2001b94945 | |||
60f6031179 | |||
f2c53b9735 | |||
e15529e67e | |||
ab6ac13193 | |||
0f979f605e | |||
f509ae388c | |||
40a58d87ff | |||
2527648360 | |||
d6a53cc49c | |||
e0e756333f | |||
40c3bf9146 | |||
ddd5ab099d | |||
7b2cc88717 |
6
.gitmodules
vendored
Normal file
6
.gitmodules
vendored
Normal file
|
@ -0,0 +1,6 @@
|
|||
[submodule "Deps/MinHook"]
|
||||
path = Deps/MinHook
|
||||
url = https://github.com/TsudaKageyu/minhook.git
|
||||
[submodule "Deps/spdlog"]
|
||||
path = Deps/spdlog
|
||||
url = https://github.com/gabime/spdlog.git
|
139
Common/Logger.h
139
Common/Logger.h
|
@ -1,139 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
#include <io.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#include "StringUtil.h"
|
||||
#include "WinUtil.h"
|
||||
|
||||
#ifndef LOGGER_DISABLE
|
||||
class Logger
|
||||
{
|
||||
public:
|
||||
std::mutex printLogMutex;
|
||||
Logger(const Logger&) = delete;
|
||||
const Logger& operator=(Logger& other) = delete;
|
||||
|
||||
Logger() : m_systime(), m_console(INVALID_HANDLE_VALUE), m_file(INVALID_HANDLE_VALUE) {}
|
||||
|
||||
Logger::~Logger()
|
||||
{
|
||||
if (m_console)
|
||||
FreeConsole();
|
||||
|
||||
if (m_file)
|
||||
CloseHandle(m_file);
|
||||
}
|
||||
|
||||
static Logger& Logger::Get()
|
||||
{
|
||||
static Logger instance;
|
||||
return instance;
|
||||
};
|
||||
|
||||
bool File(const std::string& filename)
|
||||
{
|
||||
std::string logpath = FullPathFromPath(filename);
|
||||
m_file = CreateFileA(logpath.c_str(), GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||
OutputDebugStringA(logpath.c_str());
|
||||
|
||||
if (m_file != INVALID_HANDLE_VALUE)
|
||||
PrintStamp(false);
|
||||
|
||||
return m_file != INVALID_HANDLE_VALUE;
|
||||
}
|
||||
|
||||
bool Console(const char* title)
|
||||
{
|
||||
AllocConsole();
|
||||
|
||||
m_console = GetStdHandle(STD_OUTPUT_HANDLE);
|
||||
if (m_console != INVALID_HANDLE_VALUE)
|
||||
{
|
||||
ShowWindow(GetConsoleWindow(), SW_MAXIMIZE);
|
||||
if (title) SetConsoleTitleA(title);
|
||||
}
|
||||
|
||||
if (m_console != INVALID_HANDLE_VALUE)
|
||||
PrintStamp(true);
|
||||
|
||||
return m_console != INVALID_HANDLE_VALUE;
|
||||
}
|
||||
|
||||
void Print(const char* format, va_list args)
|
||||
{
|
||||
bool to_console = m_console != INVALID_HANDLE_VALUE;
|
||||
bool to_file = m_file != INVALID_HANDLE_VALUE;
|
||||
|
||||
if ((to_console || to_file) && format)
|
||||
{
|
||||
int outsize = _vscprintf(format, args) + 1;
|
||||
std::unique_ptr<char[]> buffer(new char[outsize]);
|
||||
CharArrayFromFormatV(buffer.get(), outsize, format, args);
|
||||
|
||||
#ifdef LOGGER_DISABLE_TIME
|
||||
std::string to_print(buffer.get(), outsize - 1);
|
||||
#else
|
||||
std::string to_print;
|
||||
GetTime(&to_print);
|
||||
to_print.append(buffer.get(), outsize - 1);
|
||||
#endif
|
||||
|
||||
to_print.append("\r\n");
|
||||
|
||||
DWORD lenout = 0;
|
||||
if (to_console) WriteConsoleA(m_console, to_print.c_str(), (DWORD)to_print.size(), &lenout, NULL);
|
||||
if (to_file) WriteFile(m_file, to_print.c_str(), (DWORD)to_print.size(), &lenout, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
void PrintStamp(bool console)
|
||||
{
|
||||
static char stamp[] = "[TIME]\t\t[THREAD]\t[LOG]\r\n";
|
||||
DWORD lenout = 0;
|
||||
|
||||
if (console) WriteConsoleA(m_console, stamp, _countof(stamp) - 1, &lenout, NULL);
|
||||
else WriteFile(m_file, stamp, _countof(stamp) - 1, &lenout, NULL);
|
||||
}
|
||||
|
||||
void GetTime(std::string* out)
|
||||
{
|
||||
GetLocalTime(&m_systime);
|
||||
*out = StringFromFormat("%02u:%02u:%02u.%03u\t%08u\t", m_systime.wHour, m_systime.wMinute,
|
||||
m_systime.wSecond, m_systime.wMilliseconds, GetCurrentThreadId());
|
||||
|
||||
}
|
||||
|
||||
SYSTEMTIME m_systime;
|
||||
HANDLE m_console;
|
||||
HANDLE m_file;
|
||||
};
|
||||
|
||||
inline void LogFile(const std::string& logname)
|
||||
{
|
||||
Logger::Get().File(logname);
|
||||
}
|
||||
|
||||
inline void LogConsole(const char* title = nullptr)
|
||||
{
|
||||
Logger::Get().Console(title);
|
||||
}
|
||||
|
||||
inline void PrintLog(const char* format, ...)
|
||||
{
|
||||
const std::lock_guard<std::mutex> lock(Logger::Get().printLogMutex);
|
||||
va_list args;
|
||||
va_start(args, format);
|
||||
Logger::Get().Print(format, args);
|
||||
va_end(args);
|
||||
}
|
||||
|
||||
#else
|
||||
#define LogFile(logname) (logname)
|
||||
#define LogConsole(title, notice) (title)
|
||||
#define PrintLog(format, ...) (format)
|
||||
#endif
|
42
Common/MemPatch.h
Normal file
42
Common/MemPatch.h
Normal file
|
@ -0,0 +1,42 @@
|
|||
#pragma once
|
||||
#include <Windows.h>
|
||||
|
||||
namespace MemPatch
|
||||
{
|
||||
class CUnprotect
|
||||
{
|
||||
public:
|
||||
CUnprotect(void* address, unsigned long size) : m_adress(address), m_size(size)
|
||||
{
|
||||
VirtualProtect(m_adress, m_size, PAGE_EXECUTE_READWRITE, &m_oldprotect);
|
||||
}
|
||||
|
||||
~CUnprotect()
|
||||
{
|
||||
DWORD oldProtect;
|
||||
VirtualProtect(m_adress, m_size, m_oldprotect, &oldProtect);
|
||||
}
|
||||
private:
|
||||
void* m_adress;
|
||||
unsigned long m_size;
|
||||
DWORD m_oldprotect;
|
||||
};
|
||||
|
||||
__forceinline static void Patch(void* address, void* data, unsigned long size)
|
||||
{
|
||||
CUnprotect unp(address, size);
|
||||
memcpy(address, data, size);
|
||||
}
|
||||
|
||||
__forceinline static void Fill(void* address, unsigned char byte, unsigned long size)
|
||||
{
|
||||
CUnprotect unp(address, size);
|
||||
memset(address, byte, size);
|
||||
}
|
||||
|
||||
__forceinline static void Nop(void* address, unsigned long size)
|
||||
{
|
||||
Fill(address, 0x90, size);
|
||||
}
|
||||
|
||||
}
|
|
@ -328,16 +328,16 @@ public:
|
|||
#endif
|
||||
|
||||
/** Strict less ordering by name of key only */
|
||||
struct KeyOrder : std::binary_function<Entry, Entry, bool> {
|
||||
bool operator()(const Entry & lhs, const Entry & rhs) const {
|
||||
struct KeyOrder {
|
||||
bool operator()(const Entry& lhs, const Entry& rhs) const {
|
||||
const static SI_STRLESS isLess = SI_STRLESS();
|
||||
return isLess(lhs.pItem, rhs.pItem);
|
||||
}
|
||||
};
|
||||
|
||||
/** Strict less ordering by order, and then name of key */
|
||||
struct LoadOrder : std::binary_function<Entry, Entry, bool> {
|
||||
bool operator()(const Entry & lhs, const Entry & rhs) const {
|
||||
struct LoadOrder {
|
||||
bool operator()(const Entry& lhs, const Entry& rhs) const {
|
||||
if (lhs.nOrder != rhs.nOrder) {
|
||||
return lhs.nOrder < rhs.nOrder;
|
||||
}
|
||||
|
@ -1422,7 +1422,7 @@ CSimpleIniTempl<SI_CHAR,SI_STRLESS,SI_CONVERTER>::LoadFile(
|
|||
}
|
||||
|
||||
// allocate and ensure NULL terminated
|
||||
char * pData = new char[lSize+1];
|
||||
char * pData = new(std::nothrow) char[lSize+1];
|
||||
if (!pData) {
|
||||
return SI_NOMEM;
|
||||
}
|
||||
|
@ -1471,7 +1471,7 @@ CSimpleIniTempl<SI_CHAR,SI_STRLESS,SI_CONVERTER>::LoadData(
|
|||
|
||||
// allocate memory for the data, ensure that there is a NULL
|
||||
// terminator wherever the converted data ends
|
||||
SI_CHAR * pData = new SI_CHAR[uLen+1];
|
||||
SI_CHAR * pData = new(std::nothrow) SI_CHAR[uLen+1];
|
||||
if (!pData) {
|
||||
return SI_NOMEM;
|
||||
}
|
||||
|
@ -1896,7 +1896,7 @@ CSimpleIniTempl<SI_CHAR,SI_STRLESS,SI_CONVERTER>::CopyString(
|
|||
for ( ; a_pString[uLen]; ++uLen) /*loop*/ ;
|
||||
}
|
||||
++uLen; // NULL character
|
||||
SI_CHAR * pCopy = new SI_CHAR[uLen];
|
||||
SI_CHAR * pCopy = new(std::nothrow) SI_CHAR[uLen];
|
||||
if (!pCopy) {
|
||||
return SI_NOMEM;
|
||||
}
|
||||
|
|
|
@ -149,13 +149,15 @@ inline std::string CP1252ToUTF8(const std::string& input)
|
|||
|
||||
// trim from start
|
||||
static inline std::string <rim(std::string &s) {
|
||||
s.erase(s.begin(), std::find_if(s.begin(), s.end(), std::not1(std::ptr_fun<int, int>(std::isspace))));
|
||||
//workaround for template deduction after including <locale>
|
||||
s.erase(s.begin(), std::find_if(s.begin(), s.end(), std::not_fn([&](int i) { return std::isspace(i); })));
|
||||
return s;
|
||||
}
|
||||
|
||||
// trim from end
|
||||
static inline std::string &rtrim(std::string &s) {
|
||||
s.erase(std::find_if(s.rbegin(), s.rend(), std::not1(std::ptr_fun<int, int>(std::isspace))).base(), s.end());
|
||||
//workaround for template deduction after including <locale>
|
||||
s.erase(std::find_if(s.rbegin(), s.rend(), std::not_fn([&](int i) { return std::isspace(i); })).base(), s.end());
|
||||
return s;
|
||||
}
|
||||
|
||||
|
|
|
@ -62,14 +62,18 @@ typedef BOOL(WINAPI* GetProductInfo_t)(DWORD dwOSMajorVersion, DWORD dwOSMinorVe
|
|||
|
||||
inline BOOL MyGetVersionExA(OSVERSIONINFOEXA* lpVersionInformation)
|
||||
{
|
||||
GetVersionExA_t RealGetVersionExA = (GetVersionExA_t)GetProcAddress(GetModuleHandle(TEXT("kernel32.dll")), "GetVersionExA");
|
||||
HMODULE hkernel = GetModuleHandle(TEXT("kernel32.dll"));
|
||||
if (!hkernel) return FALSE;
|
||||
GetVersionExA_t RealGetVersionExA = (GetVersionExA_t)GetProcAddress(hkernel, "GetVersionExA");
|
||||
if (!RealGetVersionExA) return FALSE;
|
||||
return RealGetVersionExA(lpVersionInformation);
|
||||
}
|
||||
|
||||
inline BOOL MyGetProductInfo(DWORD dwOSMajorVersion, DWORD dwOSMinorVersion, DWORD dwSpMajorVersion, DWORD dwSpMinorVersion, PDWORD pdwReturnedProductType)
|
||||
{
|
||||
GetProductInfo_t RealGetProductInfo = (GetProductInfo_t)GetProcAddress(GetModuleHandle(TEXT("kernel32.dll")), "GetProductInfo");
|
||||
HMODULE hkernel = GetModuleHandle(TEXT("kernel32.dll"));
|
||||
if (!hkernel) return FALSE;
|
||||
GetProductInfo_t RealGetProductInfo = (GetProductInfo_t)GetProcAddress(hkernel, "GetProductInfo");
|
||||
if (!RealGetProductInfo) return FALSE;
|
||||
return RealGetProductInfo(dwOSMajorVersion, dwOSMinorVersion, dwSpMajorVersion, dwSpMinorVersion, pdwReturnedProductType);
|
||||
}
|
||||
|
|
1
Deps/MinHook
Submodule
1
Deps/MinHook
Submodule
|
@ -0,0 +1 @@
|
|||
Subproject commit 423d1e45af2ed2719a5c31e990e935ef301ed9c3
|
1
Deps/spdlog
Submodule
1
Deps/spdlog
Submodule
|
@ -0,0 +1 @@
|
|||
Subproject commit 100f30043f33277122e0991c83845a2617172ffd
|
|
@ -1,22 +0,0 @@
|
|||
# EditorConfig is awesome: http://EditorConfig.org
|
||||
|
||||
# top-most EditorConfig file
|
||||
root = true
|
||||
|
||||
# Windows-style newlines with a newline ending every file
|
||||
[*]
|
||||
end_of_line = crlf
|
||||
insert_final_newline = true
|
||||
|
||||
# 4 space indentation
|
||||
[*.{c,h,def}]
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
|
||||
# Trim trailing whitespaces
|
||||
[*.{c,h,def,txt}]
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
# UTF-8 with BOM
|
||||
[*.{c,h,def,txt}]
|
||||
charset=utf-8-bom
|
43
MinHook/.gitignore
vendored
43
MinHook/.gitignore
vendored
|
@ -1,43 +0,0 @@
|
|||
#OS junk files
|
||||
[Tt]humbs.db
|
||||
*.DS_Store
|
||||
|
||||
#Visual Studio files
|
||||
*.[Oo]bj
|
||||
*.user
|
||||
*.aps
|
||||
*.pch
|
||||
*.vspscc
|
||||
*.vssscc
|
||||
*_i.c
|
||||
*_p.c
|
||||
*.ncb
|
||||
*.suo
|
||||
*.tlb
|
||||
*.tlh
|
||||
*.bak
|
||||
*.[Cc]ache
|
||||
*.ilk
|
||||
*.log
|
||||
*.sbr
|
||||
*.sdf
|
||||
*.opensdf
|
||||
*.unsuccessfulbuild
|
||||
ipch/
|
||||
obj/
|
||||
[Ll]ib
|
||||
[Bb]in
|
||||
[Dd]ebug*/
|
||||
[Rr]elease*/
|
||||
Ankh.NoLoad
|
||||
*.VC.db
|
||||
|
||||
#GCC files
|
||||
*.o
|
||||
*.d
|
||||
*.res
|
||||
*.dll
|
||||
*.a
|
||||
|
||||
#Visual Studio Code files
|
||||
.vscode/
|
|
@ -1,8 +0,0 @@
|
|||
Tsuda Kageyu <tsuda.kageyu@gmail.com>
|
||||
Creator, maintainer
|
||||
|
||||
Michael Maltsev <leahcimmar@gmail.com>
|
||||
Added "Queue" functions. A lot of bug fixes.
|
||||
|
||||
Andrey Unis <uniskz@gmail.com>
|
||||
Rewrote the hook engine in plain C.
|
|
@ -1,81 +0,0 @@
|
|||
MinHook - The Minimalistic API Hooking Library for x64/x86
|
||||
Copyright (C) 2009-2017 Tsuda Kageyu.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER
|
||||
OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
================================================================================
|
||||
Portions of this software are Copyright (c) 2008-2009, Vyacheslav Patkov.
|
||||
================================================================================
|
||||
Hacker Disassembler Engine 32 C
|
||||
Copyright (c) 2008-2009, Vyacheslav Patkov.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Hacker Disassembler Engine 64 C
|
||||
Copyright (c) 2008-2009, Vyacheslav Patkov.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
@ -1,88 +0,0 @@
|
|||
# MinHook
|
||||
|
||||
[![License](https://img.shields.io/badge/License-BSD%202--Clause-orange.svg)](https://opensource.org/licenses/BSD-2-Clause)
|
||||
|
||||
The Minimalistic x86/x64 API Hooking Library for Windows
|
||||
|
||||
http://www.codeproject.com/KB/winsdk/LibMinHook.aspx
|
||||
|
||||
### Donation please
|
||||
|
||||
I need some funds to continue developing this library. All contributions gratefully accepted.
|
||||
|
||||
<a href='https://pledgie.com/campaigns/27314'><img alt='Click here to lend your support to: MinHook - Help me continue to develop this library and make a donation at pledgie.com !' src='https://pledgie.com/campaigns/27314.png?skin_name=chrome' border='0' ></a>
|
||||
|
||||
### Version history
|
||||
|
||||
- ####v1.3.3 - 8 Jan 2017
|
||||
* Added a helper function ```MH_CreateHookApiEx```. (Thanks to asm256)
|
||||
* Support Visual Studio 2017 RC.
|
||||
|
||||
- ####v1.3.2.1 - 9 Nov 2015 (Nuget package only)
|
||||
* Fixed an insufficient support for Visual Studio 2015.
|
||||
|
||||
- ####v1.3.2 - 1 Nov 2015
|
||||
* Support Visual Studio 2015.
|
||||
* Support MinGW.
|
||||
|
||||
- ####v1.3.2-beta3 - 21 Jul 2015 (Nuget package only)
|
||||
* Support MinGW. (Experimental)
|
||||
|
||||
- ####v1.3.2-beta2 - 18 May 2015
|
||||
* Fixed some subtle bugs. (Thanks to RaMMicHaeL)
|
||||
* Added a helper function ```MH_StatusToString```. (Thanks to Jan Klass)
|
||||
|
||||
- ####v1.3.2-beta - 12 May 2015
|
||||
* Fixed a possible thread deadlock in x64 mode. (Thanks to Aleh Kazakevich)
|
||||
* Reduced the footprint a little more.
|
||||
* Support Visual Studio 2015 RC. (Experimental)
|
||||
|
||||
- ####v1.3.1.1 - 7 Apr 2015 (Nuget package only)
|
||||
* Support for WDK8.0 and 8.1.
|
||||
|
||||
- ####v1.3.1 - 19 Mar 2015
|
||||
* No major changes from v1.3.1-beta.
|
||||
|
||||
- ####v1.3.1-beta - 11 Mar 2015
|
||||
* Added a helper function ```MH_CreateHookApi```. (Thanks to uniskz).
|
||||
* Fixed a false memory leak reported by some tools.
|
||||
* Fixed a degradated compatibility issue.
|
||||
|
||||
- ####v1.3 - 13 Sep 2014
|
||||
* No major changes from v1.3-beta3.
|
||||
|
||||
- ####v1.3-beta3 - 31 Jul 2014
|
||||
|
||||
* Fixed some small bugs.
|
||||
* Improved the memory management.
|
||||
|
||||
- ####v1.3-beta2 - 21 Jul 2014
|
||||
|
||||
* Changed the parameters to Windows-friendly types. (void* to LPVOID)
|
||||
* Fixed some small bugs.
|
||||
* Reorganized the source files.
|
||||
* Reduced the footprint a little more.
|
||||
|
||||
- ####v1.3-beta - 17 Jul 2014
|
||||
|
||||
* Rewrote in plain C to reduce the footprint and memory usage. (suggested by Andrey Unis)
|
||||
* Simplified the overall code base to make it more readable and maintainable.
|
||||
* Changed the license from 3-clause to 2-clause BSD License.
|
||||
|
||||
- ####v1.2 - 28 Sep 2013
|
||||
|
||||
* Removed boost dependency ([jarredholman](https://github.com/jarredholman/minhook)).
|
||||
* Fixed a small bug in the GetRelativeBranchDestination function ([pillbug99](http://www.codeproject.com/Messages/4058892/Small-Bug-Found.aspx)).
|
||||
* Added the ```MH_RemoveHook``` function, which removes a hook created with the ```MH_CreateHook``` function.
|
||||
* 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.
|
||||
* 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.
|
||||
* 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)).
|
||||
|
||||
- ####v1.1 - 26 Nov 2009
|
||||
|
||||
* 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))
|
||||
* Shortened the function names from ```MinHook_*``` to ```MH_*``` to make them handier.
|
||||
|
||||
- ####v1.0 - 22 Nov 2009
|
||||
|
||||
* Initial release.
|
|
@ -1,33 +0,0 @@
|
|||
WINDRES:=$(CROSS_PREFIX)windres
|
||||
DLLTOOL:=$(CROSS_PREFIX)dlltool
|
||||
AR:=$(CROSS_PREFIX)ar
|
||||
CC:=$(CROSS_PREFIX)gcc
|
||||
CCLD:=$(CC)
|
||||
SRCS:=$(wildcard src/*.c src/hde/*.c)
|
||||
OBJS:=$(SRCS:%.c=%.o)
|
||||
DEPS:=$(SRCS:%.c=%.d)
|
||||
INCS:=-Isrc -Iinclude
|
||||
CFLAGS:=-masm=intel -Wall -Werror -std=c11
|
||||
LDFLAGS:=-Wl,-enable-stdcall-fixup -s -static-libgcc
|
||||
|
||||
all: MinHook.dll libMinHook.dll.a libMinHook.a
|
||||
|
||||
-include $(DEPS)
|
||||
|
||||
libMinHook.a: $(OBJS)
|
||||
$(AR) r $@ $^
|
||||
libMinHook.dll.a: MinHook.dll dll_resources/MinHook.def
|
||||
$(DLLTOOL) --dllname MinHook.dll --def dll_resources/MinHook.def --output-lib $@
|
||||
MinHook.dll: $(OBJS) dll_resources/MinHook.res dll_resources/MinHook.def
|
||||
$(CCLD) -o $@ -shared $(LDFLAGS) $^
|
||||
|
||||
.rc.res:
|
||||
$(WINDRES) -o $@ --input-format=rc --output-format=coff $<
|
||||
.c.o:
|
||||
$(CC) -o $@ -c -MMD -MP $(INCS) $(CFLAGS) $<
|
||||
|
||||
clean:
|
||||
rm -f $(OBJS) $(DEPS) MinHook.dll libMinHook.dll.a libMinHook.a dll_resources/MinHook.res
|
||||
|
||||
.PHONY: clean
|
||||
.SUFFIXES: .rc .res
|
|
@ -1 +0,0 @@
|
|||
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
|
|
@ -1,189 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{027FAC75-3FDB-4044-8DD0-BC297BD4C461}</ProjectGuid>
|
||||
<RootNamespace>MinHook</RootNamespace>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)bin\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)bin\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)bin\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)bin\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectName).x86</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectName).x86</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(ProjectName).x64</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(ProjectName).x64</TargetName>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;MINHOOK_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>
|
||||
</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<ModuleDefinitionFile>$(SolutionDir)..\..\dll_resources\MinHook.def</ModuleDefinitionFile>
|
||||
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
<AdditionalDependencies>$(SolutionDir)lib\$(Configuration)\libMinHook.x86.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Midl>
|
||||
<TargetEnvironment>X64</TargetEnvironment>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;MINHOOK_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>
|
||||
</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<ModuleDefinitionFile>$(SolutionDir)..\..\dll_resources\MinHook.def</ModuleDefinitionFile>
|
||||
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<TargetMachine>MachineX64</TargetMachine>
|
||||
<AdditionalDependencies>$(SolutionDir)lib\$(Configuration)\libMinHook.x64.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>MinSpace</Optimization>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;MINHOOK_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>
|
||||
</DebugInformationFormat>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<ModuleDefinitionFile>$(SolutionDir)..\..\dll_resources\MinHook.def</ModuleDefinitionFile>
|
||||
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
<AdditionalDependencies>$(SolutionDir)lib\$(Configuration)\libMinHook.x86.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<NoEntryPoint>true</NoEntryPoint>
|
||||
<MergeSections>.CRT=.text</MergeSections>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Midl>
|
||||
<TargetEnvironment>X64</TargetEnvironment>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>MinSpace</Optimization>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;MINHOOK_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>
|
||||
</DebugInformationFormat>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<ModuleDefinitionFile>$(SolutionDir)..\..\dll_resources\MinHook.def</ModuleDefinitionFile>
|
||||
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<TargetMachine>MachineX64</TargetMachine>
|
||||
<AdditionalDependencies>$(SolutionDir)lib\$(Configuration)\libMinHook.x64.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<NoEntryPoint>true</NoEntryPoint>
|
||||
<MergeSections>.CRT=.text</MergeSections>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\..\dll_resources\MinHook.def" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="..\..\dll_resources\MinHook.rc" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
|
@ -1,39 +0,0 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 11.00
|
||||
# Visual Studio 2010
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libMinHook", "libMinHook.vcxproj", "{F142A341-5EE0-442D-A15F-98AE9B48DBAE}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MinHook", "MinHook.vcxproj", "{027FAC75-3FDB-4044-8DD0-BC297BD4C461}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{F142A341-5EE0-442D-A15F-98AE9B48DBAE} = {F142A341-5EE0-442D-A15F-98AE9B48DBAE}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Debug|x64 = Debug|x64
|
||||
Release|Win32 = Release|Win32
|
||||
Release|x64 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Debug|x64.Build.0 = Debug|x64
|
||||
{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Release|Win32.Build.0 = Release|Win32
|
||||
{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Release|x64.ActiveCfg = Release|x64
|
||||
{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Release|x64.Build.0 = Release|x64
|
||||
{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Debug|x64.Build.0 = Debug|x64
|
||||
{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Release|Win32.Build.0 = Release|Win32
|
||||
{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Release|x64.ActiveCfg = Release|x64
|
||||
{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Release|x64.Build.0 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
|
@ -1,172 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{F142A341-5EE0-442D-A15F-98AE9B48DBAE}</ProjectGuid>
|
||||
<RootNamespace>libMinHook</RootNamespace>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)lib\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)lib\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)lib\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)lib\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectName).x86</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectName).x86</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(ProjectName).x64</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(ProjectName).x64</TargetName>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;STRICT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>
|
||||
</DebugInformationFormat>
|
||||
<WholeProgramOptimization>false</WholeProgramOptimization>
|
||||
</ClCompile>
|
||||
<Lib />
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Midl>
|
||||
<TargetEnvironment>X64</TargetEnvironment>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;STRICT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>
|
||||
</DebugInformationFormat>
|
||||
<WholeProgramOptimization>false</WholeProgramOptimization>
|
||||
</ClCompile>
|
||||
<Lib />
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>MinSpace</Optimization>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;STRICT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>
|
||||
</DebugInformationFormat>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
|
||||
</ClCompile>
|
||||
<Lib />
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Midl>
|
||||
<TargetEnvironment>X64</TargetEnvironment>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>MinSpace</Optimization>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;STRICT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>
|
||||
</DebugInformationFormat>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
|
||||
</ClCompile>
|
||||
<Lib />
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\src\buffer.c" />
|
||||
<ClCompile Include="..\..\src\HDE\hde32.c">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\HDE\hde64.c">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\hook.c" />
|
||||
<ClCompile Include="..\..\src\trampoline.c" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\include\MinHook.h" />
|
||||
<ClInclude Include="..\..\src\buffer.h" />
|
||||
<ClInclude Include="..\..\src\HDE\hde32.h" />
|
||||
<ClInclude Include="..\..\src\HDE\hde64.h" />
|
||||
<ClInclude Include="..\..\src\HDE\pstdint.h" />
|
||||
<ClInclude Include="..\..\src\HDE\table32.h" />
|
||||
<ClInclude Include="..\..\src\HDE\table64.h" />
|
||||
<ClInclude Include="..\..\src\trampoline.h" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
|
@ -1,55 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\src\buffer.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\hook.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\trampoline.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\HDE\hde32.c">
|
||||
<Filter>HDE</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\HDE\hde64.c">
|
||||
<Filter>HDE</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\src\trampoline.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\buffer.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\include\MinHook.h" />
|
||||
<ClInclude Include="..\..\src\HDE\hde32.h">
|
||||
<Filter>HDE</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\HDE\hde64.h">
|
||||
<Filter>HDE</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\HDE\pstdint.h">
|
||||
<Filter>HDE</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\HDE\table32.h">
|
||||
<Filter>HDE</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\HDE\table64.h">
|
||||
<Filter>HDE</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{9d24b740-be2e-4cfd-b9a4-340a50946ee9}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{76381bc7-2863-4cc5-aede-926ec2c506e4}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="HDE">
|
||||
<UniqueIdentifier>{56ddb326-6179-430d-ae19-e13bfd767bfa}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -1,189 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{027FAC75-3FDB-4044-8DD0-BC297BD4C461}</ProjectGuid>
|
||||
<RootNamespace>MinHook</RootNamespace>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<PlatformToolset>v110_xp</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<PlatformToolset>v110_xp</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<PlatformToolset>v110_xp</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<PlatformToolset>v110_xp</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)bin\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)bin\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)bin\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)bin\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectName).x86</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectName).x86</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(ProjectName).x64</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(ProjectName).x64</TargetName>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;MINHOOK_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>None</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<ModuleDefinitionFile>$(SolutionDir)..\..\dll_resources\MinHook.def</ModuleDefinitionFile>
|
||||
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
<AdditionalDependencies>$(SolutionDir)lib\$(Configuration)\libMinHook.x86.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Midl>
|
||||
<TargetEnvironment>X64</TargetEnvironment>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;MINHOOK_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>None</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<ModuleDefinitionFile>$(SolutionDir)..\..\dll_resources\MinHook.def</ModuleDefinitionFile>
|
||||
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<TargetMachine>MachineX64</TargetMachine>
|
||||
<AdditionalDependencies>$(SolutionDir)lib\$(Configuration)\libMinHook.x64.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>MinSpace</Optimization>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;MINHOOK_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>None</DebugInformationFormat>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<ModuleDefinitionFile>$(SolutionDir)..\..\dll_resources\MinHook.def</ModuleDefinitionFile>
|
||||
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
<AdditionalDependencies>$(SolutionDir)lib\$(Configuration)\libMinHook.x86.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<NoEntryPoint>true</NoEntryPoint>
|
||||
<MergeSections>.CRT=.text</MergeSections>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Midl>
|
||||
<TargetEnvironment>X64</TargetEnvironment>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>MinSpace</Optimization>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;MINHOOK_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>None</DebugInformationFormat>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<ModuleDefinitionFile>$(SolutionDir)..\..\dll_resources\MinHook.def</ModuleDefinitionFile>
|
||||
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<TargetMachine>MachineX64</TargetMachine>
|
||||
<AdditionalDependencies>$(SolutionDir)lib\$(Configuration)\libMinHook.x64.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<NoEntryPoint>true</NoEntryPoint>
|
||||
<MergeSections>.CRT=.text</MergeSections>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\..\dll_resources\MinHook.def" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="..\..\dll_resources\MinHook.rc" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
|
@ -1,39 +0,0 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 2012
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libMinHook", "libMinHook.vcxproj", "{F142A341-5EE0-442D-A15F-98AE9B48DBAE}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MinHook", "MinHook.vcxproj", "{027FAC75-3FDB-4044-8DD0-BC297BD4C461}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{F142A341-5EE0-442D-A15F-98AE9B48DBAE} = {F142A341-5EE0-442D-A15F-98AE9B48DBAE}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Debug|x64 = Debug|x64
|
||||
Release|Win32 = Release|Win32
|
||||
Release|x64 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Debug|x64.Build.0 = Debug|x64
|
||||
{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Release|Win32.Build.0 = Release|Win32
|
||||
{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Release|x64.ActiveCfg = Release|x64
|
||||
{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Release|x64.Build.0 = Release|x64
|
||||
{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Debug|x64.Build.0 = Debug|x64
|
||||
{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Release|Win32.Build.0 = Release|Win32
|
||||
{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Release|x64.ActiveCfg = Release|x64
|
||||
{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Release|x64.Build.0 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
|
@ -1,172 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{F142A341-5EE0-442D-A15F-98AE9B48DBAE}</ProjectGuid>
|
||||
<RootNamespace>libMinHook</RootNamespace>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<PlatformToolset>v110_xp</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<PlatformToolset>v110_xp</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<PlatformToolset>v110_xp</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<PlatformToolset>v110_xp</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)lib\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)lib\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)lib\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)lib\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectName).x86</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectName).x86</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(ProjectName).x64</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(ProjectName).x64</TargetName>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;STRICT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>None</DebugInformationFormat>
|
||||
<EnableEnhancedInstructionSet>NoExtensions</EnableEnhancedInstructionSet>
|
||||
</ClCompile>
|
||||
<Lib />
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Midl>
|
||||
<TargetEnvironment>X64</TargetEnvironment>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;STRICT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>None</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Lib />
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>MinSpace</Optimization>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;STRICT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>None</DebugInformationFormat>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
|
||||
<EnableEnhancedInstructionSet>NoExtensions</EnableEnhancedInstructionSet>
|
||||
</ClCompile>
|
||||
<Lib />
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Midl>
|
||||
<TargetEnvironment>X64</TargetEnvironment>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>MinSpace</Optimization>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;STRICT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>None</DebugInformationFormat>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
|
||||
</ClCompile>
|
||||
<Lib />
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\src\buffer.c" />
|
||||
<ClCompile Include="..\..\src\HDE\hde32.c">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\HDE\hde64.c">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\hook.c" />
|
||||
<ClCompile Include="..\..\src\trampoline.c" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\include\MinHook.h" />
|
||||
<ClInclude Include="..\..\src\buffer.h" />
|
||||
<ClInclude Include="..\..\src\HDE\hde32.h" />
|
||||
<ClInclude Include="..\..\src\HDE\hde64.h" />
|
||||
<ClInclude Include="..\..\src\HDE\pstdint.h" />
|
||||
<ClInclude Include="..\..\src\HDE\table32.h" />
|
||||
<ClInclude Include="..\..\src\HDE\table64.h" />
|
||||
<ClInclude Include="..\..\src\trampoline.h" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
|
@ -1,55 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\src\buffer.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\hook.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\trampoline.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\HDE\hde32.c">
|
||||
<Filter>HDE</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\HDE\hde64.c">
|
||||
<Filter>HDE</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\src\trampoline.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\buffer.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\include\MinHook.h" />
|
||||
<ClInclude Include="..\..\src\HDE\hde32.h">
|
||||
<Filter>HDE</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\HDE\hde64.h">
|
||||
<Filter>HDE</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\HDE\pstdint.h">
|
||||
<Filter>HDE</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\HDE\table32.h">
|
||||
<Filter>HDE</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\HDE\table64.h">
|
||||
<Filter>HDE</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{9d24b740-be2e-4cfd-b9a4-340a50946ee9}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{76381bc7-2863-4cc5-aede-926ec2c506e4}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="HDE">
|
||||
<UniqueIdentifier>{56ddb326-6179-430d-ae19-e13bfd767bfa}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -1,189 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{027FAC75-3FDB-4044-8DD0-BC297BD4C461}</ProjectGuid>
|
||||
<RootNamespace>MinHook</RootNamespace>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<PlatformToolset>v120_xp</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<PlatformToolset>v120_xp</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<PlatformToolset>v120_xp</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<PlatformToolset>v120_xp</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)bin\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)bin\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)bin\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)bin\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectName).x86</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectName).x86</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(ProjectName).x64</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(ProjectName).x64</TargetName>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;MINHOOK_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>None</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<ModuleDefinitionFile>$(SolutionDir)..\..\dll_resources\MinHook.def</ModuleDefinitionFile>
|
||||
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
<AdditionalDependencies>$(SolutionDir)lib\$(Configuration)\libMinHook.x86.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Midl>
|
||||
<TargetEnvironment>X64</TargetEnvironment>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;MINHOOK_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>None</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<ModuleDefinitionFile>$(SolutionDir)..\..\dll_resources\MinHook.def</ModuleDefinitionFile>
|
||||
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<TargetMachine>MachineX64</TargetMachine>
|
||||
<AdditionalDependencies>$(SolutionDir)lib\$(Configuration)\libMinHook.x64.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>MinSpace</Optimization>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;MINHOOK_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>None</DebugInformationFormat>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<ModuleDefinitionFile>$(SolutionDir)..\..\dll_resources\MinHook.def</ModuleDefinitionFile>
|
||||
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
<AdditionalDependencies>$(SolutionDir)lib\$(Configuration)\libMinHook.x86.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<NoEntryPoint>true</NoEntryPoint>
|
||||
<MergeSections>.CRT=.text</MergeSections>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Midl>
|
||||
<TargetEnvironment>X64</TargetEnvironment>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>MinSpace</Optimization>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;MINHOOK_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>None</DebugInformationFormat>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<ModuleDefinitionFile>$(SolutionDir)..\..\dll_resources\MinHook.def</ModuleDefinitionFile>
|
||||
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<TargetMachine>MachineX64</TargetMachine>
|
||||
<AdditionalDependencies>$(SolutionDir)lib\$(Configuration)\libMinHook.x64.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<NoEntryPoint>true</NoEntryPoint>
|
||||
<MergeSections>.CRT=.text</MergeSections>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\..\dll_resources\MinHook.def" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="..\..\dll_resources\MinHook.rc" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
|
@ -1,41 +0,0 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 2013
|
||||
VisualStudioVersion = 12.0.30501.0
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libMinHook", "libMinHook.vcxproj", "{F142A341-5EE0-442D-A15F-98AE9B48DBAE}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MinHook", "MinHook.vcxproj", "{027FAC75-3FDB-4044-8DD0-BC297BD4C461}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{F142A341-5EE0-442D-A15F-98AE9B48DBAE} = {F142A341-5EE0-442D-A15F-98AE9B48DBAE}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Debug|x64 = Debug|x64
|
||||
Release|Win32 = Release|Win32
|
||||
Release|x64 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Debug|x64.Build.0 = Debug|x64
|
||||
{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Release|Win32.Build.0 = Release|Win32
|
||||
{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Release|x64.ActiveCfg = Release|x64
|
||||
{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Release|x64.Build.0 = Release|x64
|
||||
{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Debug|x64.Build.0 = Debug|x64
|
||||
{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Release|Win32.Build.0 = Release|Win32
|
||||
{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Release|x64.ActiveCfg = Release|x64
|
||||
{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Release|x64.Build.0 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
|
@ -1,174 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{F142A341-5EE0-442D-A15F-98AE9B48DBAE}</ProjectGuid>
|
||||
<RootNamespace>libMinHook</RootNamespace>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<PlatformToolset>v120_xp</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<PlatformToolset>v120_xp</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<PlatformToolset>v120_xp</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<PlatformToolset>v120_xp</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)lib\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)lib\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)lib\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)lib\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectName).x86</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectName).x86</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(ProjectName).x64</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(ProjectName).x64</TargetName>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;STRICT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>None</DebugInformationFormat>
|
||||
<EnableEnhancedInstructionSet>NoExtensions</EnableEnhancedInstructionSet>
|
||||
</ClCompile>
|
||||
<Lib />
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Midl>
|
||||
<TargetEnvironment>X64</TargetEnvironment>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;STRICT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>None</DebugInformationFormat>
|
||||
<EnableEnhancedInstructionSet>NotSet</EnableEnhancedInstructionSet>
|
||||
</ClCompile>
|
||||
<Lib />
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>MinSpace</Optimization>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;STRICT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>None</DebugInformationFormat>
|
||||
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
|
||||
<CompileAs>CompileAsC</CompileAs>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<EnableEnhancedInstructionSet>NoExtensions</EnableEnhancedInstructionSet>
|
||||
</ClCompile>
|
||||
<Lib />
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Midl>
|
||||
<TargetEnvironment>X64</TargetEnvironment>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>MinSpace</Optimization>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;STRICT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>None</DebugInformationFormat>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
|
||||
</ClCompile>
|
||||
<Lib />
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\src\buffer.c" />
|
||||
<ClCompile Include="..\..\src\HDE\hde32.c">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\HDE\hde64.c">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\hook.c" />
|
||||
<ClCompile Include="..\..\src\trampoline.c" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\include\MinHook.h" />
|
||||
<ClInclude Include="..\..\src\buffer.h" />
|
||||
<ClInclude Include="..\..\src\HDE\hde32.h" />
|
||||
<ClInclude Include="..\..\src\HDE\hde64.h" />
|
||||
<ClInclude Include="..\..\src\HDE\pstdint.h" />
|
||||
<ClInclude Include="..\..\src\HDE\table32.h" />
|
||||
<ClInclude Include="..\..\src\HDE\table64.h" />
|
||||
<ClInclude Include="..\..\src\trampoline.h" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
|
@ -1,55 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\src\buffer.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\hook.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\trampoline.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\HDE\hde32.c">
|
||||
<Filter>HDE</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\HDE\hde64.c">
|
||||
<Filter>HDE</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\src\trampoline.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\buffer.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\include\MinHook.h" />
|
||||
<ClInclude Include="..\..\src\HDE\hde32.h">
|
||||
<Filter>HDE</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\HDE\hde64.h">
|
||||
<Filter>HDE</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\HDE\pstdint.h">
|
||||
<Filter>HDE</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\HDE\table32.h">
|
||||
<Filter>HDE</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\HDE\table64.h">
|
||||
<Filter>HDE</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{9d24b740-be2e-4cfd-b9a4-340a50946ee9}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{76381bc7-2863-4cc5-aede-926ec2c506e4}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="HDE">
|
||||
<UniqueIdentifier>{56ddb326-6179-430d-ae19-e13bfd767bfa}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -1,189 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{027FAC75-3FDB-4044-8DD0-BC297BD4C461}</ProjectGuid>
|
||||
<RootNamespace>MinHook</RootNamespace>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<PlatformToolset>v140_xp</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<PlatformToolset>v140_xp</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<PlatformToolset>v140_xp</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<PlatformToolset>v140_xp</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)bin\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)bin\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)bin\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)bin\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectName).x86</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectName).x86</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(ProjectName).x64</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(ProjectName).x64</TargetName>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;MINHOOK_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>None</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<ModuleDefinitionFile>$(SolutionDir)..\..\dll_resources\MinHook.def</ModuleDefinitionFile>
|
||||
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
<AdditionalDependencies>$(SolutionDir)lib\$(Configuration)\libMinHook.x86.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Midl>
|
||||
<TargetEnvironment>X64</TargetEnvironment>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;MINHOOK_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>None</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<ModuleDefinitionFile>$(SolutionDir)..\..\dll_resources\MinHook.def</ModuleDefinitionFile>
|
||||
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<TargetMachine>MachineX64</TargetMachine>
|
||||
<AdditionalDependencies>$(SolutionDir)lib\$(Configuration)\libMinHook.x64.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>MinSpace</Optimization>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;MINHOOK_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>None</DebugInformationFormat>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<ModuleDefinitionFile>$(SolutionDir)..\..\dll_resources\MinHook.def</ModuleDefinitionFile>
|
||||
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
<AdditionalDependencies>$(SolutionDir)lib\$(Configuration)\libMinHook.x86.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<NoEntryPoint>true</NoEntryPoint>
|
||||
<MergeSections>.CRT=.text</MergeSections>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Midl>
|
||||
<TargetEnvironment>X64</TargetEnvironment>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>MinSpace</Optimization>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;MINHOOK_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>None</DebugInformationFormat>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<ModuleDefinitionFile>$(SolutionDir)..\..\dll_resources\MinHook.def</ModuleDefinitionFile>
|
||||
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<TargetMachine>MachineX64</TargetMachine>
|
||||
<AdditionalDependencies>$(SolutionDir)lib\$(Configuration)\libMinHook.x64.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<NoEntryPoint>true</NoEntryPoint>
|
||||
<MergeSections>.CRT=.text</MergeSections>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\..\dll_resources\MinHook.def" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="..\..\dll_resources\MinHook.rc" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
|
@ -1,41 +0,0 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 14
|
||||
VisualStudioVersion = 14.0.22823.1
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libMinHook", "libMinHook.vcxproj", "{F142A341-5EE0-442D-A15F-98AE9B48DBAE}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MinHook", "MinHook.vcxproj", "{027FAC75-3FDB-4044-8DD0-BC297BD4C461}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{F142A341-5EE0-442D-A15F-98AE9B48DBAE} = {F142A341-5EE0-442D-A15F-98AE9B48DBAE}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Debug|x64 = Debug|x64
|
||||
Release|Win32 = Release|Win32
|
||||
Release|x64 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Debug|x64.Build.0 = Debug|x64
|
||||
{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Release|Win32.Build.0 = Release|Win32
|
||||
{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Release|x64.ActiveCfg = Release|x64
|
||||
{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Release|x64.Build.0 = Release|x64
|
||||
{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Debug|x64.Build.0 = Debug|x64
|
||||
{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Release|Win32.Build.0 = Release|Win32
|
||||
{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Release|x64.ActiveCfg = Release|x64
|
||||
{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Release|x64.Build.0 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
|
@ -1,174 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{F142A341-5EE0-442D-A15F-98AE9B48DBAE}</ProjectGuid>
|
||||
<RootNamespace>libMinHook</RootNamespace>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<PlatformToolset>v140_xp</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<PlatformToolset>v140_xp</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<PlatformToolset>v140_xp</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<PlatformToolset>v140_xp</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)lib\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)lib\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)lib\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)lib\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectName).x86</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectName).x86</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(ProjectName).x64</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(ProjectName).x64</TargetName>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;STRICT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>None</DebugInformationFormat>
|
||||
<EnableEnhancedInstructionSet>NoExtensions</EnableEnhancedInstructionSet>
|
||||
</ClCompile>
|
||||
<Lib />
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Midl>
|
||||
<TargetEnvironment>X64</TargetEnvironment>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;STRICT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>None</DebugInformationFormat>
|
||||
<EnableEnhancedInstructionSet>NotSet</EnableEnhancedInstructionSet>
|
||||
</ClCompile>
|
||||
<Lib />
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>MinSpace</Optimization>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;STRICT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>None</DebugInformationFormat>
|
||||
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
|
||||
<CompileAs>CompileAsC</CompileAs>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<EnableEnhancedInstructionSet>NoExtensions</EnableEnhancedInstructionSet>
|
||||
</ClCompile>
|
||||
<Lib />
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Midl>
|
||||
<TargetEnvironment>X64</TargetEnvironment>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>MinSpace</Optimization>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;STRICT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>None</DebugInformationFormat>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
|
||||
</ClCompile>
|
||||
<Lib />
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\src\buffer.c" />
|
||||
<ClCompile Include="..\..\src\HDE\hde32.c">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\HDE\hde64.c">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\hook.c" />
|
||||
<ClCompile Include="..\..\src\trampoline.c" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\include\MinHook.h" />
|
||||
<ClInclude Include="..\..\src\buffer.h" />
|
||||
<ClInclude Include="..\..\src\HDE\hde32.h" />
|
||||
<ClInclude Include="..\..\src\HDE\hde64.h" />
|
||||
<ClInclude Include="..\..\src\HDE\pstdint.h" />
|
||||
<ClInclude Include="..\..\src\HDE\table32.h" />
|
||||
<ClInclude Include="..\..\src\HDE\table64.h" />
|
||||
<ClInclude Include="..\..\src\trampoline.h" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
|
@ -1,55 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\src\buffer.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\hook.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\trampoline.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\HDE\hde32.c">
|
||||
<Filter>HDE</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\HDE\hde64.c">
|
||||
<Filter>HDE</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\src\trampoline.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\buffer.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\include\MinHook.h" />
|
||||
<ClInclude Include="..\..\src\HDE\hde32.h">
|
||||
<Filter>HDE</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\HDE\hde64.h">
|
||||
<Filter>HDE</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\HDE\pstdint.h">
|
||||
<Filter>HDE</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\HDE\table32.h">
|
||||
<Filter>HDE</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\HDE\table64.h">
|
||||
<Filter>HDE</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{9d24b740-be2e-4cfd-b9a4-340a50946ee9}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{76381bc7-2863-4cc5-aede-926ec2c506e4}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="HDE">
|
||||
<UniqueIdentifier>{56ddb326-6179-430d-ae19-e13bfd767bfa}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -1,189 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{027FAC75-3FDB-4044-8DD0-BC297BD4C461}</ProjectGuid>
|
||||
<RootNamespace>MinHook</RootNamespace>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<PlatformToolset>v141_xp</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<PlatformToolset>v141_xp</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<PlatformToolset>v141_xp</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<PlatformToolset>v141_xp</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)bin\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)bin\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)bin\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)bin\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectName).x86</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectName).x86</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(ProjectName).x64</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(ProjectName).x64</TargetName>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;MINHOOK_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>None</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<ModuleDefinitionFile>$(SolutionDir)..\..\dll_resources\MinHook.def</ModuleDefinitionFile>
|
||||
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
<AdditionalDependencies>$(SolutionDir)lib\$(Configuration)\libMinHook.x86.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Midl>
|
||||
<TargetEnvironment>X64</TargetEnvironment>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;MINHOOK_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>None</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<ModuleDefinitionFile>$(SolutionDir)..\..\dll_resources\MinHook.def</ModuleDefinitionFile>
|
||||
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<TargetMachine>MachineX64</TargetMachine>
|
||||
<AdditionalDependencies>$(SolutionDir)lib\$(Configuration)\libMinHook.x64.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>MinSpace</Optimization>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;MINHOOK_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>None</DebugInformationFormat>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<ModuleDefinitionFile>$(SolutionDir)..\..\dll_resources\MinHook.def</ModuleDefinitionFile>
|
||||
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
<AdditionalDependencies>$(SolutionDir)lib\$(Configuration)\libMinHook.x86.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<NoEntryPoint>true</NoEntryPoint>
|
||||
<MergeSections>.CRT=.text</MergeSections>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Midl>
|
||||
<TargetEnvironment>X64</TargetEnvironment>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>MinSpace</Optimization>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;MINHOOK_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>None</DebugInformationFormat>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<ModuleDefinitionFile>$(SolutionDir)..\..\dll_resources\MinHook.def</ModuleDefinitionFile>
|
||||
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<TargetMachine>MachineX64</TargetMachine>
|
||||
<AdditionalDependencies>$(SolutionDir)lib\$(Configuration)\libMinHook.x64.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<NoEntryPoint>true</NoEntryPoint>
|
||||
<MergeSections>.CRT=.text</MergeSections>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\..\dll_resources\MinHook.def" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="..\..\dll_resources\MinHook.rc" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
|
@ -1,41 +0,0 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 15
|
||||
VisualStudioVersion = 15.0.25123.0
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libMinHook", "libMinHook.vcxproj", "{F142A341-5EE0-442D-A15F-98AE9B48DBAE}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MinHook", "MinHook.vcxproj", "{027FAC75-3FDB-4044-8DD0-BC297BD4C461}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{F142A341-5EE0-442D-A15F-98AE9B48DBAE} = {F142A341-5EE0-442D-A15F-98AE9B48DBAE}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Debug|x64 = Debug|x64
|
||||
Release|Win32 = Release|Win32
|
||||
Release|x64 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Debug|x64.Build.0 = Debug|x64
|
||||
{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Release|Win32.Build.0 = Release|Win32
|
||||
{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Release|x64.ActiveCfg = Release|x64
|
||||
{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Release|x64.Build.0 = Release|x64
|
||||
{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Debug|x64.Build.0 = Debug|x64
|
||||
{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Release|Win32.Build.0 = Release|Win32
|
||||
{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Release|x64.ActiveCfg = Release|x64
|
||||
{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Release|x64.Build.0 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
|
@ -1,171 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{F142A341-5EE0-442D-A15F-98AE9B48DBAE}</ProjectGuid>
|
||||
<RootNamespace>libMinHook</RootNamespace>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<SpectreMitigation>false</SpectreMitigation>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)lib\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)lib\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)lib\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)lib\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectName).x86</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectName).x86</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(ProjectName).x64</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(ProjectName).x64</TargetName>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;STRICT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>None</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Lib />
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Midl>
|
||||
<TargetEnvironment>X64</TargetEnvironment>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;STRICT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>None</DebugInformationFormat>
|
||||
<EnableEnhancedInstructionSet>NotSet</EnableEnhancedInstructionSet>
|
||||
</ClCompile>
|
||||
<Lib />
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>MinSpace</Optimization>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;STRICT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>None</DebugInformationFormat>
|
||||
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
|
||||
<CompileAs>CompileAsC</CompileAs>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
</ClCompile>
|
||||
<Lib />
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Midl>
|
||||
<TargetEnvironment>X64</TargetEnvironment>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>MinSpace</Optimization>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;STRICT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>None</DebugInformationFormat>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
|
||||
</ClCompile>
|
||||
<Lib />
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\src\buffer.c" />
|
||||
<ClCompile Include="..\..\src\HDE\hde32.c">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\HDE\hde64.c">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\hook.c" />
|
||||
<ClCompile Include="..\..\src\trampoline.c" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\include\MinHook.h" />
|
||||
<ClInclude Include="..\..\src\buffer.h" />
|
||||
<ClInclude Include="..\..\src\HDE\hde32.h" />
|
||||
<ClInclude Include="..\..\src\HDE\hde64.h" />
|
||||
<ClInclude Include="..\..\src\HDE\pstdint.h" />
|
||||
<ClInclude Include="..\..\src\HDE\table32.h" />
|
||||
<ClInclude Include="..\..\src\HDE\table64.h" />
|
||||
<ClInclude Include="..\..\src\trampoline.h" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
|
@ -1,55 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\src\buffer.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\hook.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\trampoline.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\HDE\hde32.c">
|
||||
<Filter>HDE</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\HDE\hde64.c">
|
||||
<Filter>HDE</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\src\trampoline.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\buffer.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\include\MinHook.h" />
|
||||
<ClInclude Include="..\..\src\HDE\hde32.h">
|
||||
<Filter>HDE</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\HDE\hde64.h">
|
||||
<Filter>HDE</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\HDE\pstdint.h">
|
||||
<Filter>HDE</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\HDE\table32.h">
|
||||
<Filter>HDE</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\HDE\table64.h">
|
||||
<Filter>HDE</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{9d24b740-be2e-4cfd-b9a4-340a50946ee9}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{76381bc7-2863-4cc5-aede-926ec2c506e4}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="HDE">
|
||||
<UniqueIdentifier>{56ddb326-6179-430d-ae19-e13bfd767bfa}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -1,343 +0,0 @@
|
|||
<?xml version="1.0" encoding="shift_jis"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="9.00"
|
||||
Name="MinHook"
|
||||
ProjectGUID="{027FAC75-3FDB-4044-8DD0-BC297BD4C461}"
|
||||
RootNamespace="MinHook"
|
||||
Keyword="Win32Proj"
|
||||
TargetFrameworkVersion="196613"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
<Platform
|
||||
Name="x64"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="$(SolutionDir)bin\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)\$(ProjectName)"
|
||||
ConfigurationType="2"
|
||||
CharacterSet="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;MINHOOK_EXPORTS"
|
||||
MinimalRebuild="false"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="4"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="$(OutDir)\$(ProjectName).x86.dll"
|
||||
LinkIncremental="2"
|
||||
ModuleDefinitionFile="$(SolutionDir)..\..\dll_resources\MinHook.def"
|
||||
GenerateDebugInformation="false"
|
||||
SubSystem="2"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Debug|x64"
|
||||
OutputDirectory="$(SolutionDir)bin\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)\$(ProjectName)"
|
||||
ConfigurationType="2"
|
||||
CharacterSet="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TargetEnvironment="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;MINHOOK_EXPORTS"
|
||||
MinimalRebuild="false"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="$(OutDir)\$(ProjectName).x64.dll"
|
||||
LinkIncremental="2"
|
||||
ModuleDefinitionFile="$(SolutionDir)..\..\dll_resources\MinHook.def"
|
||||
GenerateDebugInformation="false"
|
||||
SubSystem="2"
|
||||
TargetMachine="17"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="$(SolutionDir)bin\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)\$(ProjectName)"
|
||||
ConfigurationType="2"
|
||||
CharacterSet="1"
|
||||
WholeProgramOptimization="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="1"
|
||||
EnableIntrinsicFunctions="true"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;MINHOOK_EXPORTS"
|
||||
MinimalRebuild="false"
|
||||
RuntimeLibrary="0"
|
||||
EnableFunctionLevelLinking="true"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="$(OutDir)\$(ProjectName).x86.dll"
|
||||
LinkIncremental="1"
|
||||
ModuleDefinitionFile="$(SolutionDir)..\..\dll_resources\MinHook.def"
|
||||
GenerateDebugInformation="false"
|
||||
SubSystem="2"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
ResourceOnlyDLL="true"
|
||||
MergeSections=".CRT=.text"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|x64"
|
||||
OutputDirectory="$(SolutionDir)bin\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)\$(ProjectName)"
|
||||
ConfigurationType="2"
|
||||
CharacterSet="1"
|
||||
WholeProgramOptimization="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TargetEnvironment="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="1"
|
||||
EnableIntrinsicFunctions="true"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;MINHOOK_EXPORTS"
|
||||
MinimalRebuild="false"
|
||||
RuntimeLibrary="0"
|
||||
EnableFunctionLevelLinking="true"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="$(OutDir)\$(ProjectName).x64.dll"
|
||||
LinkIncremental="1"
|
||||
ModuleDefinitionFile="$(SolutionDir)..\..\dll_resources\MinHook.def"
|
||||
GenerateDebugInformation="false"
|
||||
SubSystem="2"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
ResourceOnlyDLL="true"
|
||||
MergeSections=".CRT=.text"
|
||||
TargetMachine="17"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<File
|
||||
RelativePath="..\..\dll_resources\MinHook.def"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\dll_resources\MinHook.rc"
|
||||
>
|
||||
</File>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
|
@ -1,39 +0,0 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 10.00
|
||||
# Visual Studio 2008
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libMinHook", "libMinHook.vcproj", "{F142A341-5EE0-442D-A15F-98AE9B48DBAE}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MinHook", "MinHook.vcproj", "{027FAC75-3FDB-4044-8DD0-BC297BD4C461}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{F142A341-5EE0-442D-A15F-98AE9B48DBAE} = {F142A341-5EE0-442D-A15F-98AE9B48DBAE}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Debug|x64 = Debug|x64
|
||||
Release|Win32 = Release|Win32
|
||||
Release|x64 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Debug|x64.Build.0 = Debug|x64
|
||||
{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Release|Win32.Build.0 = Release|Win32
|
||||
{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Release|x64.ActiveCfg = Release|x64
|
||||
{F142A341-5EE0-442D-A15F-98AE9B48DBAE}.Release|x64.Build.0 = Release|x64
|
||||
{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Debug|x64.Build.0 = Debug|x64
|
||||
{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Release|Win32.Build.0 = Release|Win32
|
||||
{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Release|x64.ActiveCfg = Release|x64
|
||||
{027FAC75-3FDB-4044-8DD0-BC297BD4C461}.Release|x64.Build.0 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
|
@ -1,410 +0,0 @@
|
|||
<?xml version="1.0" encoding="shift_jis"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="9.00"
|
||||
Name="libMinHook"
|
||||
ProjectGUID="{F142A341-5EE0-442D-A15F-98AE9B48DBAE}"
|
||||
RootNamespace="libMinHook"
|
||||
Keyword="Win32Proj"
|
||||
TargetFrameworkVersion="196613"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
<Platform
|
||||
Name="x64"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="$(SolutionDir)lib\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)\$(ProjectName)"
|
||||
ConfigurationType="4"
|
||||
CharacterSet="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;STRICT"
|
||||
MinimalRebuild="false"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="0"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
OutputFile="$(OutDir)\$(ProjectName).x86.lib"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Debug|x64"
|
||||
OutputDirectory="$(SolutionDir)lib\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)\$(ProjectName)"
|
||||
ConfigurationType="4"
|
||||
CharacterSet="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TargetEnvironment="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
WholeProgramOptimization="false"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;STRICT"
|
||||
MinimalRebuild="false"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="0"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
OutputFile="$(OutDir)\$(ProjectName).x64.lib"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="$(SolutionDir)lib\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)\$(ProjectName)"
|
||||
ConfigurationType="4"
|
||||
CharacterSet="1"
|
||||
WholeProgramOptimization="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="1"
|
||||
InlineFunctionExpansion="2"
|
||||
EnableIntrinsicFunctions="true"
|
||||
WholeProgramOptimization="true"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;STRICT"
|
||||
MinimalRebuild="false"
|
||||
RuntimeLibrary="0"
|
||||
EnableFunctionLevelLinking="true"
|
||||
UsePrecompiledHeader="0"
|
||||
AssemblerOutput="2"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="0"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
OutputFile="$(OutDir)\$(ProjectName).x86.lib"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|x64"
|
||||
OutputDirectory="$(SolutionDir)lib\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)\$(ProjectName)"
|
||||
ConfigurationType="4"
|
||||
CharacterSet="1"
|
||||
WholeProgramOptimization="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TargetEnvironment="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="1"
|
||||
InlineFunctionExpansion="2"
|
||||
EnableIntrinsicFunctions="true"
|
||||
WholeProgramOptimization="true"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;STRICT"
|
||||
MinimalRebuild="false"
|
||||
RuntimeLibrary="0"
|
||||
EnableFunctionLevelLinking="true"
|
||||
UsePrecompiledHeader="0"
|
||||
AssemblerOutput="2"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="0"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
OutputFile="$(OutDir)\$(ProjectName).x64.lib"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
|
||||
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\..\src\buffer.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\hook.c"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|x64"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\trampoline.c"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl;inc;xsd"
|
||||
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\..\src\buffer.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\trampoline.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="HDE"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\..\src\HDE\hde32.c"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|x64"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|x64"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\HDE\hde32.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\HDE\hde64.c"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\HDE\hde64.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\HDE\pstdint.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\HDE\table32.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\HDE\table64.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<File
|
||||
RelativePath="..\..\include\MinHook.h"
|
||||
>
|
||||
</File>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
|
@ -1,14 +0,0 @@
|
|||
EXPORTS
|
||||
MH_Initialize
|
||||
MH_Uninitialize
|
||||
|
||||
MH_CreateHook
|
||||
MH_CreateHookApi
|
||||
MH_CreateHookApiEx
|
||||
MH_RemoveHook
|
||||
MH_EnableHook
|
||||
MH_DisableHook
|
||||
MH_QueueEnableHook
|
||||
MH_QueueDisableHook
|
||||
MH_ApplyQueued
|
||||
MH_StatusToString
|
|
@ -1,32 +0,0 @@
|
|||
1 VERSIONINFO
|
||||
FILEVERSION 1,3,3,0
|
||||
PRODUCTVERSION 1,3,3,0
|
||||
FILEFLAGSMASK 0x17L
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
#else
|
||||
FILEFLAGS 0x0L
|
||||
#endif
|
||||
FILEOS 0x4L
|
||||
FILETYPE 0x2L
|
||||
FILESUBTYPE 0x0L
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "040904b0"
|
||||
BEGIN
|
||||
VALUE "CompanyName", "Tsuda Kageyu"
|
||||
VALUE "FileDescription", "MinHook - The Minimalistic API Hook Library for x64/x86"
|
||||
VALUE "FileVersion", "1.3.3.0"
|
||||
VALUE "InternalName", "MinHookD"
|
||||
VALUE "LegalCopyright", "Copyright (C) 2009-2017 Tsuda Kageyu. All rights reserved."
|
||||
VALUE "LegalTrademarks", "Tsuda Kageyu"
|
||||
VALUE "ProductName", "MinHook DLL"
|
||||
VALUE "ProductVersion", "1.3.3.0"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x409, 1200
|
||||
END
|
||||
END
|
|
@ -1,186 +0,0 @@
|
|||
/*
|
||||
* MinHook - The Minimalistic API Hooking Library for x64/x86
|
||||
* Copyright (C) 2009-2017 Tsuda Kageyu.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER
|
||||
* OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#if !(defined _M_IX86) && !(defined _M_X64) && !(defined __i386__) && !(defined __x86_64__)
|
||||
#error MinHook supports only x86 and x64 systems.
|
||||
#endif
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
// MinHook Error Codes.
|
||||
typedef enum MH_STATUS
|
||||
{
|
||||
// Unknown error. Should not be returned.
|
||||
MH_UNKNOWN = -1,
|
||||
|
||||
// Successful.
|
||||
MH_OK = 0,
|
||||
|
||||
// MinHook is already initialized.
|
||||
MH_ERROR_ALREADY_INITIALIZED,
|
||||
|
||||
// MinHook is not initialized yet, or already uninitialized.
|
||||
MH_ERROR_NOT_INITIALIZED,
|
||||
|
||||
// The hook for the specified target function is already created.
|
||||
MH_ERROR_ALREADY_CREATED,
|
||||
|
||||
// The hook for the specified target function is not created yet.
|
||||
MH_ERROR_NOT_CREATED,
|
||||
|
||||
// The hook for the specified target function is already enabled.
|
||||
MH_ERROR_ENABLED,
|
||||
|
||||
// The hook for the specified target function is not enabled yet, or already
|
||||
// disabled.
|
||||
MH_ERROR_DISABLED,
|
||||
|
||||
// The specified pointer is invalid. It points the address of non-allocated
|
||||
// and/or non-executable region.
|
||||
MH_ERROR_NOT_EXECUTABLE,
|
||||
|
||||
// The specified target function cannot be hooked.
|
||||
MH_ERROR_UNSUPPORTED_FUNCTION,
|
||||
|
||||
// Failed to allocate memory.
|
||||
MH_ERROR_MEMORY_ALLOC,
|
||||
|
||||
// Failed to change the memory protection.
|
||||
MH_ERROR_MEMORY_PROTECT,
|
||||
|
||||
// The specified module is not loaded.
|
||||
MH_ERROR_MODULE_NOT_FOUND,
|
||||
|
||||
// The specified function is not found.
|
||||
MH_ERROR_FUNCTION_NOT_FOUND
|
||||
}
|
||||
MH_STATUS;
|
||||
|
||||
// Can be passed as a parameter to MH_EnableHook, MH_DisableHook,
|
||||
// MH_QueueEnableHook or MH_QueueDisableHook.
|
||||
#define MH_ALL_HOOKS NULL
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
// Initialize the MinHook library. You must call this function EXACTLY ONCE
|
||||
// at the beginning of your program.
|
||||
MH_STATUS WINAPI MH_Initialize(VOID);
|
||||
|
||||
// Uninitialize the MinHook library. You must call this function EXACTLY
|
||||
// ONCE at the end of your program.
|
||||
MH_STATUS WINAPI MH_Uninitialize(VOID);
|
||||
|
||||
// Creates a Hook for the specified target function, in disabled state.
|
||||
// Parameters:
|
||||
// pTarget [in] A pointer to the target function, which will be
|
||||
// overridden by the detour function.
|
||||
// pDetour [in] A pointer to the detour function, which will override
|
||||
// the target function.
|
||||
// ppOriginal [out] A pointer to the trampoline function, which will be
|
||||
// used to call the original target function.
|
||||
// This parameter can be NULL.
|
||||
MH_STATUS WINAPI MH_CreateHook(LPVOID pTarget, LPVOID pDetour, LPVOID *ppOriginal);
|
||||
|
||||
// Creates a Hook for the specified API function, in disabled state.
|
||||
// Parameters:
|
||||
// pszModule [in] A pointer to the loaded module name which contains the
|
||||
// target function.
|
||||
// pszTarget [in] A pointer to the target function name, which will be
|
||||
// overridden by the detour function.
|
||||
// pDetour [in] A pointer to the detour function, which will override
|
||||
// the target function.
|
||||
// ppOriginal [out] A pointer to the trampoline function, which will be
|
||||
// used to call the original target function.
|
||||
// This parameter can be NULL.
|
||||
MH_STATUS WINAPI MH_CreateHookApi(
|
||||
LPCWSTR pszModule, LPCSTR pszProcName, LPVOID pDetour, LPVOID *ppOriginal);
|
||||
|
||||
// Creates a Hook for the specified API function, in disabled state.
|
||||
// Parameters:
|
||||
// pszModule [in] A pointer to the loaded module name which contains the
|
||||
// target function.
|
||||
// pszTarget [in] A pointer to the target function name, which will be
|
||||
// overridden by the detour function.
|
||||
// pDetour [in] A pointer to the detour function, which will override
|
||||
// the target function.
|
||||
// ppOriginal [out] A pointer to the trampoline function, which will be
|
||||
// used to call the original target function.
|
||||
// This parameter can be NULL.
|
||||
// ppTarget [out] A pointer to the target function, which will be used
|
||||
// with other functions.
|
||||
// This parameter can be NULL.
|
||||
MH_STATUS WINAPI MH_CreateHookApiEx(
|
||||
LPCWSTR pszModule, LPCSTR pszProcName, LPVOID pDetour, LPVOID *ppOriginal, LPVOID *ppTarget);
|
||||
|
||||
// Removes an already created hook.
|
||||
// Parameters:
|
||||
// pTarget [in] A pointer to the target function.
|
||||
MH_STATUS WINAPI MH_RemoveHook(LPVOID pTarget);
|
||||
|
||||
// Enables an already created hook.
|
||||
// Parameters:
|
||||
// pTarget [in] A pointer to the target function.
|
||||
// If this parameter is MH_ALL_HOOKS, all created hooks are
|
||||
// enabled in one go.
|
||||
MH_STATUS WINAPI MH_EnableHook(LPVOID pTarget);
|
||||
|
||||
// Disables an already created hook.
|
||||
// Parameters:
|
||||
// pTarget [in] A pointer to the target function.
|
||||
// If this parameter is MH_ALL_HOOKS, all created hooks are
|
||||
// disabled in one go.
|
||||
MH_STATUS WINAPI MH_DisableHook(LPVOID pTarget);
|
||||
|
||||
// Queues to enable an already created hook.
|
||||
// Parameters:
|
||||
// pTarget [in] A pointer to the target function.
|
||||
// If this parameter is MH_ALL_HOOKS, all created hooks are
|
||||
// queued to be enabled.
|
||||
MH_STATUS WINAPI MH_QueueEnableHook(LPVOID pTarget);
|
||||
|
||||
// Queues to disable an already created hook.
|
||||
// Parameters:
|
||||
// pTarget [in] A pointer to the target function.
|
||||
// If this parameter is MH_ALL_HOOKS, all created hooks are
|
||||
// queued to be disabled.
|
||||
MH_STATUS WINAPI MH_QueueDisableHook(LPVOID pTarget);
|
||||
|
||||
// Applies all queued changes in one go.
|
||||
MH_STATUS WINAPI MH_ApplyQueued(VOID);
|
||||
|
||||
// Translates the MH_STATUS to its name as a string.
|
||||
const char * WINAPI MH_StatusToString(MH_STATUS status);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
@ -1,326 +0,0 @@
|
|||
/*
|
||||
* Hacker Disassembler Engine 32 C
|
||||
* Copyright (c) 2008-2009, Vyacheslav Patkov.
|
||||
* All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
#if defined(_M_IX86) || defined(__i386__)
|
||||
|
||||
#include "hde32.h"
|
||||
#include "table32.h"
|
||||
|
||||
unsigned int hde32_disasm(const void *code, hde32s *hs)
|
||||
{
|
||||
uint8_t x, c, *p = (uint8_t *)code, cflags, opcode, pref = 0;
|
||||
uint8_t *ht = hde32_table, m_mod, m_reg, m_rm, disp_size = 0;
|
||||
|
||||
// Avoid using memset to reduce the footprint.
|
||||
#ifndef _MSC_VER
|
||||
memset((LPBYTE)hs, 0, sizeof(hde32s));
|
||||
#else
|
||||
__stosb((LPBYTE)hs, 0, sizeof(hde32s));
|
||||
#endif
|
||||
|
||||
for (x = 16; x; x--)
|
||||
switch (c = *p++) {
|
||||
case 0xf3:
|
||||
hs->p_rep = c;
|
||||
pref |= PRE_F3;
|
||||
break;
|
||||
case 0xf2:
|
||||
hs->p_rep = c;
|
||||
pref |= PRE_F2;
|
||||
break;
|
||||
case 0xf0:
|
||||
hs->p_lock = c;
|
||||
pref |= PRE_LOCK;
|
||||
break;
|
||||
case 0x26: case 0x2e: case 0x36:
|
||||
case 0x3e: case 0x64: case 0x65:
|
||||
hs->p_seg = c;
|
||||
pref |= PRE_SEG;
|
||||
break;
|
||||
case 0x66:
|
||||
hs->p_66 = c;
|
||||
pref |= PRE_66;
|
||||
break;
|
||||
case 0x67:
|
||||
hs->p_67 = c;
|
||||
pref |= PRE_67;
|
||||
break;
|
||||
default:
|
||||
goto pref_done;
|
||||
}
|
||||
pref_done:
|
||||
|
||||
hs->flags = (uint32_t)pref << 23;
|
||||
|
||||
if (!pref)
|
||||
pref |= PRE_NONE;
|
||||
|
||||
if ((hs->opcode = c) == 0x0f) {
|
||||
hs->opcode2 = c = *p++;
|
||||
ht += DELTA_OPCODES;
|
||||
} else if (c >= 0xa0 && c <= 0xa3) {
|
||||
if (pref & PRE_67)
|
||||
pref |= PRE_66;
|
||||
else
|
||||
pref &= ~PRE_66;
|
||||
}
|
||||
|
||||
opcode = c;
|
||||
cflags = ht[ht[opcode / 4] + (opcode % 4)];
|
||||
|
||||
if (cflags == C_ERROR) {
|
||||
hs->flags |= F_ERROR | F_ERROR_OPCODE;
|
||||
cflags = 0;
|
||||
if ((opcode & -3) == 0x24)
|
||||
cflags++;
|
||||
}
|
||||
|
||||
x = 0;
|
||||
if (cflags & C_GROUP) {
|
||||
uint16_t t;
|
||||
t = *(uint16_t *)(ht + (cflags & 0x7f));
|
||||
cflags = (uint8_t)t;
|
||||
x = (uint8_t)(t >> 8);
|
||||
}
|
||||
|
||||
if (hs->opcode2) {
|
||||
ht = hde32_table + DELTA_PREFIXES;
|
||||
if (ht[ht[opcode / 4] + (opcode % 4)] & pref)
|
||||
hs->flags |= F_ERROR | F_ERROR_OPCODE;
|
||||
}
|
||||
|
||||
if (cflags & C_MODRM) {
|
||||
hs->flags |= F_MODRM;
|
||||
hs->modrm = c = *p++;
|
||||
hs->modrm_mod = m_mod = c >> 6;
|
||||
hs->modrm_rm = m_rm = c & 7;
|
||||
hs->modrm_reg = m_reg = (c & 0x3f) >> 3;
|
||||
|
||||
if (x && ((x << m_reg) & 0x80))
|
||||
hs->flags |= F_ERROR | F_ERROR_OPCODE;
|
||||
|
||||
if (!hs->opcode2 && opcode >= 0xd9 && opcode <= 0xdf) {
|
||||
uint8_t t = opcode - 0xd9;
|
||||
if (m_mod == 3) {
|
||||
ht = hde32_table + DELTA_FPU_MODRM + t*8;
|
||||
t = ht[m_reg] << m_rm;
|
||||
} else {
|
||||
ht = hde32_table + DELTA_FPU_REG;
|
||||
t = ht[t] << m_reg;
|
||||
}
|
||||
if (t & 0x80)
|
||||
hs->flags |= F_ERROR | F_ERROR_OPCODE;
|
||||
}
|
||||
|
||||
if (pref & PRE_LOCK) {
|
||||
if (m_mod == 3) {
|
||||
hs->flags |= F_ERROR | F_ERROR_LOCK;
|
||||
} else {
|
||||
uint8_t *table_end, op = opcode;
|
||||
if (hs->opcode2) {
|
||||
ht = hde32_table + DELTA_OP2_LOCK_OK;
|
||||
table_end = ht + DELTA_OP_ONLY_MEM - DELTA_OP2_LOCK_OK;
|
||||
} else {
|
||||
ht = hde32_table + DELTA_OP_LOCK_OK;
|
||||
table_end = ht + DELTA_OP2_LOCK_OK - DELTA_OP_LOCK_OK;
|
||||
op &= -2;
|
||||
}
|
||||
for (; ht != table_end; ht++)
|
||||
if (*ht++ == op) {
|
||||
if (!((*ht << m_reg) & 0x80))
|
||||
goto no_lock_error;
|
||||
else
|
||||
break;
|
||||
}
|
||||
hs->flags |= F_ERROR | F_ERROR_LOCK;
|
||||
no_lock_error:
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
if (hs->opcode2) {
|
||||
switch (opcode) {
|
||||
case 0x20: case 0x22:
|
||||
m_mod = 3;
|
||||
if (m_reg > 4 || m_reg == 1)
|
||||
goto error_operand;
|
||||
else
|
||||
goto no_error_operand;
|
||||
case 0x21: case 0x23:
|
||||
m_mod = 3;
|
||||
if (m_reg == 4 || m_reg == 5)
|
||||
goto error_operand;
|
||||
else
|
||||
goto no_error_operand;
|
||||
}
|
||||
} else {
|
||||
switch (opcode) {
|
||||
case 0x8c:
|
||||
if (m_reg > 5)
|
||||
goto error_operand;
|
||||
else
|
||||
goto no_error_operand;
|
||||
case 0x8e:
|
||||
if (m_reg == 1 || m_reg > 5)
|
||||
goto error_operand;
|
||||
else
|
||||
goto no_error_operand;
|
||||
}
|
||||
}
|
||||
|
||||
if (m_mod == 3) {
|
||||
uint8_t *table_end;
|
||||
if (hs->opcode2) {
|
||||
ht = hde32_table + DELTA_OP2_ONLY_MEM;
|
||||
table_end = ht + sizeof(hde32_table) - DELTA_OP2_ONLY_MEM;
|
||||
} else {
|
||||
ht = hde32_table + DELTA_OP_ONLY_MEM;
|
||||
table_end = ht + DELTA_OP2_ONLY_MEM - DELTA_OP_ONLY_MEM;
|
||||
}
|
||||
for (; ht != table_end; ht += 2)
|
||||
if (*ht++ == opcode) {
|
||||
if (*ht++ & pref && !((*ht << m_reg) & 0x80))
|
||||
goto error_operand;
|
||||
else
|
||||
break;
|
||||
}
|
||||
goto no_error_operand;
|
||||
} else if (hs->opcode2) {
|
||||
switch (opcode) {
|
||||
case 0x50: case 0xd7: case 0xf7:
|
||||
if (pref & (PRE_NONE | PRE_66))
|
||||
goto error_operand;
|
||||
break;
|
||||
case 0xd6:
|
||||
if (pref & (PRE_F2 | PRE_F3))
|
||||
goto error_operand;
|
||||
break;
|
||||
case 0xc5:
|
||||
goto error_operand;
|
||||
}
|
||||
goto no_error_operand;
|
||||
} else
|
||||
goto no_error_operand;
|
||||
|
||||
error_operand:
|
||||
hs->flags |= F_ERROR | F_ERROR_OPERAND;
|
||||
no_error_operand:
|
||||
|
||||
c = *p++;
|
||||
if (m_reg <= 1) {
|
||||
if (opcode == 0xf6)
|
||||
cflags |= C_IMM8;
|
||||
else if (opcode == 0xf7)
|
||||
cflags |= C_IMM_P66;
|
||||
}
|
||||
|
||||
switch (m_mod) {
|
||||
case 0:
|
||||
if (pref & PRE_67) {
|
||||
if (m_rm == 6)
|
||||
disp_size = 2;
|
||||
} else
|
||||
if (m_rm == 5)
|
||||
disp_size = 4;
|
||||
break;
|
||||
case 1:
|
||||
disp_size = 1;
|
||||
break;
|
||||
case 2:
|
||||
disp_size = 2;
|
||||
if (!(pref & PRE_67))
|
||||
disp_size <<= 1;
|
||||
}
|
||||
|
||||
if (m_mod != 3 && m_rm == 4 && !(pref & PRE_67)) {
|
||||
hs->flags |= F_SIB;
|
||||
p++;
|
||||
hs->sib = c;
|
||||
hs->sib_scale = c >> 6;
|
||||
hs->sib_index = (c & 0x3f) >> 3;
|
||||
if ((hs->sib_base = c & 7) == 5 && !(m_mod & 1))
|
||||
disp_size = 4;
|
||||
}
|
||||
|
||||
p--;
|
||||
switch (disp_size) {
|
||||
case 1:
|
||||
hs->flags |= F_DISP8;
|
||||
hs->disp.disp8 = *p;
|
||||
break;
|
||||
case 2:
|
||||
hs->flags |= F_DISP16;
|
||||
hs->disp.disp16 = *(uint16_t *)p;
|
||||
break;
|
||||
case 4:
|
||||
hs->flags |= F_DISP32;
|
||||
hs->disp.disp32 = *(uint32_t *)p;
|
||||
}
|
||||
p += disp_size;
|
||||
} else if (pref & PRE_LOCK)
|
||||
hs->flags |= F_ERROR | F_ERROR_LOCK;
|
||||
|
||||
if (cflags & C_IMM_P66) {
|
||||
if (cflags & C_REL32) {
|
||||
if (pref & PRE_66) {
|
||||
hs->flags |= F_IMM16 | F_RELATIVE;
|
||||
hs->imm.imm16 = *(uint16_t *)p;
|
||||
p += 2;
|
||||
goto disasm_done;
|
||||
}
|
||||
goto rel32_ok;
|
||||
}
|
||||
if (pref & PRE_66) {
|
||||
hs->flags |= F_IMM16;
|
||||
hs->imm.imm16 = *(uint16_t *)p;
|
||||
p += 2;
|
||||
} else {
|
||||
hs->flags |= F_IMM32;
|
||||
hs->imm.imm32 = *(uint32_t *)p;
|
||||
p += 4;
|
||||
}
|
||||
}
|
||||
|
||||
if (cflags & C_IMM16) {
|
||||
if (hs->flags & F_IMM32) {
|
||||
hs->flags |= F_IMM16;
|
||||
hs->disp.disp16 = *(uint16_t *)p;
|
||||
} else if (hs->flags & F_IMM16) {
|
||||
hs->flags |= F_2IMM16;
|
||||
hs->disp.disp16 = *(uint16_t *)p;
|
||||
} else {
|
||||
hs->flags |= F_IMM16;
|
||||
hs->imm.imm16 = *(uint16_t *)p;
|
||||
}
|
||||
p += 2;
|
||||
}
|
||||
if (cflags & C_IMM8) {
|
||||
hs->flags |= F_IMM8;
|
||||
hs->imm.imm8 = *p++;
|
||||
}
|
||||
|
||||
if (cflags & C_REL32) {
|
||||
rel32_ok:
|
||||
hs->flags |= F_IMM32 | F_RELATIVE;
|
||||
hs->imm.imm32 = *(uint32_t *)p;
|
||||
p += 4;
|
||||
} else if (cflags & C_REL8) {
|
||||
hs->flags |= F_IMM8 | F_RELATIVE;
|
||||
hs->imm.imm8 = *p++;
|
||||
}
|
||||
|
||||
disasm_done:
|
||||
|
||||
if ((hs->len = (uint8_t)(p-(uint8_t *)code)) > 15) {
|
||||
hs->flags |= F_ERROR | F_ERROR_LENGTH;
|
||||
hs->len = 15;
|
||||
}
|
||||
|
||||
return (unsigned int)hs->len;
|
||||
}
|
||||
|
||||
#endif // defined(_M_IX86) || defined(__i386__)
|
|
@ -1,105 +0,0 @@
|
|||
/*
|
||||
* Hacker Disassembler Engine 32
|
||||
* Copyright (c) 2006-2009, Vyacheslav Patkov.
|
||||
* All rights reserved.
|
||||
*
|
||||
* hde32.h: C/C++ header file
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _HDE32_H_
|
||||
#define _HDE32_H_
|
||||
|
||||
/* stdint.h - C99 standard header
|
||||
* http://en.wikipedia.org/wiki/stdint.h
|
||||
*
|
||||
* if your compiler doesn't contain "stdint.h" header (for
|
||||
* example, Microsoft Visual C++), you can download file:
|
||||
* http://www.azillionmonkeys.com/qed/pstdint.h
|
||||
* and change next line to:
|
||||
* #include "pstdint.h"
|
||||
*/
|
||||
#include "pstdint.h"
|
||||
|
||||
#define F_MODRM 0x00000001
|
||||
#define F_SIB 0x00000002
|
||||
#define F_IMM8 0x00000004
|
||||
#define F_IMM16 0x00000008
|
||||
#define F_IMM32 0x00000010
|
||||
#define F_DISP8 0x00000020
|
||||
#define F_DISP16 0x00000040
|
||||
#define F_DISP32 0x00000080
|
||||
#define F_RELATIVE 0x00000100
|
||||
#define F_2IMM16 0x00000800
|
||||
#define F_ERROR 0x00001000
|
||||
#define F_ERROR_OPCODE 0x00002000
|
||||
#define F_ERROR_LENGTH 0x00004000
|
||||
#define F_ERROR_LOCK 0x00008000
|
||||
#define F_ERROR_OPERAND 0x00010000
|
||||
#define F_PREFIX_REPNZ 0x01000000
|
||||
#define F_PREFIX_REPX 0x02000000
|
||||
#define F_PREFIX_REP 0x03000000
|
||||
#define F_PREFIX_66 0x04000000
|
||||
#define F_PREFIX_67 0x08000000
|
||||
#define F_PREFIX_LOCK 0x10000000
|
||||
#define F_PREFIX_SEG 0x20000000
|
||||
#define F_PREFIX_ANY 0x3f000000
|
||||
|
||||
#define PREFIX_SEGMENT_CS 0x2e
|
||||
#define PREFIX_SEGMENT_SS 0x36
|
||||
#define PREFIX_SEGMENT_DS 0x3e
|
||||
#define PREFIX_SEGMENT_ES 0x26
|
||||
#define PREFIX_SEGMENT_FS 0x64
|
||||
#define PREFIX_SEGMENT_GS 0x65
|
||||
#define PREFIX_LOCK 0xf0
|
||||
#define PREFIX_REPNZ 0xf2
|
||||
#define PREFIX_REPX 0xf3
|
||||
#define PREFIX_OPERAND_SIZE 0x66
|
||||
#define PREFIX_ADDRESS_SIZE 0x67
|
||||
|
||||
#pragma pack(push,1)
|
||||
|
||||
typedef struct {
|
||||
uint8_t len;
|
||||
uint8_t p_rep;
|
||||
uint8_t p_lock;
|
||||
uint8_t p_seg;
|
||||
uint8_t p_66;
|
||||
uint8_t p_67;
|
||||
uint8_t opcode;
|
||||
uint8_t opcode2;
|
||||
uint8_t modrm;
|
||||
uint8_t modrm_mod;
|
||||
uint8_t modrm_reg;
|
||||
uint8_t modrm_rm;
|
||||
uint8_t sib;
|
||||
uint8_t sib_scale;
|
||||
uint8_t sib_index;
|
||||
uint8_t sib_base;
|
||||
union {
|
||||
uint8_t imm8;
|
||||
uint16_t imm16;
|
||||
uint32_t imm32;
|
||||
} imm;
|
||||
union {
|
||||
uint8_t disp8;
|
||||
uint16_t disp16;
|
||||
uint32_t disp32;
|
||||
} disp;
|
||||
uint32_t flags;
|
||||
} hde32s;
|
||||
|
||||
#pragma pack(pop)
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* __cdecl */
|
||||
unsigned int hde32_disasm(const void *code, hde32s *hs);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _HDE32_H_ */
|
|
@ -1,337 +0,0 @@
|
|||
/*
|
||||
* Hacker Disassembler Engine 64 C
|
||||
* Copyright (c) 2008-2009, Vyacheslav Patkov.
|
||||
* All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
#if defined(_M_X64) || defined(__x86_64__)
|
||||
|
||||
#include "hde64.h"
|
||||
#include "table64.h"
|
||||
|
||||
unsigned int hde64_disasm(const void *code, hde64s *hs)
|
||||
{
|
||||
uint8_t x, c, *p = (uint8_t *)code, cflags, opcode, pref = 0;
|
||||
uint8_t *ht = hde64_table, m_mod, m_reg, m_rm, disp_size = 0;
|
||||
uint8_t op64 = 0;
|
||||
|
||||
// Avoid using memset to reduce the footprint.
|
||||
#ifndef _MSC_VER
|
||||
memset((LPBYTE)hs, 0, sizeof(hde64s));
|
||||
#else
|
||||
__stosb((LPBYTE)hs, 0, sizeof(hde64s));
|
||||
#endif
|
||||
|
||||
for (x = 16; x; x--)
|
||||
switch (c = *p++) {
|
||||
case 0xf3:
|
||||
hs->p_rep = c;
|
||||
pref |= PRE_F3;
|
||||
break;
|
||||
case 0xf2:
|
||||
hs->p_rep = c;
|
||||
pref |= PRE_F2;
|
||||
break;
|
||||
case 0xf0:
|
||||
hs->p_lock = c;
|
||||
pref |= PRE_LOCK;
|
||||
break;
|
||||
case 0x26: case 0x2e: case 0x36:
|
||||
case 0x3e: case 0x64: case 0x65:
|
||||
hs->p_seg = c;
|
||||
pref |= PRE_SEG;
|
||||
break;
|
||||
case 0x66:
|
||||
hs->p_66 = c;
|
||||
pref |= PRE_66;
|
||||
break;
|
||||
case 0x67:
|
||||
hs->p_67 = c;
|
||||
pref |= PRE_67;
|
||||
break;
|
||||
default:
|
||||
goto pref_done;
|
||||
}
|
||||
pref_done:
|
||||
|
||||
hs->flags = (uint32_t)pref << 23;
|
||||
|
||||
if (!pref)
|
||||
pref |= PRE_NONE;
|
||||
|
||||
if ((c & 0xf0) == 0x40) {
|
||||
hs->flags |= F_PREFIX_REX;
|
||||
if ((hs->rex_w = (c & 0xf) >> 3) && (*p & 0xf8) == 0xb8)
|
||||
op64++;
|
||||
hs->rex_r = (c & 7) >> 2;
|
||||
hs->rex_x = (c & 3) >> 1;
|
||||
hs->rex_b = c & 1;
|
||||
if (((c = *p++) & 0xf0) == 0x40) {
|
||||
opcode = c;
|
||||
goto error_opcode;
|
||||
}
|
||||
}
|
||||
|
||||
if ((hs->opcode = c) == 0x0f) {
|
||||
hs->opcode2 = c = *p++;
|
||||
ht += DELTA_OPCODES;
|
||||
} else if (c >= 0xa0 && c <= 0xa3) {
|
||||
op64++;
|
||||
if (pref & PRE_67)
|
||||
pref |= PRE_66;
|
||||
else
|
||||
pref &= ~PRE_66;
|
||||
}
|
||||
|
||||
opcode = c;
|
||||
cflags = ht[ht[opcode / 4] + (opcode % 4)];
|
||||
|
||||
if (cflags == C_ERROR) {
|
||||
error_opcode:
|
||||
hs->flags |= F_ERROR | F_ERROR_OPCODE;
|
||||
cflags = 0;
|
||||
if ((opcode & -3) == 0x24)
|
||||
cflags++;
|
||||
}
|
||||
|
||||
x = 0;
|
||||
if (cflags & C_GROUP) {
|
||||
uint16_t t;
|
||||
t = *(uint16_t *)(ht + (cflags & 0x7f));
|
||||
cflags = (uint8_t)t;
|
||||
x = (uint8_t)(t >> 8);
|
||||
}
|
||||
|
||||
if (hs->opcode2) {
|
||||
ht = hde64_table + DELTA_PREFIXES;
|
||||
if (ht[ht[opcode / 4] + (opcode % 4)] & pref)
|
||||
hs->flags |= F_ERROR | F_ERROR_OPCODE;
|
||||
}
|
||||
|
||||
if (cflags & C_MODRM) {
|
||||
hs->flags |= F_MODRM;
|
||||
hs->modrm = c = *p++;
|
||||
hs->modrm_mod = m_mod = c >> 6;
|
||||
hs->modrm_rm = m_rm = c & 7;
|
||||
hs->modrm_reg = m_reg = (c & 0x3f) >> 3;
|
||||
|
||||
if (x && ((x << m_reg) & 0x80))
|
||||
hs->flags |= F_ERROR | F_ERROR_OPCODE;
|
||||
|
||||
if (!hs->opcode2 && opcode >= 0xd9 && opcode <= 0xdf) {
|
||||
uint8_t t = opcode - 0xd9;
|
||||
if (m_mod == 3) {
|
||||
ht = hde64_table + DELTA_FPU_MODRM + t*8;
|
||||
t = ht[m_reg] << m_rm;
|
||||
} else {
|
||||
ht = hde64_table + DELTA_FPU_REG;
|
||||
t = ht[t] << m_reg;
|
||||
}
|
||||
if (t & 0x80)
|
||||
hs->flags |= F_ERROR | F_ERROR_OPCODE;
|
||||
}
|
||||
|
||||
if (pref & PRE_LOCK) {
|
||||
if (m_mod == 3) {
|
||||
hs->flags |= F_ERROR | F_ERROR_LOCK;
|
||||
} else {
|
||||
uint8_t *table_end, op = opcode;
|
||||
if (hs->opcode2) {
|
||||
ht = hde64_table + DELTA_OP2_LOCK_OK;
|
||||
table_end = ht + DELTA_OP_ONLY_MEM - DELTA_OP2_LOCK_OK;
|
||||
} else {
|
||||
ht = hde64_table + DELTA_OP_LOCK_OK;
|
||||
table_end = ht + DELTA_OP2_LOCK_OK - DELTA_OP_LOCK_OK;
|
||||
op &= -2;
|
||||
}
|
||||
for (; ht != table_end; ht++)
|
||||
if (*ht++ == op) {
|
||||
if (!((*ht << m_reg) & 0x80))
|
||||
goto no_lock_error;
|
||||
else
|
||||
break;
|
||||
}
|
||||
hs->flags |= F_ERROR | F_ERROR_LOCK;
|
||||
no_lock_error:
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
if (hs->opcode2) {
|
||||
switch (opcode) {
|
||||
case 0x20: case 0x22:
|
||||
m_mod = 3;
|
||||
if (m_reg > 4 || m_reg == 1)
|
||||
goto error_operand;
|
||||
else
|
||||
goto no_error_operand;
|
||||
case 0x21: case 0x23:
|
||||
m_mod = 3;
|
||||
if (m_reg == 4 || m_reg == 5)
|
||||
goto error_operand;
|
||||
else
|
||||
goto no_error_operand;
|
||||
}
|
||||
} else {
|
||||
switch (opcode) {
|
||||
case 0x8c:
|
||||
if (m_reg > 5)
|
||||
goto error_operand;
|
||||
else
|
||||
goto no_error_operand;
|
||||
case 0x8e:
|
||||
if (m_reg == 1 || m_reg > 5)
|
||||
goto error_operand;
|
||||
else
|
||||
goto no_error_operand;
|
||||
}
|
||||
}
|
||||
|
||||
if (m_mod == 3) {
|
||||
uint8_t *table_end;
|
||||
if (hs->opcode2) {
|
||||
ht = hde64_table + DELTA_OP2_ONLY_MEM;
|
||||
table_end = ht + sizeof(hde64_table) - DELTA_OP2_ONLY_MEM;
|
||||
} else {
|
||||
ht = hde64_table + DELTA_OP_ONLY_MEM;
|
||||
table_end = ht + DELTA_OP2_ONLY_MEM - DELTA_OP_ONLY_MEM;
|
||||
}
|
||||
for (; ht != table_end; ht += 2)
|
||||
if (*ht++ == opcode) {
|
||||
if (*ht++ & pref && !((*ht << m_reg) & 0x80))
|
||||
goto error_operand;
|
||||
else
|
||||
break;
|
||||
}
|
||||
goto no_error_operand;
|
||||
} else if (hs->opcode2) {
|
||||
switch (opcode) {
|
||||
case 0x50: case 0xd7: case 0xf7:
|
||||
if (pref & (PRE_NONE | PRE_66))
|
||||
goto error_operand;
|
||||
break;
|
||||
case 0xd6:
|
||||
if (pref & (PRE_F2 | PRE_F3))
|
||||
goto error_operand;
|
||||
break;
|
||||
case 0xc5:
|
||||
goto error_operand;
|
||||
}
|
||||
goto no_error_operand;
|
||||
} else
|
||||
goto no_error_operand;
|
||||
|
||||
error_operand:
|
||||
hs->flags |= F_ERROR | F_ERROR_OPERAND;
|
||||
no_error_operand:
|
||||
|
||||
c = *p++;
|
||||
if (m_reg <= 1) {
|
||||
if (opcode == 0xf6)
|
||||
cflags |= C_IMM8;
|
||||
else if (opcode == 0xf7)
|
||||
cflags |= C_IMM_P66;
|
||||
}
|
||||
|
||||
switch (m_mod) {
|
||||
case 0:
|
||||
if (pref & PRE_67) {
|
||||
if (m_rm == 6)
|
||||
disp_size = 2;
|
||||
} else
|
||||
if (m_rm == 5)
|
||||
disp_size = 4;
|
||||
break;
|
||||
case 1:
|
||||
disp_size = 1;
|
||||
break;
|
||||
case 2:
|
||||
disp_size = 2;
|
||||
if (!(pref & PRE_67))
|
||||
disp_size <<= 1;
|
||||
}
|
||||
|
||||
if (m_mod != 3 && m_rm == 4) {
|
||||
hs->flags |= F_SIB;
|
||||
p++;
|
||||
hs->sib = c;
|
||||
hs->sib_scale = c >> 6;
|
||||
hs->sib_index = (c & 0x3f) >> 3;
|
||||
if ((hs->sib_base = c & 7) == 5 && !(m_mod & 1))
|
||||
disp_size = 4;
|
||||
}
|
||||
|
||||
p--;
|
||||
switch (disp_size) {
|
||||
case 1:
|
||||
hs->flags |= F_DISP8;
|
||||
hs->disp.disp8 = *p;
|
||||
break;
|
||||
case 2:
|
||||
hs->flags |= F_DISP16;
|
||||
hs->disp.disp16 = *(uint16_t *)p;
|
||||
break;
|
||||
case 4:
|
||||
hs->flags |= F_DISP32;
|
||||
hs->disp.disp32 = *(uint32_t *)p;
|
||||
}
|
||||
p += disp_size;
|
||||
} else if (pref & PRE_LOCK)
|
||||
hs->flags |= F_ERROR | F_ERROR_LOCK;
|
||||
|
||||
if (cflags & C_IMM_P66) {
|
||||
if (cflags & C_REL32) {
|
||||
if (pref & PRE_66) {
|
||||
hs->flags |= F_IMM16 | F_RELATIVE;
|
||||
hs->imm.imm16 = *(uint16_t *)p;
|
||||
p += 2;
|
||||
goto disasm_done;
|
||||
}
|
||||
goto rel32_ok;
|
||||
}
|
||||
if (op64) {
|
||||
hs->flags |= F_IMM64;
|
||||
hs->imm.imm64 = *(uint64_t *)p;
|
||||
p += 8;
|
||||
} else if (!(pref & PRE_66)) {
|
||||
hs->flags |= F_IMM32;
|
||||
hs->imm.imm32 = *(uint32_t *)p;
|
||||
p += 4;
|
||||
} else
|
||||
goto imm16_ok;
|
||||
}
|
||||
|
||||
|
||||
if (cflags & C_IMM16) {
|
||||
imm16_ok:
|
||||
hs->flags |= F_IMM16;
|
||||
hs->imm.imm16 = *(uint16_t *)p;
|
||||
p += 2;
|
||||
}
|
||||
if (cflags & C_IMM8) {
|
||||
hs->flags |= F_IMM8;
|
||||
hs->imm.imm8 = *p++;
|
||||
}
|
||||
|
||||
if (cflags & C_REL32) {
|
||||
rel32_ok:
|
||||
hs->flags |= F_IMM32 | F_RELATIVE;
|
||||
hs->imm.imm32 = *(uint32_t *)p;
|
||||
p += 4;
|
||||
} else if (cflags & C_REL8) {
|
||||
hs->flags |= F_IMM8 | F_RELATIVE;
|
||||
hs->imm.imm8 = *p++;
|
||||
}
|
||||
|
||||
disasm_done:
|
||||
|
||||
if ((hs->len = (uint8_t)(p-(uint8_t *)code)) > 15) {
|
||||
hs->flags |= F_ERROR | F_ERROR_LENGTH;
|
||||
hs->len = 15;
|
||||
}
|
||||
|
||||
return (unsigned int)hs->len;
|
||||
}
|
||||
|
||||
#endif // defined(_M_X64) || defined(__x86_64__)
|
|
@ -1,112 +0,0 @@
|
|||
/*
|
||||
* Hacker Disassembler Engine 64
|
||||
* Copyright (c) 2008-2009, Vyacheslav Patkov.
|
||||
* All rights reserved.
|
||||
*
|
||||
* hde64.h: C/C++ header file
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _HDE64_H_
|
||||
#define _HDE64_H_
|
||||
|
||||
/* stdint.h - C99 standard header
|
||||
* http://en.wikipedia.org/wiki/stdint.h
|
||||
*
|
||||
* if your compiler doesn't contain "stdint.h" header (for
|
||||
* example, Microsoft Visual C++), you can download file:
|
||||
* http://www.azillionmonkeys.com/qed/pstdint.h
|
||||
* and change next line to:
|
||||
* #include "pstdint.h"
|
||||
*/
|
||||
#include "pstdint.h"
|
||||
|
||||
#define F_MODRM 0x00000001
|
||||
#define F_SIB 0x00000002
|
||||
#define F_IMM8 0x00000004
|
||||
#define F_IMM16 0x00000008
|
||||
#define F_IMM32 0x00000010
|
||||
#define F_IMM64 0x00000020
|
||||
#define F_DISP8 0x00000040
|
||||
#define F_DISP16 0x00000080
|
||||
#define F_DISP32 0x00000100
|
||||
#define F_RELATIVE 0x00000200
|
||||
#define F_ERROR 0x00001000
|
||||
#define F_ERROR_OPCODE 0x00002000
|
||||
#define F_ERROR_LENGTH 0x00004000
|
||||
#define F_ERROR_LOCK 0x00008000
|
||||
#define F_ERROR_OPERAND 0x00010000
|
||||
#define F_PREFIX_REPNZ 0x01000000
|
||||
#define F_PREFIX_REPX 0x02000000
|
||||
#define F_PREFIX_REP 0x03000000
|
||||
#define F_PREFIX_66 0x04000000
|
||||
#define F_PREFIX_67 0x08000000
|
||||
#define F_PREFIX_LOCK 0x10000000
|
||||
#define F_PREFIX_SEG 0x20000000
|
||||
#define F_PREFIX_REX 0x40000000
|
||||
#define F_PREFIX_ANY 0x7f000000
|
||||
|
||||
#define PREFIX_SEGMENT_CS 0x2e
|
||||
#define PREFIX_SEGMENT_SS 0x36
|
||||
#define PREFIX_SEGMENT_DS 0x3e
|
||||
#define PREFIX_SEGMENT_ES 0x26
|
||||
#define PREFIX_SEGMENT_FS 0x64
|
||||
#define PREFIX_SEGMENT_GS 0x65
|
||||
#define PREFIX_LOCK 0xf0
|
||||
#define PREFIX_REPNZ 0xf2
|
||||
#define PREFIX_REPX 0xf3
|
||||
#define PREFIX_OPERAND_SIZE 0x66
|
||||
#define PREFIX_ADDRESS_SIZE 0x67
|
||||
|
||||
#pragma pack(push,1)
|
||||
|
||||
typedef struct {
|
||||
uint8_t len;
|
||||
uint8_t p_rep;
|
||||
uint8_t p_lock;
|
||||
uint8_t p_seg;
|
||||
uint8_t p_66;
|
||||
uint8_t p_67;
|
||||
uint8_t rex;
|
||||
uint8_t rex_w;
|
||||
uint8_t rex_r;
|
||||
uint8_t rex_x;
|
||||
uint8_t rex_b;
|
||||
uint8_t opcode;
|
||||
uint8_t opcode2;
|
||||
uint8_t modrm;
|
||||
uint8_t modrm_mod;
|
||||
uint8_t modrm_reg;
|
||||
uint8_t modrm_rm;
|
||||
uint8_t sib;
|
||||
uint8_t sib_scale;
|
||||
uint8_t sib_index;
|
||||
uint8_t sib_base;
|
||||
union {
|
||||
uint8_t imm8;
|
||||
uint16_t imm16;
|
||||
uint32_t imm32;
|
||||
uint64_t imm64;
|
||||
} imm;
|
||||
union {
|
||||
uint8_t disp8;
|
||||
uint16_t disp16;
|
||||
uint32_t disp32;
|
||||
} disp;
|
||||
uint32_t flags;
|
||||
} hde64s;
|
||||
|
||||
#pragma pack(pop)
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* __cdecl */
|
||||
unsigned int hde64_disasm(const void *code, hde64s *hs);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _HDE64_H_ */
|
|
@ -1,39 +0,0 @@
|
|||
/*
|
||||
* MinHook - The Minimalistic API Hooking Library for x64/x86
|
||||
* Copyright (C) 2009-2017 Tsuda Kageyu. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
// Integer types for HDE.
|
||||
typedef INT8 int8_t;
|
||||
typedef INT16 int16_t;
|
||||
typedef INT32 int32_t;
|
||||
typedef INT64 int64_t;
|
||||
typedef UINT8 uint8_t;
|
||||
typedef UINT16 uint16_t;
|
||||
typedef UINT32 uint32_t;
|
||||
typedef UINT64 uint64_t;
|
|
@ -1,73 +0,0 @@
|
|||
/*
|
||||
* Hacker Disassembler Engine 32 C
|
||||
* Copyright (c) 2008-2009, Vyacheslav Patkov.
|
||||
* All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
#define C_NONE 0x00
|
||||
#define C_MODRM 0x01
|
||||
#define C_IMM8 0x02
|
||||
#define C_IMM16 0x04
|
||||
#define C_IMM_P66 0x10
|
||||
#define C_REL8 0x20
|
||||
#define C_REL32 0x40
|
||||
#define C_GROUP 0x80
|
||||
#define C_ERROR 0xff
|
||||
|
||||
#define PRE_ANY 0x00
|
||||
#define PRE_NONE 0x01
|
||||
#define PRE_F2 0x02
|
||||
#define PRE_F3 0x04
|
||||
#define PRE_66 0x08
|
||||
#define PRE_67 0x10
|
||||
#define PRE_LOCK 0x20
|
||||
#define PRE_SEG 0x40
|
||||
#define PRE_ALL 0xff
|
||||
|
||||
#define DELTA_OPCODES 0x4a
|
||||
#define DELTA_FPU_REG 0xf1
|
||||
#define DELTA_FPU_MODRM 0xf8
|
||||
#define DELTA_PREFIXES 0x130
|
||||
#define DELTA_OP_LOCK_OK 0x1a1
|
||||
#define DELTA_OP2_LOCK_OK 0x1b9
|
||||
#define DELTA_OP_ONLY_MEM 0x1cb
|
||||
#define DELTA_OP2_ONLY_MEM 0x1da
|
||||
|
||||
unsigned char hde32_table[] = {
|
||||
0xa3,0xa8,0xa3,0xa8,0xa3,0xa8,0xa3,0xa8,0xa3,0xa8,0xa3,0xa8,0xa3,0xa8,0xa3,
|
||||
0xa8,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xac,0xaa,0xb2,0xaa,0x9f,0x9f,
|
||||
0x9f,0x9f,0xb5,0xa3,0xa3,0xa4,0xaa,0xaa,0xba,0xaa,0x96,0xaa,0xa8,0xaa,0xc3,
|
||||
0xc3,0x96,0x96,0xb7,0xae,0xd6,0xbd,0xa3,0xc5,0xa3,0xa3,0x9f,0xc3,0x9c,0xaa,
|
||||
0xaa,0xac,0xaa,0xbf,0x03,0x7f,0x11,0x7f,0x01,0x7f,0x01,0x3f,0x01,0x01,0x90,
|
||||
0x82,0x7d,0x97,0x59,0x59,0x59,0x59,0x59,0x7f,0x59,0x59,0x60,0x7d,0x7f,0x7f,
|
||||
0x59,0x59,0x59,0x59,0x59,0x59,0x59,0x59,0x59,0x59,0x59,0x59,0x9a,0x88,0x7d,
|
||||
0x59,0x50,0x50,0x50,0x50,0x59,0x59,0x59,0x59,0x61,0x94,0x61,0x9e,0x59,0x59,
|
||||
0x85,0x59,0x92,0xa3,0x60,0x60,0x59,0x59,0x59,0x59,0x59,0x59,0x59,0x59,0x59,
|
||||
0x59,0x59,0x9f,0x01,0x03,0x01,0x04,0x03,0xd5,0x03,0xcc,0x01,0xbc,0x03,0xf0,
|
||||
0x10,0x10,0x10,0x10,0x50,0x50,0x50,0x50,0x14,0x20,0x20,0x20,0x20,0x01,0x01,
|
||||
0x01,0x01,0xc4,0x02,0x10,0x00,0x00,0x00,0x00,0x01,0x01,0xc0,0xc2,0x10,0x11,
|
||||
0x02,0x03,0x11,0x03,0x03,0x04,0x00,0x00,0x14,0x00,0x02,0x00,0x00,0xc6,0xc8,
|
||||
0x02,0x02,0x02,0x02,0x00,0x00,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0xff,0xca,
|
||||
0x01,0x01,0x01,0x00,0x06,0x00,0x04,0x00,0xc0,0xc2,0x01,0x01,0x03,0x01,0xff,
|
||||
0xff,0x01,0x00,0x03,0xc4,0xc4,0xc6,0x03,0x01,0x01,0x01,0xff,0x03,0x03,0x03,
|
||||
0xc8,0x40,0x00,0x0a,0x00,0x04,0x00,0x00,0x00,0x00,0x7f,0x00,0x33,0x01,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0xff,0xbf,0xff,0xff,0x00,0x00,0x00,0x00,0x07,0x00,
|
||||
0x00,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0xff,0xff,0x00,0x00,0x00,0xbf,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x7f,0x00,0x00,0xff,0x4a,0x4a,0x4a,0x4a,0x4b,0x52,0x4a,0x4a,0x4a,0x4a,0x4f,
|
||||
0x4c,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,0x55,0x45,0x40,0x4a,0x4a,0x4a,
|
||||
0x45,0x59,0x4d,0x46,0x4a,0x5d,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,
|
||||
0x4a,0x4a,0x4a,0x4a,0x4a,0x61,0x63,0x67,0x4e,0x4a,0x4a,0x6b,0x6d,0x4a,0x4a,
|
||||
0x45,0x6d,0x4a,0x4a,0x44,0x45,0x4a,0x4a,0x00,0x00,0x00,0x02,0x0d,0x06,0x06,
|
||||
0x06,0x06,0x0e,0x00,0x00,0x00,0x00,0x06,0x06,0x06,0x00,0x06,0x06,0x02,0x06,
|
||||
0x00,0x0a,0x0a,0x07,0x07,0x06,0x02,0x05,0x05,0x02,0x02,0x00,0x00,0x04,0x04,
|
||||
0x04,0x04,0x00,0x00,0x00,0x0e,0x05,0x06,0x06,0x06,0x01,0x06,0x00,0x00,0x08,
|
||||
0x00,0x10,0x00,0x18,0x00,0x20,0x00,0x28,0x00,0x30,0x00,0x80,0x01,0x82,0x01,
|
||||
0x86,0x00,0xf6,0xcf,0xfe,0x3f,0xab,0x00,0xb0,0x00,0xb1,0x00,0xb3,0x00,0xba,
|
||||
0xf8,0xbb,0x00,0xc0,0x00,0xc1,0x00,0xc7,0xbf,0x62,0xff,0x00,0x8d,0xff,0x00,
|
||||
0xc4,0xff,0x00,0xc5,0xff,0x00,0xff,0xff,0xeb,0x01,0xff,0x0e,0x12,0x08,0x00,
|
||||
0x13,0x09,0x00,0x16,0x08,0x00,0x17,0x09,0x00,0x2b,0x09,0x00,0xae,0xff,0x07,
|
||||
0xb2,0xff,0x00,0xb4,0xff,0x00,0xb5,0xff,0x00,0xc3,0x01,0x00,0xc7,0xff,0xbf,
|
||||
0xe7,0x08,0x00,0xf0,0x02,0x00
|
||||
};
|
|
@ -1,74 +0,0 @@
|
|||
/*
|
||||
* Hacker Disassembler Engine 64 C
|
||||
* Copyright (c) 2008-2009, Vyacheslav Patkov.
|
||||
* All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
#define C_NONE 0x00
|
||||
#define C_MODRM 0x01
|
||||
#define C_IMM8 0x02
|
||||
#define C_IMM16 0x04
|
||||
#define C_IMM_P66 0x10
|
||||
#define C_REL8 0x20
|
||||
#define C_REL32 0x40
|
||||
#define C_GROUP 0x80
|
||||
#define C_ERROR 0xff
|
||||
|
||||
#define PRE_ANY 0x00
|
||||
#define PRE_NONE 0x01
|
||||
#define PRE_F2 0x02
|
||||
#define PRE_F3 0x04
|
||||
#define PRE_66 0x08
|
||||
#define PRE_67 0x10
|
||||
#define PRE_LOCK 0x20
|
||||
#define PRE_SEG 0x40
|
||||
#define PRE_ALL 0xff
|
||||
|
||||
#define DELTA_OPCODES 0x4a
|
||||
#define DELTA_FPU_REG 0xfd
|
||||
#define DELTA_FPU_MODRM 0x104
|
||||
#define DELTA_PREFIXES 0x13c
|
||||
#define DELTA_OP_LOCK_OK 0x1ae
|
||||
#define DELTA_OP2_LOCK_OK 0x1c6
|
||||
#define DELTA_OP_ONLY_MEM 0x1d8
|
||||
#define DELTA_OP2_ONLY_MEM 0x1e7
|
||||
|
||||
unsigned char hde64_table[] = {
|
||||
0xa5,0xaa,0xa5,0xb8,0xa5,0xaa,0xa5,0xaa,0xa5,0xb8,0xa5,0xb8,0xa5,0xb8,0xa5,
|
||||
0xb8,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xac,0xc0,0xcc,0xc0,0xa1,0xa1,
|
||||
0xa1,0xa1,0xb1,0xa5,0xa5,0xa6,0xc0,0xc0,0xd7,0xda,0xe0,0xc0,0xe4,0xc0,0xea,
|
||||
0xea,0xe0,0xe0,0x98,0xc8,0xee,0xf1,0xa5,0xd3,0xa5,0xa5,0xa1,0xea,0x9e,0xc0,
|
||||
0xc0,0xc2,0xc0,0xe6,0x03,0x7f,0x11,0x7f,0x01,0x7f,0x01,0x3f,0x01,0x01,0xab,
|
||||
0x8b,0x90,0x64,0x5b,0x5b,0x5b,0x5b,0x5b,0x92,0x5b,0x5b,0x76,0x90,0x92,0x92,
|
||||
0x5b,0x5b,0x5b,0x5b,0x5b,0x5b,0x5b,0x5b,0x5b,0x5b,0x5b,0x5b,0x6a,0x73,0x90,
|
||||
0x5b,0x52,0x52,0x52,0x52,0x5b,0x5b,0x5b,0x5b,0x77,0x7c,0x77,0x85,0x5b,0x5b,
|
||||
0x70,0x5b,0x7a,0xaf,0x76,0x76,0x5b,0x5b,0x5b,0x5b,0x5b,0x5b,0x5b,0x5b,0x5b,
|
||||
0x5b,0x5b,0x86,0x01,0x03,0x01,0x04,0x03,0xd5,0x03,0xd5,0x03,0xcc,0x01,0xbc,
|
||||
0x03,0xf0,0x03,0x03,0x04,0x00,0x50,0x50,0x50,0x50,0xff,0x20,0x20,0x20,0x20,
|
||||
0x01,0x01,0x01,0x01,0xc4,0x02,0x10,0xff,0xff,0xff,0x01,0x00,0x03,0x11,0xff,
|
||||
0x03,0xc4,0xc6,0xc8,0x02,0x10,0x00,0xff,0xcc,0x01,0x01,0x01,0x00,0x00,0x00,
|
||||
0x00,0x01,0x01,0x03,0x01,0xff,0xff,0xc0,0xc2,0x10,0x11,0x02,0x03,0x01,0x01,
|
||||
0x01,0xff,0xff,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0xff,0xff,0xff,0xff,0x10,
|
||||
0x10,0x10,0x10,0x02,0x10,0x00,0x00,0xc6,0xc8,0x02,0x02,0x02,0x02,0x06,0x00,
|
||||
0x04,0x00,0x02,0xff,0x00,0xc0,0xc2,0x01,0x01,0x03,0x03,0x03,0xca,0x40,0x00,
|
||||
0x0a,0x00,0x04,0x00,0x00,0x00,0x00,0x7f,0x00,0x33,0x01,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0xff,0xbf,0xff,0xff,0x00,0x00,0x00,0x00,0x07,0x00,0x00,0xff,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,
|
||||
0x00,0x00,0x00,0xbf,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7f,0x00,0x00,
|
||||
0xff,0x40,0x40,0x40,0x40,0x41,0x49,0x40,0x40,0x40,0x40,0x4c,0x42,0x40,0x40,
|
||||
0x40,0x40,0x40,0x40,0x40,0x40,0x4f,0x44,0x53,0x40,0x40,0x40,0x44,0x57,0x43,
|
||||
0x5c,0x40,0x60,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
|
||||
0x40,0x40,0x64,0x66,0x6e,0x6b,0x40,0x40,0x6a,0x46,0x40,0x40,0x44,0x46,0x40,
|
||||
0x40,0x5b,0x44,0x40,0x40,0x00,0x00,0x00,0x00,0x06,0x06,0x06,0x06,0x01,0x06,
|
||||
0x06,0x02,0x06,0x06,0x00,0x06,0x00,0x0a,0x0a,0x00,0x00,0x00,0x02,0x07,0x07,
|
||||
0x06,0x02,0x0d,0x06,0x06,0x06,0x0e,0x05,0x05,0x02,0x02,0x00,0x00,0x04,0x04,
|
||||
0x04,0x04,0x05,0x06,0x06,0x06,0x00,0x00,0x00,0x0e,0x00,0x00,0x08,0x00,0x10,
|
||||
0x00,0x18,0x00,0x20,0x00,0x28,0x00,0x30,0x00,0x80,0x01,0x82,0x01,0x86,0x00,
|
||||
0xf6,0xcf,0xfe,0x3f,0xab,0x00,0xb0,0x00,0xb1,0x00,0xb3,0x00,0xba,0xf8,0xbb,
|
||||
0x00,0xc0,0x00,0xc1,0x00,0xc7,0xbf,0x62,0xff,0x00,0x8d,0xff,0x00,0xc4,0xff,
|
||||
0x00,0xc5,0xff,0x00,0xff,0xff,0xeb,0x01,0xff,0x0e,0x12,0x08,0x00,0x13,0x09,
|
||||
0x00,0x16,0x08,0x00,0x17,0x09,0x00,0x2b,0x09,0x00,0xae,0xff,0x07,0xb2,0xff,
|
||||
0x00,0xb4,0xff,0x00,0xb5,0xff,0x00,0xc3,0x01,0x00,0xc7,0xff,0xbf,0xe7,0x08,
|
||||
0x00,0xf0,0x02,0x00
|
||||
};
|
|
@ -1,312 +0,0 @@
|
|||
/*
|
||||
* MinHook - The Minimalistic API Hooking Library for x64/x86
|
||||
* Copyright (C) 2009-2017 Tsuda Kageyu.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER
|
||||
* OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <windows.h>
|
||||
#include "buffer.h"
|
||||
|
||||
// Size of each memory block. (= page size of VirtualAlloc)
|
||||
#define MEMORY_BLOCK_SIZE 0x1000
|
||||
|
||||
// Max range for seeking a memory block. (= 1024MB)
|
||||
#define MAX_MEMORY_RANGE 0x40000000
|
||||
|
||||
// Memory protection flags to check the executable address.
|
||||
#define PAGE_EXECUTE_FLAGS \
|
||||
(PAGE_EXECUTE | PAGE_EXECUTE_READ | PAGE_EXECUTE_READWRITE | PAGE_EXECUTE_WRITECOPY)
|
||||
|
||||
// Memory slot.
|
||||
typedef struct _MEMORY_SLOT
|
||||
{
|
||||
union
|
||||
{
|
||||
struct _MEMORY_SLOT *pNext;
|
||||
UINT8 buffer[MEMORY_SLOT_SIZE];
|
||||
};
|
||||
} MEMORY_SLOT, *PMEMORY_SLOT;
|
||||
|
||||
// Memory block info. Placed at the head of each block.
|
||||
typedef struct _MEMORY_BLOCK
|
||||
{
|
||||
struct _MEMORY_BLOCK *pNext;
|
||||
PMEMORY_SLOT pFree; // First element of the free slot list.
|
||||
UINT usedCount;
|
||||
} MEMORY_BLOCK, *PMEMORY_BLOCK;
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// Global Variables:
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
// First element of the memory block list.
|
||||
PMEMORY_BLOCK g_pMemoryBlocks;
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
VOID InitializeBuffer(VOID)
|
||||
{
|
||||
// Nothing to do for now.
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
VOID UninitializeBuffer(VOID)
|
||||
{
|
||||
PMEMORY_BLOCK pBlock = g_pMemoryBlocks;
|
||||
g_pMemoryBlocks = NULL;
|
||||
|
||||
while (pBlock)
|
||||
{
|
||||
PMEMORY_BLOCK pNext = pBlock->pNext;
|
||||
VirtualFree(pBlock, 0, MEM_RELEASE);
|
||||
pBlock = pNext;
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
#if defined(_M_X64) || defined(__x86_64__)
|
||||
static LPVOID FindPrevFreeRegion(LPVOID pAddress, LPVOID pMinAddr, DWORD dwAllocationGranularity)
|
||||
{
|
||||
ULONG_PTR tryAddr = (ULONG_PTR)pAddress;
|
||||
|
||||
// Round down to the allocation granularity.
|
||||
tryAddr -= tryAddr % dwAllocationGranularity;
|
||||
|
||||
// Start from the previous allocation granularity multiply.
|
||||
tryAddr -= dwAllocationGranularity;
|
||||
|
||||
while (tryAddr >= (ULONG_PTR)pMinAddr)
|
||||
{
|
||||
MEMORY_BASIC_INFORMATION mbi;
|
||||
if (VirtualQuery((LPVOID)tryAddr, &mbi, sizeof(mbi)) == 0)
|
||||
break;
|
||||
|
||||
if (mbi.State == MEM_FREE)
|
||||
return (LPVOID)tryAddr;
|
||||
|
||||
if ((ULONG_PTR)mbi.AllocationBase < dwAllocationGranularity)
|
||||
break;
|
||||
|
||||
tryAddr = (ULONG_PTR)mbi.AllocationBase - dwAllocationGranularity;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
#if defined(_M_X64) || defined(__x86_64__)
|
||||
static LPVOID FindNextFreeRegion(LPVOID pAddress, LPVOID pMaxAddr, DWORD dwAllocationGranularity)
|
||||
{
|
||||
ULONG_PTR tryAddr = (ULONG_PTR)pAddress;
|
||||
|
||||
// Round down to the allocation granularity.
|
||||
tryAddr -= tryAddr % dwAllocationGranularity;
|
||||
|
||||
// Start from the next allocation granularity multiply.
|
||||
tryAddr += dwAllocationGranularity;
|
||||
|
||||
while (tryAddr <= (ULONG_PTR)pMaxAddr)
|
||||
{
|
||||
MEMORY_BASIC_INFORMATION mbi;
|
||||
if (VirtualQuery((LPVOID)tryAddr, &mbi, sizeof(mbi)) == 0)
|
||||
break;
|
||||
|
||||
if (mbi.State == MEM_FREE)
|
||||
return (LPVOID)tryAddr;
|
||||
|
||||
tryAddr = (ULONG_PTR)mbi.BaseAddress + mbi.RegionSize;
|
||||
|
||||
// Round up to the next allocation granularity.
|
||||
tryAddr += dwAllocationGranularity - 1;
|
||||
tryAddr -= tryAddr % dwAllocationGranularity;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
static PMEMORY_BLOCK GetMemoryBlock(LPVOID pOrigin)
|
||||
{
|
||||
PMEMORY_BLOCK pBlock;
|
||||
#if defined(_M_X64) || defined(__x86_64__)
|
||||
ULONG_PTR minAddr;
|
||||
ULONG_PTR maxAddr;
|
||||
|
||||
SYSTEM_INFO si;
|
||||
GetSystemInfo(&si);
|
||||
minAddr = (ULONG_PTR)si.lpMinimumApplicationAddress;
|
||||
maxAddr = (ULONG_PTR)si.lpMaximumApplicationAddress;
|
||||
|
||||
// pOrigin ± 512MB
|
||||
if ((ULONG_PTR)pOrigin > MAX_MEMORY_RANGE && minAddr < (ULONG_PTR)pOrigin - MAX_MEMORY_RANGE)
|
||||
minAddr = (ULONG_PTR)pOrigin - MAX_MEMORY_RANGE;
|
||||
|
||||
if (maxAddr > (ULONG_PTR)pOrigin + MAX_MEMORY_RANGE)
|
||||
maxAddr = (ULONG_PTR)pOrigin + MAX_MEMORY_RANGE;
|
||||
|
||||
// Make room for MEMORY_BLOCK_SIZE bytes.
|
||||
maxAddr -= MEMORY_BLOCK_SIZE - 1;
|
||||
#endif
|
||||
|
||||
// Look the registered blocks for a reachable one.
|
||||
for (pBlock = g_pMemoryBlocks; pBlock != NULL; pBlock = pBlock->pNext)
|
||||
{
|
||||
#if defined(_M_X64) || defined(__x86_64__)
|
||||
// Ignore the blocks too far.
|
||||
if ((ULONG_PTR)pBlock < minAddr || (ULONG_PTR)pBlock >= maxAddr)
|
||||
continue;
|
||||
#endif
|
||||
// The block has at least one unused slot.
|
||||
if (pBlock->pFree != NULL)
|
||||
return pBlock;
|
||||
}
|
||||
|
||||
#if defined(_M_X64) || defined(__x86_64__)
|
||||
// Alloc a new block above if not found.
|
||||
{
|
||||
LPVOID pAlloc = pOrigin;
|
||||
while ((ULONG_PTR)pAlloc >= minAddr)
|
||||
{
|
||||
pAlloc = FindPrevFreeRegion(pAlloc, (LPVOID)minAddr, si.dwAllocationGranularity);
|
||||
if (pAlloc == NULL)
|
||||
break;
|
||||
|
||||
pBlock = (PMEMORY_BLOCK)VirtualAlloc(
|
||||
pAlloc, MEMORY_BLOCK_SIZE, MEM_COMMIT | MEM_RESERVE, PAGE_EXECUTE_READWRITE);
|
||||
if (pBlock != NULL)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Alloc a new block below if not found.
|
||||
if (pBlock == NULL)
|
||||
{
|
||||
LPVOID pAlloc = pOrigin;
|
||||
while ((ULONG_PTR)pAlloc <= maxAddr)
|
||||
{
|
||||
pAlloc = FindNextFreeRegion(pAlloc, (LPVOID)maxAddr, si.dwAllocationGranularity);
|
||||
if (pAlloc == NULL)
|
||||
break;
|
||||
|
||||
pBlock = (PMEMORY_BLOCK)VirtualAlloc(
|
||||
pAlloc, MEMORY_BLOCK_SIZE, MEM_COMMIT | MEM_RESERVE, PAGE_EXECUTE_READWRITE);
|
||||
if (pBlock != NULL)
|
||||
break;
|
||||
}
|
||||
}
|
||||
#else
|
||||
// In x86 mode, a memory block can be placed anywhere.
|
||||
pBlock = (PMEMORY_BLOCK)VirtualAlloc(
|
||||
NULL, MEMORY_BLOCK_SIZE, MEM_COMMIT | MEM_RESERVE, PAGE_EXECUTE_READWRITE);
|
||||
#endif
|
||||
|
||||
if (pBlock != NULL)
|
||||
{
|
||||
// Build a linked list of all the slots.
|
||||
PMEMORY_SLOT pSlot = (PMEMORY_SLOT)pBlock + 1;
|
||||
pBlock->pFree = NULL;
|
||||
pBlock->usedCount = 0;
|
||||
do
|
||||
{
|
||||
pSlot->pNext = pBlock->pFree;
|
||||
pBlock->pFree = pSlot;
|
||||
pSlot++;
|
||||
} while ((ULONG_PTR)pSlot - (ULONG_PTR)pBlock <= MEMORY_BLOCK_SIZE - MEMORY_SLOT_SIZE);
|
||||
|
||||
pBlock->pNext = g_pMemoryBlocks;
|
||||
g_pMemoryBlocks = pBlock;
|
||||
}
|
||||
|
||||
return pBlock;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
LPVOID AllocateBuffer(LPVOID pOrigin)
|
||||
{
|
||||
PMEMORY_SLOT pSlot;
|
||||
PMEMORY_BLOCK pBlock = GetMemoryBlock(pOrigin);
|
||||
if (pBlock == NULL)
|
||||
return NULL;
|
||||
|
||||
// Remove an unused slot from the list.
|
||||
pSlot = pBlock->pFree;
|
||||
pBlock->pFree = pSlot->pNext;
|
||||
pBlock->usedCount++;
|
||||
#ifdef _DEBUG
|
||||
// Fill the slot with INT3 for debugging.
|
||||
memset(pSlot, 0xCC, sizeof(MEMORY_SLOT));
|
||||
#endif
|
||||
return pSlot;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
VOID FreeBuffer(LPVOID pBuffer)
|
||||
{
|
||||
PMEMORY_BLOCK pBlock = g_pMemoryBlocks;
|
||||
PMEMORY_BLOCK pPrev = NULL;
|
||||
ULONG_PTR pTargetBlock = ((ULONG_PTR)pBuffer / MEMORY_BLOCK_SIZE) * MEMORY_BLOCK_SIZE;
|
||||
|
||||
while (pBlock != NULL)
|
||||
{
|
||||
if ((ULONG_PTR)pBlock == pTargetBlock)
|
||||
{
|
||||
PMEMORY_SLOT pSlot = (PMEMORY_SLOT)pBuffer;
|
||||
#ifdef _DEBUG
|
||||
// Clear the released slot for debugging.
|
||||
memset(pSlot, 0x00, sizeof(*pSlot));
|
||||
#endif
|
||||
// Restore the released slot to the list.
|
||||
pSlot->pNext = pBlock->pFree;
|
||||
pBlock->pFree = pSlot;
|
||||
pBlock->usedCount--;
|
||||
|
||||
// Free if unused.
|
||||
if (pBlock->usedCount == 0)
|
||||
{
|
||||
if (pPrev)
|
||||
pPrev->pNext = pBlock->pNext;
|
||||
else
|
||||
g_pMemoryBlocks = pBlock->pNext;
|
||||
|
||||
VirtualFree(pBlock, 0, MEM_RELEASE);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
pPrev = pBlock;
|
||||
pBlock = pBlock->pNext;
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
BOOL IsExecutableAddress(LPVOID pAddress)
|
||||
{
|
||||
MEMORY_BASIC_INFORMATION mi;
|
||||
VirtualQuery(pAddress, &mi, sizeof(mi));
|
||||
|
||||
return (mi.State == MEM_COMMIT && (mi.Protect & PAGE_EXECUTE_FLAGS));
|
||||
}
|
|
@ -1,42 +0,0 @@
|
|||
/*
|
||||
* MinHook - The Minimalistic API Hooking Library for x64/x86
|
||||
* Copyright (C) 2009-2017 Tsuda Kageyu.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER
|
||||
* OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
// Size of each memory slot.
|
||||
#if defined(_M_X64) || defined(__x86_64__)
|
||||
#define MEMORY_SLOT_SIZE 64
|
||||
#else
|
||||
#define MEMORY_SLOT_SIZE 32
|
||||
#endif
|
||||
|
||||
VOID InitializeBuffer(VOID);
|
||||
VOID UninitializeBuffer(VOID);
|
||||
LPVOID AllocateBuffer(LPVOID pOrigin);
|
||||
VOID FreeBuffer(LPVOID pBuffer);
|
||||
BOOL IsExecutableAddress(LPVOID pAddress);
|
|
@ -1,889 +0,0 @@
|
|||
/*
|
||||
* MinHook - The Minimalistic API Hooking Library for x64/x86
|
||||
* Copyright (C) 2009-2017 Tsuda Kageyu.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER
|
||||
* OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <windows.h>
|
||||
#include <tlhelp32.h>
|
||||
#include <limits.h>
|
||||
|
||||
#include "../include/MinHook.h"
|
||||
#include "buffer.h"
|
||||
#include "trampoline.h"
|
||||
|
||||
#ifndef ARRAYSIZE
|
||||
#define ARRAYSIZE(A) (sizeof(A)/sizeof((A)[0]))
|
||||
#endif
|
||||
|
||||
// Initial capacity of the HOOK_ENTRY buffer.
|
||||
#define INITIAL_HOOK_CAPACITY 32
|
||||
|
||||
// Initial capacity of the thread IDs buffer.
|
||||
#define INITIAL_THREAD_CAPACITY 128
|
||||
|
||||
// Special hook position values.
|
||||
#define INVALID_HOOK_POS UINT_MAX
|
||||
#define ALL_HOOKS_POS UINT_MAX
|
||||
|
||||
// Freeze() action argument defines.
|
||||
#define ACTION_DISABLE 0
|
||||
#define ACTION_ENABLE 1
|
||||
#define ACTION_APPLY_QUEUED 2
|
||||
|
||||
// Thread access rights for suspending/resuming threads.
|
||||
#define THREAD_ACCESS \
|
||||
(THREAD_SUSPEND_RESUME | THREAD_GET_CONTEXT | THREAD_QUERY_INFORMATION | THREAD_SET_CONTEXT)
|
||||
|
||||
// Hook information.
|
||||
typedef struct _HOOK_ENTRY
|
||||
{
|
||||
LPVOID pTarget; // Address of the target function.
|
||||
LPVOID pDetour; // Address of the detour or relay function.
|
||||
LPVOID pTrampoline; // Address of the trampoline function.
|
||||
UINT8 backup[8]; // Original prologue of the target function.
|
||||
|
||||
UINT8 patchAbove : 1; // Uses the hot patch area.
|
||||
UINT8 isEnabled : 1; // Enabled.
|
||||
UINT8 queueEnable : 1; // Queued for enabling/disabling when != isEnabled.
|
||||
|
||||
UINT nIP : 4; // Count of the instruction boundaries.
|
||||
UINT8 oldIPs[8]; // Instruction boundaries of the target function.
|
||||
UINT8 newIPs[8]; // Instruction boundaries of the trampoline function.
|
||||
} HOOK_ENTRY, *PHOOK_ENTRY;
|
||||
|
||||
// Suspended threads for Freeze()/Unfreeze().
|
||||
typedef struct _FROZEN_THREADS
|
||||
{
|
||||
LPDWORD pItems; // Data heap
|
||||
UINT capacity; // Size of allocated data heap, items
|
||||
UINT size; // Actual number of data items
|
||||
} FROZEN_THREADS, *PFROZEN_THREADS;
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// Global Variables:
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
// Spin lock flag for EnterSpinLock()/LeaveSpinLock().
|
||||
volatile LONG g_isLocked = FALSE;
|
||||
|
||||
// Private heap handle. If not NULL, this library is initialized.
|
||||
HANDLE g_hHeap = NULL;
|
||||
|
||||
// Hook entries.
|
||||
struct
|
||||
{
|
||||
PHOOK_ENTRY pItems; // Data heap
|
||||
UINT capacity; // Size of allocated data heap, items
|
||||
UINT size; // Actual number of data items
|
||||
} g_hooks;
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// Returns INVALID_HOOK_POS if not found.
|
||||
static UINT FindHookEntry(LPVOID pTarget)
|
||||
{
|
||||
UINT i;
|
||||
for (i = 0; i < g_hooks.size; ++i)
|
||||
{
|
||||
if ((ULONG_PTR)pTarget == (ULONG_PTR)g_hooks.pItems[i].pTarget)
|
||||
return i;
|
||||
}
|
||||
|
||||
return INVALID_HOOK_POS;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
static PHOOK_ENTRY AddHookEntry()
|
||||
{
|
||||
if (g_hooks.pItems == NULL)
|
||||
{
|
||||
g_hooks.capacity = INITIAL_HOOK_CAPACITY;
|
||||
g_hooks.pItems = (PHOOK_ENTRY)HeapAlloc(
|
||||
g_hHeap, 0, g_hooks.capacity * sizeof(HOOK_ENTRY));
|
||||
if (g_hooks.pItems == NULL)
|
||||
return NULL;
|
||||
}
|
||||
else if (g_hooks.size >= g_hooks.capacity)
|
||||
{
|
||||
PHOOK_ENTRY p = (PHOOK_ENTRY)HeapReAlloc(
|
||||
g_hHeap, 0, g_hooks.pItems, (g_hooks.capacity * 2) * sizeof(HOOK_ENTRY));
|
||||
if (p == NULL)
|
||||
return NULL;
|
||||
|
||||
g_hooks.capacity *= 2;
|
||||
g_hooks.pItems = p;
|
||||
}
|
||||
|
||||
return &g_hooks.pItems[g_hooks.size++];
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
static void DeleteHookEntry(UINT pos)
|
||||
{
|
||||
if (pos < g_hooks.size - 1)
|
||||
g_hooks.pItems[pos] = g_hooks.pItems[g_hooks.size - 1];
|
||||
|
||||
g_hooks.size--;
|
||||
|
||||
if (g_hooks.capacity / 2 >= INITIAL_HOOK_CAPACITY && g_hooks.capacity / 2 >= g_hooks.size)
|
||||
{
|
||||
PHOOK_ENTRY p = (PHOOK_ENTRY)HeapReAlloc(
|
||||
g_hHeap, 0, g_hooks.pItems, (g_hooks.capacity / 2) * sizeof(HOOK_ENTRY));
|
||||
if (p == NULL)
|
||||
return;
|
||||
|
||||
g_hooks.capacity /= 2;
|
||||
g_hooks.pItems = p;
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
static DWORD_PTR FindOldIP(PHOOK_ENTRY pHook, DWORD_PTR ip)
|
||||
{
|
||||
UINT i;
|
||||
|
||||
if (pHook->patchAbove && ip == ((DWORD_PTR)pHook->pTarget - sizeof(JMP_REL)))
|
||||
return (DWORD_PTR)pHook->pTarget;
|
||||
|
||||
for (i = 0; i < pHook->nIP; ++i)
|
||||
{
|
||||
if (ip == ((DWORD_PTR)pHook->pTrampoline + pHook->newIPs[i]))
|
||||
return (DWORD_PTR)pHook->pTarget + pHook->oldIPs[i];
|
||||
}
|
||||
|
||||
#if defined(_M_X64) || defined(__x86_64__)
|
||||
// Check relay function.
|
||||
if (ip == (DWORD_PTR)pHook->pDetour)
|
||||
return (DWORD_PTR)pHook->pTarget;
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
static DWORD_PTR FindNewIP(PHOOK_ENTRY pHook, DWORD_PTR ip)
|
||||
{
|
||||
UINT i;
|
||||
for (i = 0; i < pHook->nIP; ++i)
|
||||
{
|
||||
if (ip == ((DWORD_PTR)pHook->pTarget + pHook->oldIPs[i]))
|
||||
return (DWORD_PTR)pHook->pTrampoline + pHook->newIPs[i];
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
static void ProcessThreadIPs(HANDLE hThread, UINT pos, UINT action)
|
||||
{
|
||||
// If the thread suspended in the overwritten area,
|
||||
// move IP to the proper address.
|
||||
|
||||
CONTEXT c;
|
||||
#if defined(_M_X64) || defined(__x86_64__)
|
||||
DWORD64 *pIP = &c.Rip;
|
||||
#else
|
||||
DWORD *pIP = &c.Eip;
|
||||
#endif
|
||||
UINT count;
|
||||
|
||||
c.ContextFlags = CONTEXT_CONTROL;
|
||||
if (!GetThreadContext(hThread, &c))
|
||||
return;
|
||||
|
||||
if (pos == ALL_HOOKS_POS)
|
||||
{
|
||||
pos = 0;
|
||||
count = g_hooks.size;
|
||||
}
|
||||
else
|
||||
{
|
||||
count = pos + 1;
|
||||
}
|
||||
|
||||
for (; pos < count; ++pos)
|
||||
{
|
||||
PHOOK_ENTRY pHook = &g_hooks.pItems[pos];
|
||||
BOOL enable;
|
||||
DWORD_PTR ip;
|
||||
|
||||
switch (action)
|
||||
{
|
||||
case ACTION_DISABLE:
|
||||
enable = FALSE;
|
||||
break;
|
||||
|
||||
case ACTION_ENABLE:
|
||||
enable = TRUE;
|
||||
break;
|
||||
|
||||
default: // ACTION_APPLY_QUEUED
|
||||
enable = pHook->queueEnable;
|
||||
break;
|
||||
}
|
||||
if (pHook->isEnabled == enable)
|
||||
continue;
|
||||
|
||||
if (enable)
|
||||
ip = FindNewIP(pHook, *pIP);
|
||||
else
|
||||
ip = FindOldIP(pHook, *pIP);
|
||||
|
||||
if (ip != 0)
|
||||
{
|
||||
*pIP = ip;
|
||||
SetThreadContext(hThread, &c);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
static VOID EnumerateThreads(PFROZEN_THREADS pThreads)
|
||||
{
|
||||
HANDLE hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPTHREAD, 0);
|
||||
if (hSnapshot != INVALID_HANDLE_VALUE)
|
||||
{
|
||||
THREADENTRY32 te;
|
||||
te.dwSize = sizeof(THREADENTRY32);
|
||||
if (Thread32First(hSnapshot, &te))
|
||||
{
|
||||
do
|
||||
{
|
||||
if (te.dwSize >= (FIELD_OFFSET(THREADENTRY32, th32OwnerProcessID) + sizeof(DWORD))
|
||||
&& te.th32OwnerProcessID == GetCurrentProcessId()
|
||||
&& te.th32ThreadID != GetCurrentThreadId())
|
||||
{
|
||||
if (pThreads->pItems == NULL)
|
||||
{
|
||||
pThreads->capacity = INITIAL_THREAD_CAPACITY;
|
||||
pThreads->pItems
|
||||
= (LPDWORD)HeapAlloc(g_hHeap, 0, pThreads->capacity * sizeof(DWORD));
|
||||
if (pThreads->pItems == NULL)
|
||||
break;
|
||||
}
|
||||
else if (pThreads->size >= pThreads->capacity)
|
||||
{
|
||||
LPDWORD p = (LPDWORD)HeapReAlloc(
|
||||
g_hHeap, 0, pThreads->pItems, (pThreads->capacity * 2) * sizeof(DWORD));
|
||||
if (p == NULL)
|
||||
break;
|
||||
|
||||
pThreads->capacity *= 2;
|
||||
pThreads->pItems = p;
|
||||
}
|
||||
pThreads->pItems[pThreads->size++] = te.th32ThreadID;
|
||||
}
|
||||
|
||||
te.dwSize = sizeof(THREADENTRY32);
|
||||
} while (Thread32Next(hSnapshot, &te));
|
||||
}
|
||||
CloseHandle(hSnapshot);
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
static VOID Freeze(PFROZEN_THREADS pThreads, UINT pos, UINT action)
|
||||
{
|
||||
pThreads->pItems = NULL;
|
||||
pThreads->capacity = 0;
|
||||
pThreads->size = 0;
|
||||
EnumerateThreads(pThreads);
|
||||
|
||||
if (pThreads->pItems != NULL)
|
||||
{
|
||||
UINT i;
|
||||
for (i = 0; i < pThreads->size; ++i)
|
||||
{
|
||||
HANDLE hThread = OpenThread(THREAD_ACCESS, FALSE, pThreads->pItems[i]);
|
||||
if (hThread != NULL)
|
||||
{
|
||||
SuspendThread(hThread);
|
||||
ProcessThreadIPs(hThread, pos, action);
|
||||
CloseHandle(hThread);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
static VOID Unfreeze(PFROZEN_THREADS pThreads)
|
||||
{
|
||||
if (pThreads->pItems != NULL)
|
||||
{
|
||||
UINT i;
|
||||
for (i = 0; i < pThreads->size; ++i)
|
||||
{
|
||||
HANDLE hThread = OpenThread(THREAD_ACCESS, FALSE, pThreads->pItems[i]);
|
||||
if (hThread != NULL)
|
||||
{
|
||||
ResumeThread(hThread);
|
||||
CloseHandle(hThread);
|
||||
}
|
||||
}
|
||||
|
||||
HeapFree(g_hHeap, 0, pThreads->pItems);
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
static MH_STATUS EnableHookLL(UINT pos, BOOL enable)
|
||||
{
|
||||
PHOOK_ENTRY pHook = &g_hooks.pItems[pos];
|
||||
DWORD oldProtect;
|
||||
SIZE_T patchSize = sizeof(JMP_REL);
|
||||
LPBYTE pPatchTarget = (LPBYTE)pHook->pTarget;
|
||||
|
||||
if (pHook->patchAbove)
|
||||
{
|
||||
pPatchTarget -= sizeof(JMP_REL);
|
||||
patchSize += sizeof(JMP_REL_SHORT);
|
||||
}
|
||||
|
||||
if (!VirtualProtect(pPatchTarget, patchSize, PAGE_EXECUTE_READWRITE, &oldProtect))
|
||||
return MH_ERROR_MEMORY_PROTECT;
|
||||
|
||||
if (enable)
|
||||
{
|
||||
PJMP_REL pJmp = (PJMP_REL)pPatchTarget;
|
||||
pJmp->opcode = 0xE9;
|
||||
pJmp->operand = (UINT32)((LPBYTE)pHook->pDetour - (pPatchTarget + sizeof(JMP_REL)));
|
||||
|
||||
if (pHook->patchAbove)
|
||||
{
|
||||
PJMP_REL_SHORT pShortJmp = (PJMP_REL_SHORT)pHook->pTarget;
|
||||
pShortJmp->opcode = 0xEB;
|
||||
pShortJmp->operand = (UINT8)(0 - (sizeof(JMP_REL_SHORT) + sizeof(JMP_REL)));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (pHook->patchAbove)
|
||||
memcpy(pPatchTarget, pHook->backup, sizeof(JMP_REL) + sizeof(JMP_REL_SHORT));
|
||||
else
|
||||
memcpy(pPatchTarget, pHook->backup, sizeof(JMP_REL));
|
||||
}
|
||||
|
||||
VirtualProtect(pPatchTarget, patchSize, oldProtect, &oldProtect);
|
||||
|
||||
// Just-in-case measure.
|
||||
FlushInstructionCache(GetCurrentProcess(), pPatchTarget, patchSize);
|
||||
|
||||
pHook->isEnabled = enable;
|
||||
pHook->queueEnable = enable;
|
||||
|
||||
return MH_OK;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
static MH_STATUS EnableAllHooksLL(BOOL enable)
|
||||
{
|
||||
MH_STATUS status = MH_OK;
|
||||
UINT i, first = INVALID_HOOK_POS;
|
||||
|
||||
for (i = 0; i < g_hooks.size; ++i)
|
||||
{
|
||||
if (g_hooks.pItems[i].isEnabled != enable)
|
||||
{
|
||||
first = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (first != INVALID_HOOK_POS)
|
||||
{
|
||||
FROZEN_THREADS threads;
|
||||
Freeze(&threads, ALL_HOOKS_POS, enable ? ACTION_ENABLE : ACTION_DISABLE);
|
||||
|
||||
for (i = first; i < g_hooks.size; ++i)
|
||||
{
|
||||
if (g_hooks.pItems[i].isEnabled != enable)
|
||||
{
|
||||
status = EnableHookLL(i, enable);
|
||||
if (status != MH_OK)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Unfreeze(&threads);
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
static VOID EnterSpinLock(VOID)
|
||||
{
|
||||
SIZE_T spinCount = 0;
|
||||
|
||||
// Wait until the flag is FALSE.
|
||||
while (InterlockedCompareExchange(&g_isLocked, TRUE, FALSE) != FALSE)
|
||||
{
|
||||
// No need to generate a memory barrier here, since InterlockedCompareExchange()
|
||||
// generates a full memory barrier itself.
|
||||
|
||||
// Prevent the loop from being too busy.
|
||||
if (spinCount < 32)
|
||||
Sleep(0);
|
||||
else
|
||||
Sleep(1);
|
||||
|
||||
spinCount++;
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
static VOID LeaveSpinLock(VOID)
|
||||
{
|
||||
// No need to generate a memory barrier here, since InterlockedExchange()
|
||||
// generates a full memory barrier itself.
|
||||
|
||||
InterlockedExchange(&g_isLocked, FALSE);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
MH_STATUS WINAPI MH_Initialize(VOID)
|
||||
{
|
||||
MH_STATUS status = MH_OK;
|
||||
|
||||
EnterSpinLock();
|
||||
|
||||
if (g_hHeap == NULL)
|
||||
{
|
||||
g_hHeap = HeapCreate(0, 0, 0);
|
||||
if (g_hHeap != NULL)
|
||||
{
|
||||
// Initialize the internal function buffer.
|
||||
InitializeBuffer();
|
||||
}
|
||||
else
|
||||
{
|
||||
status = MH_ERROR_MEMORY_ALLOC;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
status = MH_ERROR_ALREADY_INITIALIZED;
|
||||
}
|
||||
|
||||
LeaveSpinLock();
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
MH_STATUS WINAPI MH_Uninitialize(VOID)
|
||||
{
|
||||
MH_STATUS status = MH_OK;
|
||||
|
||||
EnterSpinLock();
|
||||
|
||||
if (g_hHeap != NULL)
|
||||
{
|
||||
status = EnableAllHooksLL(FALSE);
|
||||
if (status == MH_OK)
|
||||
{
|
||||
// Free the internal function buffer.
|
||||
|
||||
// HeapFree is actually not required, but some tools detect a false
|
||||
// memory leak without HeapFree.
|
||||
|
||||
UninitializeBuffer();
|
||||
|
||||
HeapFree(g_hHeap, 0, g_hooks.pItems);
|
||||
HeapDestroy(g_hHeap);
|
||||
|
||||
g_hHeap = NULL;
|
||||
|
||||
g_hooks.pItems = NULL;
|
||||
g_hooks.capacity = 0;
|
||||
g_hooks.size = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
status = MH_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
||||
LeaveSpinLock();
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
MH_STATUS WINAPI MH_CreateHook(LPVOID pTarget, LPVOID pDetour, LPVOID *ppOriginal)
|
||||
{
|
||||
MH_STATUS status = MH_OK;
|
||||
|
||||
EnterSpinLock();
|
||||
|
||||
if (g_hHeap != NULL)
|
||||
{
|
||||
if (IsExecutableAddress(pTarget) && IsExecutableAddress(pDetour))
|
||||
{
|
||||
UINT pos = FindHookEntry(pTarget);
|
||||
if (pos == INVALID_HOOK_POS)
|
||||
{
|
||||
LPVOID pBuffer = AllocateBuffer(pTarget);
|
||||
if (pBuffer != NULL)
|
||||
{
|
||||
TRAMPOLINE ct;
|
||||
|
||||
ct.pTarget = pTarget;
|
||||
ct.pDetour = pDetour;
|
||||
ct.pTrampoline = pBuffer;
|
||||
if (CreateTrampolineFunction(&ct))
|
||||
{
|
||||
PHOOK_ENTRY pHook = AddHookEntry();
|
||||
if (pHook != NULL)
|
||||
{
|
||||
pHook->pTarget = ct.pTarget;
|
||||
#if defined(_M_X64) || defined(__x86_64__)
|
||||
pHook->pDetour = ct.pRelay;
|
||||
#else
|
||||
pHook->pDetour = ct.pDetour;
|
||||
#endif
|
||||
pHook->pTrampoline = ct.pTrampoline;
|
||||
pHook->patchAbove = ct.patchAbove;
|
||||
pHook->isEnabled = FALSE;
|
||||
pHook->queueEnable = FALSE;
|
||||
pHook->nIP = ct.nIP;
|
||||
memcpy(pHook->oldIPs, ct.oldIPs, ARRAYSIZE(ct.oldIPs));
|
||||
memcpy(pHook->newIPs, ct.newIPs, ARRAYSIZE(ct.newIPs));
|
||||
|
||||
// Back up the target function.
|
||||
|
||||
if (ct.patchAbove)
|
||||
{
|
||||
memcpy(
|
||||
pHook->backup,
|
||||
(LPBYTE)pTarget - sizeof(JMP_REL),
|
||||
sizeof(JMP_REL) + sizeof(JMP_REL_SHORT));
|
||||
}
|
||||
else
|
||||
{
|
||||
memcpy(pHook->backup, pTarget, sizeof(JMP_REL));
|
||||
}
|
||||
|
||||
if (ppOriginal != NULL)
|
||||
*ppOriginal = pHook->pTrampoline;
|
||||
}
|
||||
else
|
||||
{
|
||||
status = MH_ERROR_MEMORY_ALLOC;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
status = MH_ERROR_UNSUPPORTED_FUNCTION;
|
||||
}
|
||||
|
||||
if (status != MH_OK)
|
||||
{
|
||||
FreeBuffer(pBuffer);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
status = MH_ERROR_MEMORY_ALLOC;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
status = MH_ERROR_ALREADY_CREATED;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
status = MH_ERROR_NOT_EXECUTABLE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
status = MH_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
||||
LeaveSpinLock();
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
MH_STATUS WINAPI MH_RemoveHook(LPVOID pTarget)
|
||||
{
|
||||
MH_STATUS status = MH_OK;
|
||||
|
||||
EnterSpinLock();
|
||||
|
||||
if (g_hHeap != NULL)
|
||||
{
|
||||
UINT pos = FindHookEntry(pTarget);
|
||||
if (pos != INVALID_HOOK_POS)
|
||||
{
|
||||
if (g_hooks.pItems[pos].isEnabled)
|
||||
{
|
||||
FROZEN_THREADS threads;
|
||||
Freeze(&threads, pos, ACTION_DISABLE);
|
||||
|
||||
status = EnableHookLL(pos, FALSE);
|
||||
|
||||
Unfreeze(&threads);
|
||||
}
|
||||
|
||||
if (status == MH_OK)
|
||||
{
|
||||
FreeBuffer(g_hooks.pItems[pos].pTrampoline);
|
||||
DeleteHookEntry(pos);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
status = MH_ERROR_NOT_CREATED;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
status = MH_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
||||
LeaveSpinLock();
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
static MH_STATUS EnableHook(LPVOID pTarget, BOOL enable)
|
||||
{
|
||||
MH_STATUS status = MH_OK;
|
||||
|
||||
EnterSpinLock();
|
||||
|
||||
if (g_hHeap != NULL)
|
||||
{
|
||||
if (pTarget == MH_ALL_HOOKS)
|
||||
{
|
||||
status = EnableAllHooksLL(enable);
|
||||
}
|
||||
else
|
||||
{
|
||||
FROZEN_THREADS threads;
|
||||
UINT pos = FindHookEntry(pTarget);
|
||||
if (pos != INVALID_HOOK_POS)
|
||||
{
|
||||
if (g_hooks.pItems[pos].isEnabled != enable)
|
||||
{
|
||||
Freeze(&threads, pos, ACTION_ENABLE);
|
||||
|
||||
status = EnableHookLL(pos, enable);
|
||||
|
||||
Unfreeze(&threads);
|
||||
}
|
||||
else
|
||||
{
|
||||
status = enable ? MH_ERROR_ENABLED : MH_ERROR_DISABLED;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
status = MH_ERROR_NOT_CREATED;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
status = MH_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
||||
LeaveSpinLock();
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
MH_STATUS WINAPI MH_EnableHook(LPVOID pTarget)
|
||||
{
|
||||
return EnableHook(pTarget, TRUE);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
MH_STATUS WINAPI MH_DisableHook(LPVOID pTarget)
|
||||
{
|
||||
return EnableHook(pTarget, FALSE);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
static MH_STATUS QueueHook(LPVOID pTarget, BOOL queueEnable)
|
||||
{
|
||||
MH_STATUS status = MH_OK;
|
||||
|
||||
EnterSpinLock();
|
||||
|
||||
if (g_hHeap != NULL)
|
||||
{
|
||||
if (pTarget == MH_ALL_HOOKS)
|
||||
{
|
||||
UINT i;
|
||||
for (i = 0; i < g_hooks.size; ++i)
|
||||
g_hooks.pItems[i].queueEnable = queueEnable;
|
||||
}
|
||||
else
|
||||
{
|
||||
UINT pos = FindHookEntry(pTarget);
|
||||
if (pos != INVALID_HOOK_POS)
|
||||
{
|
||||
g_hooks.pItems[pos].queueEnable = queueEnable;
|
||||
}
|
||||
else
|
||||
{
|
||||
status = MH_ERROR_NOT_CREATED;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
status = MH_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
||||
LeaveSpinLock();
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
MH_STATUS WINAPI MH_QueueEnableHook(LPVOID pTarget)
|
||||
{
|
||||
return QueueHook(pTarget, TRUE);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
MH_STATUS WINAPI MH_QueueDisableHook(LPVOID pTarget)
|
||||
{
|
||||
return QueueHook(pTarget, FALSE);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
MH_STATUS WINAPI MH_ApplyQueued(VOID)
|
||||
{
|
||||
MH_STATUS status = MH_OK;
|
||||
UINT i, first = INVALID_HOOK_POS;
|
||||
|
||||
EnterSpinLock();
|
||||
|
||||
if (g_hHeap != NULL)
|
||||
{
|
||||
for (i = 0; i < g_hooks.size; ++i)
|
||||
{
|
||||
if (g_hooks.pItems[i].isEnabled != g_hooks.pItems[i].queueEnable)
|
||||
{
|
||||
first = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (first != INVALID_HOOK_POS)
|
||||
{
|
||||
FROZEN_THREADS threads;
|
||||
Freeze(&threads, ALL_HOOKS_POS, ACTION_APPLY_QUEUED);
|
||||
|
||||
for (i = first; i < g_hooks.size; ++i)
|
||||
{
|
||||
PHOOK_ENTRY pHook = &g_hooks.pItems[i];
|
||||
if (pHook->isEnabled != pHook->queueEnable)
|
||||
{
|
||||
status = EnableHookLL(i, pHook->queueEnable);
|
||||
if (status != MH_OK)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Unfreeze(&threads);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
status = MH_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
||||
LeaveSpinLock();
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
MH_STATUS WINAPI MH_CreateHookApiEx(
|
||||
LPCWSTR pszModule, LPCSTR pszProcName, LPVOID pDetour,
|
||||
LPVOID *ppOriginal, LPVOID *ppTarget)
|
||||
{
|
||||
HMODULE hModule;
|
||||
LPVOID pTarget;
|
||||
|
||||
hModule = GetModuleHandleW(pszModule);
|
||||
if (hModule == NULL)
|
||||
return MH_ERROR_MODULE_NOT_FOUND;
|
||||
|
||||
pTarget = (LPVOID)GetProcAddress(hModule, pszProcName);
|
||||
if (pTarget == NULL)
|
||||
return MH_ERROR_FUNCTION_NOT_FOUND;
|
||||
|
||||
if(ppTarget != NULL)
|
||||
*ppTarget = pTarget;
|
||||
|
||||
return MH_CreateHook(pTarget, pDetour, ppOriginal);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
MH_STATUS WINAPI MH_CreateHookApi(
|
||||
LPCWSTR pszModule, LPCSTR pszProcName, LPVOID pDetour, LPVOID *ppOriginal)
|
||||
{
|
||||
return MH_CreateHookApiEx(pszModule, pszProcName, pDetour, ppOriginal, NULL);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
const char * WINAPI MH_StatusToString(MH_STATUS status)
|
||||
{
|
||||
#define MH_ST2STR(x) \
|
||||
case x: \
|
||||
return #x;
|
||||
|
||||
switch (status) {
|
||||
MH_ST2STR(MH_UNKNOWN)
|
||||
MH_ST2STR(MH_OK)
|
||||
MH_ST2STR(MH_ERROR_ALREADY_INITIALIZED)
|
||||
MH_ST2STR(MH_ERROR_NOT_INITIALIZED)
|
||||
MH_ST2STR(MH_ERROR_ALREADY_CREATED)
|
||||
MH_ST2STR(MH_ERROR_NOT_CREATED)
|
||||
MH_ST2STR(MH_ERROR_ENABLED)
|
||||
MH_ST2STR(MH_ERROR_DISABLED)
|
||||
MH_ST2STR(MH_ERROR_NOT_EXECUTABLE)
|
||||
MH_ST2STR(MH_ERROR_UNSUPPORTED_FUNCTION)
|
||||
MH_ST2STR(MH_ERROR_MEMORY_ALLOC)
|
||||
MH_ST2STR(MH_ERROR_MEMORY_PROTECT)
|
||||
MH_ST2STR(MH_ERROR_MODULE_NOT_FOUND)
|
||||
MH_ST2STR(MH_ERROR_FUNCTION_NOT_FOUND)
|
||||
}
|
||||
|
||||
#undef MH_ST2STR
|
||||
|
||||
return "(unknown)";
|
||||
}
|
|
@ -1,316 +0,0 @@
|
|||
/*
|
||||
* MinHook - The Minimalistic API Hooking Library for x64/x86
|
||||
* Copyright (C) 2009-2017 Tsuda Kageyu.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER
|
||||
* OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
#ifndef ARRAYSIZE
|
||||
#define ARRAYSIZE(A) (sizeof(A)/sizeof((A)[0]))
|
||||
#endif
|
||||
|
||||
#if defined(_M_X64) || defined(__x86_64__)
|
||||
#include "./hde/hde64.h"
|
||||
typedef hde64s HDE;
|
||||
#define HDE_DISASM(code, hs) hde64_disasm(code, hs)
|
||||
#else
|
||||
#include "./hde/hde32.h"
|
||||
typedef hde32s HDE;
|
||||
#define HDE_DISASM(code, hs) hde32_disasm(code, hs)
|
||||
#endif
|
||||
|
||||
#include "trampoline.h"
|
||||
#include "buffer.h"
|
||||
|
||||
// Maximum size of a trampoline function.
|
||||
#if defined(_M_X64) || defined(__x86_64__)
|
||||
#define TRAMPOLINE_MAX_SIZE (MEMORY_SLOT_SIZE - sizeof(JMP_ABS))
|
||||
#else
|
||||
#define TRAMPOLINE_MAX_SIZE MEMORY_SLOT_SIZE
|
||||
#endif
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
static BOOL IsCodePadding(LPBYTE pInst, UINT size)
|
||||
{
|
||||
UINT i;
|
||||
|
||||
if (pInst[0] != 0x00 && pInst[0] != 0x90 && pInst[0] != 0xCC)
|
||||
return FALSE;
|
||||
|
||||
for (i = 1; i < size; ++i)
|
||||
{
|
||||
if (pInst[i] != pInst[0])
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
BOOL CreateTrampolineFunction(PTRAMPOLINE ct)
|
||||
{
|
||||
#if defined(_M_X64) || defined(__x86_64__)
|
||||
CALL_ABS call = {
|
||||
0xFF, 0x15, 0x00000002, // FF15 00000002: CALL [RIP+8]
|
||||
0xEB, 0x08, // EB 08: JMP +10
|
||||
0x0000000000000000ULL // Absolute destination address
|
||||
};
|
||||
JMP_ABS jmp = {
|
||||
0xFF, 0x25, 0x00000000, // FF25 00000000: JMP [RIP+6]
|
||||
0x0000000000000000ULL // Absolute destination address
|
||||
};
|
||||
JCC_ABS jcc = {
|
||||
0x70, 0x0E, // 7* 0E: J** +16
|
||||
0xFF, 0x25, 0x00000000, // FF25 00000000: JMP [RIP+6]
|
||||
0x0000000000000000ULL // Absolute destination address
|
||||
};
|
||||
#else
|
||||
CALL_REL call = {
|
||||
0xE8, // E8 xxxxxxxx: CALL +5+xxxxxxxx
|
||||
0x00000000 // Relative destination address
|
||||
};
|
||||
JMP_REL jmp = {
|
||||
0xE9, // E9 xxxxxxxx: JMP +5+xxxxxxxx
|
||||
0x00000000 // Relative destination address
|
||||
};
|
||||
JCC_REL jcc = {
|
||||
0x0F, 0x80, // 0F8* xxxxxxxx: J** +6+xxxxxxxx
|
||||
0x00000000 // Relative destination address
|
||||
};
|
||||
#endif
|
||||
|
||||
UINT8 oldPos = 0;
|
||||
UINT8 newPos = 0;
|
||||
ULONG_PTR jmpDest = 0; // Destination address of an internal jump.
|
||||
BOOL finished = FALSE; // Is the function completed?
|
||||
#if defined(_M_X64) || defined(__x86_64__)
|
||||
UINT8 instBuf[16];
|
||||
#endif
|
||||
|
||||
ct->patchAbove = FALSE;
|
||||
ct->nIP = 0;
|
||||
|
||||
do
|
||||
{
|
||||
HDE hs;
|
||||
UINT copySize;
|
||||
LPVOID pCopySrc;
|
||||
ULONG_PTR pOldInst = (ULONG_PTR)ct->pTarget + oldPos;
|
||||
ULONG_PTR pNewInst = (ULONG_PTR)ct->pTrampoline + newPos;
|
||||
|
||||
copySize = HDE_DISASM((LPVOID)pOldInst, &hs);
|
||||
if (hs.flags & F_ERROR)
|
||||
return FALSE;
|
||||
|
||||
pCopySrc = (LPVOID)pOldInst;
|
||||
if (oldPos >= sizeof(JMP_REL))
|
||||
{
|
||||
// The trampoline function is long enough.
|
||||
// Complete the function with the jump to the target function.
|
||||
#if defined(_M_X64) || defined(__x86_64__)
|
||||
jmp.address = pOldInst;
|
||||
#else
|
||||
jmp.operand = (UINT32)(pOldInst - (pNewInst + sizeof(jmp)));
|
||||
#endif
|
||||
pCopySrc = &jmp;
|
||||
copySize = sizeof(jmp);
|
||||
|
||||
finished = TRUE;
|
||||
}
|
||||
#if defined(_M_X64) || defined(__x86_64__)
|
||||
else if ((hs.modrm & 0xC7) == 0x05)
|
||||
{
|
||||
// Instructions using RIP relative addressing. (ModR/M = 00???101B)
|
||||
|
||||
// Modify the RIP relative address.
|
||||
PUINT32 pRelAddr;
|
||||
|
||||
// Avoid using memcpy to reduce the footprint.
|
||||
#ifndef _MSC_VER
|
||||
memcpy(instBuf, (LPBYTE)pOldInst, copySize);
|
||||
#else
|
||||
__movsb(instBuf, (LPBYTE)pOldInst, copySize);
|
||||
#endif
|
||||
pCopySrc = instBuf;
|
||||
|
||||
// Relative address is stored at (instruction length - immediate value length - 4).
|
||||
pRelAddr = (PUINT32)(instBuf + hs.len - ((hs.flags & 0x3C) >> 2) - 4);
|
||||
*pRelAddr
|
||||
= (UINT32)((pOldInst + hs.len + (INT32)hs.disp.disp32) - (pNewInst + hs.len));
|
||||
|
||||
// Complete the function if JMP (FF /4).
|
||||
if (hs.opcode == 0xFF && hs.modrm_reg == 4)
|
||||
finished = TRUE;
|
||||
}
|
||||
#endif
|
||||
else if (hs.opcode == 0xE8)
|
||||
{
|
||||
// Direct relative CALL
|
||||
ULONG_PTR dest = pOldInst + hs.len + (INT32)hs.imm.imm32;
|
||||
#if defined(_M_X64) || defined(__x86_64__)
|
||||
call.address = dest;
|
||||
#else
|
||||
call.operand = (UINT32)(dest - (pNewInst + sizeof(call)));
|
||||
#endif
|
||||
pCopySrc = &call;
|
||||
copySize = sizeof(call);
|
||||
}
|
||||
else if ((hs.opcode & 0xFD) == 0xE9)
|
||||
{
|
||||
// Direct relative JMP (EB or E9)
|
||||
ULONG_PTR dest = pOldInst + hs.len;
|
||||
|
||||
if (hs.opcode == 0xEB) // isShort jmp
|
||||
dest += (INT8)hs.imm.imm8;
|
||||
else
|
||||
dest += (INT32)hs.imm.imm32;
|
||||
|
||||
// Simply copy an internal jump.
|
||||
if ((ULONG_PTR)ct->pTarget <= dest
|
||||
&& dest < ((ULONG_PTR)ct->pTarget + sizeof(JMP_REL)))
|
||||
{
|
||||
if (jmpDest < dest)
|
||||
jmpDest = dest;
|
||||
}
|
||||
else
|
||||
{
|
||||
#if defined(_M_X64) || defined(__x86_64__)
|
||||
jmp.address = dest;
|
||||
#else
|
||||
jmp.operand = (UINT32)(dest - (pNewInst + sizeof(jmp)));
|
||||
#endif
|
||||
pCopySrc = &jmp;
|
||||
copySize = sizeof(jmp);
|
||||
|
||||
// Exit the function If it is not in the branch
|
||||
finished = (pOldInst >= jmpDest);
|
||||
}
|
||||
}
|
||||
else if ((hs.opcode & 0xF0) == 0x70
|
||||
|| (hs.opcode & 0xFC) == 0xE0
|
||||
|| (hs.opcode2 & 0xF0) == 0x80)
|
||||
{
|
||||
// Direct relative Jcc
|
||||
ULONG_PTR dest = pOldInst + hs.len;
|
||||
|
||||
if ((hs.opcode & 0xF0) == 0x70 // Jcc
|
||||
|| (hs.opcode & 0xFC) == 0xE0) // LOOPNZ/LOOPZ/LOOP/JECXZ
|
||||
dest += (INT8)hs.imm.imm8;
|
||||
else
|
||||
dest += (INT32)hs.imm.imm32;
|
||||
|
||||
// Simply copy an internal jump.
|
||||
if ((ULONG_PTR)ct->pTarget <= dest
|
||||
&& dest < ((ULONG_PTR)ct->pTarget + sizeof(JMP_REL)))
|
||||
{
|
||||
if (jmpDest < dest)
|
||||
jmpDest = dest;
|
||||
}
|
||||
else if ((hs.opcode & 0xFC) == 0xE0)
|
||||
{
|
||||
// LOOPNZ/LOOPZ/LOOP/JCXZ/JECXZ to the outside are not supported.
|
||||
return FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
UINT8 cond = ((hs.opcode != 0x0F ? hs.opcode : hs.opcode2) & 0x0F);
|
||||
#if defined(_M_X64) || defined(__x86_64__)
|
||||
// Invert the condition in x64 mode to simplify the conditional jump logic.
|
||||
jcc.opcode = 0x71 ^ cond;
|
||||
jcc.address = dest;
|
||||
#else
|
||||
jcc.opcode1 = 0x80 | cond;
|
||||
jcc.operand = (UINT32)(dest - (pNewInst + sizeof(jcc)));
|
||||
#endif
|
||||
pCopySrc = &jcc;
|
||||
copySize = sizeof(jcc);
|
||||
}
|
||||
}
|
||||
else if ((hs.opcode & 0xFE) == 0xC2)
|
||||
{
|
||||
// RET (C2 or C3)
|
||||
|
||||
// Complete the function if not in a branch.
|
||||
finished = (pOldInst >= jmpDest);
|
||||
}
|
||||
|
||||
// Can't alter the instruction length in a branch.
|
||||
if (pOldInst < jmpDest && copySize != hs.len)
|
||||
return FALSE;
|
||||
|
||||
// Trampoline function is too large.
|
||||
if ((newPos + copySize) > TRAMPOLINE_MAX_SIZE)
|
||||
return FALSE;
|
||||
|
||||
// Trampoline function has too many instructions.
|
||||
if (ct->nIP >= ARRAYSIZE(ct->oldIPs))
|
||||
return FALSE;
|
||||
|
||||
ct->oldIPs[ct->nIP] = oldPos;
|
||||
ct->newIPs[ct->nIP] = newPos;
|
||||
ct->nIP++;
|
||||
|
||||
// Avoid using memcpy to reduce the footprint.
|
||||
#ifndef _MSC_VER
|
||||
memcpy((LPBYTE)ct->pTrampoline + newPos, pCopySrc, copySize);
|
||||
#else
|
||||
__movsb((LPBYTE)ct->pTrampoline + newPos, pCopySrc, copySize);
|
||||
#endif
|
||||
newPos += copySize;
|
||||
oldPos += hs.len;
|
||||
}
|
||||
while (!finished);
|
||||
|
||||
// Is there enough place for a long jump?
|
||||
if (oldPos < sizeof(JMP_REL)
|
||||
&& !IsCodePadding((LPBYTE)ct->pTarget + oldPos, sizeof(JMP_REL) - oldPos))
|
||||
{
|
||||
// Is there enough place for a short jump?
|
||||
if (oldPos < sizeof(JMP_REL_SHORT)
|
||||
&& !IsCodePadding((LPBYTE)ct->pTarget + oldPos, sizeof(JMP_REL_SHORT) - oldPos))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// Can we place the long jump above the function?
|
||||
if (!IsExecutableAddress((LPBYTE)ct->pTarget - sizeof(JMP_REL)))
|
||||
return FALSE;
|
||||
|
||||
if (!IsCodePadding((LPBYTE)ct->pTarget - sizeof(JMP_REL), sizeof(JMP_REL)))
|
||||
return FALSE;
|
||||
|
||||
ct->patchAbove = TRUE;
|
||||
}
|
||||
|
||||
#if defined(_M_X64) || defined(__x86_64__)
|
||||
// Create a relay function.
|
||||
jmp.address = (ULONG_PTR)ct->pDetour;
|
||||
|
||||
ct->pRelay = (LPBYTE)ct->pTrampoline + newPos;
|
||||
memcpy(ct->pRelay, &jmp, sizeof(jmp));
|
||||
#endif
|
||||
|
||||
return TRUE;
|
||||
}
|
|
@ -1,105 +0,0 @@
|
|||
/*
|
||||
* MinHook - The Minimalistic API Hooking Library for x64/x86
|
||||
* Copyright (C) 2009-2017 Tsuda Kageyu.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER
|
||||
* OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#pragma pack(push, 1)
|
||||
|
||||
// Structs for writing x86/x64 instructions.
|
||||
|
||||
// 8-bit relative jump.
|
||||
typedef struct _JMP_REL_SHORT
|
||||
{
|
||||
UINT8 opcode; // EB xx: JMP +2+xx
|
||||
UINT8 operand;
|
||||
} JMP_REL_SHORT, *PJMP_REL_SHORT;
|
||||
|
||||
// 32-bit direct relative jump/call.
|
||||
typedef struct _JMP_REL
|
||||
{
|
||||
UINT8 opcode; // E9/E8 xxxxxxxx: JMP/CALL +5+xxxxxxxx
|
||||
UINT32 operand; // Relative destination address
|
||||
} JMP_REL, *PJMP_REL, CALL_REL;
|
||||
|
||||
// 64-bit indirect absolute jump.
|
||||
typedef struct _JMP_ABS
|
||||
{
|
||||
UINT8 opcode0; // FF25 00000000: JMP [+6]
|
||||
UINT8 opcode1;
|
||||
UINT32 dummy;
|
||||
UINT64 address; // Absolute destination address
|
||||
} JMP_ABS, *PJMP_ABS;
|
||||
|
||||
// 64-bit indirect absolute call.
|
||||
typedef struct _CALL_ABS
|
||||
{
|
||||
UINT8 opcode0; // FF15 00000002: CALL [+6]
|
||||
UINT8 opcode1;
|
||||
UINT32 dummy0;
|
||||
UINT8 dummy1; // EB 08: JMP +10
|
||||
UINT8 dummy2;
|
||||
UINT64 address; // Absolute destination address
|
||||
} CALL_ABS;
|
||||
|
||||
// 32-bit direct relative conditional jumps.
|
||||
typedef struct _JCC_REL
|
||||
{
|
||||
UINT8 opcode0; // 0F8* xxxxxxxx: J** +6+xxxxxxxx
|
||||
UINT8 opcode1;
|
||||
UINT32 operand; // Relative destination address
|
||||
} JCC_REL;
|
||||
|
||||
// 64bit indirect absolute conditional jumps that x64 lacks.
|
||||
typedef struct _JCC_ABS
|
||||
{
|
||||
UINT8 opcode; // 7* 0E: J** +16
|
||||
UINT8 dummy0;
|
||||
UINT8 dummy1; // FF25 00000000: JMP [+6]
|
||||
UINT8 dummy2;
|
||||
UINT32 dummy3;
|
||||
UINT64 address; // Absolute destination address
|
||||
} JCC_ABS;
|
||||
|
||||
#pragma pack(pop)
|
||||
|
||||
typedef struct _TRAMPOLINE
|
||||
{
|
||||
LPVOID pTarget; // [In] Address of the target function.
|
||||
LPVOID pDetour; // [In] Address of the detour function.
|
||||
LPVOID pTrampoline; // [In] Buffer address for the trampoline and relay function.
|
||||
|
||||
#if defined(_M_X64) || defined(__x86_64__)
|
||||
LPVOID pRelay; // [Out] Address of the relay function.
|
||||
#endif
|
||||
BOOL patchAbove; // [Out] Should use the hot patch area?
|
||||
UINT nIP; // [Out] Number of the instruction boundaries.
|
||||
UINT8 oldIPs[8]; // [Out] Instruction boundaries of the target function.
|
||||
UINT8 newIPs[8]; // [Out] Instruction boundaries of the trampoline function.
|
||||
} TRAMPOLINE, *PTRAMPOLINE;
|
||||
|
||||
BOOL CreateTrampolineFunction(PTRAMPOLINE ct);
|
|
@ -1,35 +1,16 @@
|
|||
[Options]
|
||||
|
||||
# PresentationInterval
|
||||
#
|
||||
# -1 = VSync OFF
|
||||
# 1 = VSync ON
|
||||
PresentationInterval = 1
|
||||
|
||||
# FFXIIIIngameFrameRateLimit
|
||||
# TripleBuffering
|
||||
#
|
||||
# Using higher numbers may cause noticiable facial animation jankness during cutscenes.
|
||||
# See https://github.com/rebtd7/FF13Fix/issues/3
|
||||
#
|
||||
# Note that the frame pacer is always disabled by this mod, regardless of the value this option is set.
|
||||
#
|
||||
# -1 = Use the maximum FPS cap possible
|
||||
# 0 = Use the game's default FPS limit (59.94005966 FPS)
|
||||
# other = Use the number provided as the FPS limit (e.g. set 30.0 to limit to 30.0 FPS)
|
||||
FFXIIIIngameFrameRateLimit = 0
|
||||
|
||||
# FFXIIIEnableControllerVibration
|
||||
#
|
||||
# Enables controller vibration on the first connected XInput device.
|
||||
FFXIIIEnableControllerVibration = true
|
||||
|
||||
# FFXIIIDisableIngameControllerHotSwapping
|
||||
#
|
||||
# By default FF13Fix disables the game's continuous controller scanning that causes stuttering (especially if you do not have any controller connected)
|
||||
# If you with you can enable it again (by setting the config to 'false', so you can re-connect your controller while playing.
|
||||
# Note that FFXIIIEnableControllerVibration is incompatible with the controller hotswapping,
|
||||
# so it is automatically disabled if FFXIIIDisableIngameControllerHotSwapping is set to 'false'
|
||||
FFXIIIDisableIngameControllerHotSwapping = true
|
||||
# -1 = Auto (Disabled for dxvk.dll; else, enabled)
|
||||
# 0 = Off
|
||||
# 1 = On
|
||||
TripleBuffering = -1
|
||||
|
||||
# FullScreenRefreshRate
|
||||
#
|
||||
|
@ -41,8 +22,6 @@ FFXIIIDisableIngameControllerHotSwapping = true
|
|||
# 0 = Same as configured in the operating system
|
||||
# other = Use the number provided as the display refresh rate (in Hz)
|
||||
FullScreenRefreshRate = 0
|
||||
|
||||
TripleBuffering = true
|
||||
SwapEffect = -1
|
||||
AlwaysActive = false
|
||||
AutoFix = true
|
||||
|
@ -51,6 +30,37 @@ HideCursor = false
|
|||
ForceHideCursor = false
|
||||
BehaviorFlags = 0
|
||||
|
||||
[FFXIII]
|
||||
# IngameFrameRateLimit
|
||||
#
|
||||
# Using higher numbers may cause noticiable facial animation jankness during cutscenes.
|
||||
# See https://github.com/rebtd7/FF13Fix/issues/3
|
||||
#
|
||||
# Note that the frame pacer is always disabled by this mod, regardless of the value this option is set.
|
||||
#
|
||||
# -1 = Use the maximum FPS cap possible
|
||||
# 0 = Use the game's default FPS limit (59.94005966 FPS)
|
||||
# other = Use the number provided as the FPS limit (e.g. set 30 to limit to 30 FPS)
|
||||
IngameFrameRateLimit = 0
|
||||
|
||||
# DisableIngameControllerHotSwapping
|
||||
#
|
||||
# By default FF13Fix disables the game's continuous controller scanning that causes stuttering (especially if you do not have any controller connected)
|
||||
# If you with you can enable it again (by setting the config to 'false', so you can re-connect your controller while playing.
|
||||
# Note that EnableControllerVibration is incompatible with the controller hotswapping,
|
||||
# so it is automatically disabled if DisableIngameControllerHotSwapping is set to 'false'
|
||||
DisableIngameControllerHotSwapping = true
|
||||
|
||||
# EnableControllerVibration
|
||||
#
|
||||
# Enables controller vibration on the first connected XInput device.
|
||||
EnableControllerVibration = true
|
||||
|
||||
# VibrationStrengthFactor
|
||||
#
|
||||
# Higher numbers = stronger vibration
|
||||
VibrationStrengthFactor = 2.000000
|
||||
|
||||
[Adapter]
|
||||
Adapter = false
|
||||
VendorId = 0
|
||||
|
@ -65,4 +75,4 @@ WindowClass =
|
|||
WindowName =
|
||||
|
||||
[Version]
|
||||
Config = 4
|
||||
Config = 5
|
||||
|
|
37
README.md
37
README.md
|
@ -8,14 +8,14 @@ This is a fork of [OneTweakNG](https://github.com/Nucleoprotein/OneTweakNG), con
|
|||
Thanks Nucleoprotein for starting this!
|
||||
|
||||
# Installation
|
||||
Download the latest [release](https://github.com/rebtd7/FF13Fix/releases) and add both ```dinput8.dll``` and ```FF13Fix.ini``` to the folder ```FINAL FANTASY XIII\white_data\prog\win\bin``` for FF13 and to the folder ```FINAL FANTASY XIII-2\alba_data\prog\win\bin``` for FF13-2.
|
||||
Download the latest [release](https://github.com/rebtd7/FF13Fix/releases) and add both ```d3d9.dll``` and ```FF13Fix.ini``` to the folder ```FINAL FANTASY XIII\white_data\prog\win\bin``` for FF13 and to the folder ```FINAL FANTASY XIII-2\alba_data\prog\win\bin``` for FF13-2.
|
||||
|
||||
You can to change ```FF13Fix.ini``` if you want to change any configuration (e.g. uncap the framerate or disable controller vibration).
|
||||
|
||||
# What this does
|
||||
|
||||
## Removes the awful frame pacer
|
||||
I don't see the point in it. It is overly aggressive. Disabling this greatly improves the frame rate in certain situations.
|
||||
## Removes the frame pacer
|
||||
Disabling this greatly improves the frame rate in certain situations.
|
||||
|
||||
## Removes stuttering caused by new controllers being scanned every second
|
||||
This caused stuttering specially if you didn't have a connected controller after the last opening of Steam.
|
||||
|
@ -38,17 +38,38 @@ By default the game forced a 60Hz refresh rate in full screen mode. With this mo
|
|||
## Changes to where the memory is allocated on certain vertex buffers
|
||||
This considerably improves the frame rate when 2D elements are being disabled on the screen (i.e. minimap or battle menu HUD). This fix is not new, it is from [OneTweakNG](https://github.com/Nucleoprotein/OneTweakNG).
|
||||
|
||||
## Works around pixelated screen bug that happens when using 2560x1440 resolution
|
||||
The internal resolution is reduced to 2559x1440 to workaround the issue.
|
||||
## Fixes misaligned screen space effects (fixes 1440p resolution)
|
||||
|
||||
## Fix the enemy scan text on resolutions over 720p (FFXIII only)
|
||||
The game calls [SetScissorRect](https://docs.microsoft.com/en-us/windows/win32/api/d3d9helper/nf-d3d9helper-idirect3ddevice9-setscissorrect) using a rectangle hardcoded with the 720p coordenates. This correct the coordenates and rectangle size in order to fix it.
|
||||
|
||||
## Reporting issues
|
||||
* Please specify what game are you talking about, post system specs, and post FF13Fix.log
|
||||
# Usage with DXVK
|
||||
People use DXVK on Windows to work around crashes with recent AMD Navi cards. If you are using Nvidia on Windows, you probably don't need it.
|
||||
* Rename DXVK's x86 ```d3d9.dll``` file to ```dxvk.dll```. Keep FF13Fix as ```d3d9.dll```.
|
||||
|
||||
|
||||
# Usage with the 4GB Large Address Aware patch (Recommended)
|
||||
You may wish to patch the games to allow them to access more than 2GB of RAM.
|
||||
This seems to avoid crashes in FF13-2 and FF13 (especially when using triple buffering, playing on 4K+ resolutions, using DXVK and/or Reshade, or using HD texture/model mods).
|
||||
## FF13:
|
||||
* Create a copy of the unpatched ```ffxiiiimg.exe``` to the folder ```FINAL FANTASY XIII\white_data\prog\win\bin```. Name it ```untouched.exe```.
|
||||
* Patch the original ```ffxiiiimg.exe``` (you can use https://ntcore.com/?page_id=371)
|
||||
## FF13-2:
|
||||
* Patch ```ffxiii2img.exe``` (you can use https://ntcore.com/?page_id=371)
|
||||
|
||||
# Usage with Reshade
|
||||
|
||||
## Regular Direct3D9 users:
|
||||
* Install ReShade first. Rename ReShade's ```d3d9.dll``` to ```ReShade32.dll```; Install FF13Fix normally, keeping FF13Fix as ```d3d9.dll```
|
||||
## DXVK users:
|
||||
* Install ReShade targeting Vulkan; enable it globally
|
||||
|
||||
# Reporting issues
|
||||
* Please specify what game are you talking about, which mods are you using (dxvk?) post system specs, and post FF13Fix.log
|
||||
* Add a save file and steps to reproduce the issue if possible
|
||||
|
||||
## Other notes
|
||||
# Other notes
|
||||
* This is currently not compatible with GeDoSaTo.
|
||||
* I strongly recommend forcing anisotropic filtering on your GPU driver to improve the quality of the textures.
|
||||
* Using "Maximum Performance" power management in the GPU driver can also help keeping the frame rate smooth.
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ EndProject
|
|||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Common", "Common", "{5DB3A8C9-CF87-4AB6-A7C2-07B81A0DA625}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
Common\Defines.h = Common\Defines.h
|
||||
Common\Logger.h = Common\Logger.h
|
||||
Common\MemPatch.h = Common\MemPatch.h
|
||||
Common\SimpleIni.h = Common\SimpleIni.h
|
||||
Common\StringUtil.h = Common\StringUtil.h
|
||||
Common\Timer.h = Common\Timer.h
|
||||
|
@ -17,7 +17,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Common", "Common", "{5DB3A8
|
|||
Common\WinVer.h = Common\WinVer.h
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libMinHook", "MinHook\build\VC15\libMinHook.vcxproj", "{F142A341-5EE0-442D-A15F-98AE9B48DBAE}"
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Deps", "Deps", "{908757C5-6B19-44A6-9C35-1F913D016F6F}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libMinHook", "Deps\MinHook\build\VC16\libMinHook.vcxproj", "{F142A341-5EE0-442D-A15F-98AE9B48DBAE}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
|
@ -48,7 +50,7 @@ Global
|
|||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {CC332D21-3B2D-4534-AD8E-2525081AECA5}
|
||||
VisualSVNWorkingCopyRoot = .
|
||||
SolutionGuid = {CC332D21-3B2D-4534-AD8E-2525081AECA5}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
|
|
@ -1,47 +1,107 @@
|
|||
#include "stdafx.h"
|
||||
|
||||
#include "MemPatch.h"
|
||||
|
||||
#include "Context.h"
|
||||
#include "IDirect3DVertexBuffer9.h"
|
||||
#include <MinHook.h>
|
||||
|
||||
void MainContext::EnableAutoFix()
|
||||
{
|
||||
std::string exe_name = ModuleNameA(NULL);
|
||||
std::transform(exe_name.begin(), exe_name.end(), exe_name.begin(), std::tolower);
|
||||
|
||||
if (exe_name == "game.exe" || exe_name == "game.dat")
|
||||
{
|
||||
autofix = RESIDENT_EVIL_4;
|
||||
PrintLog("AutoFix for \"Resident Evil 4\" enabled");
|
||||
}
|
||||
|
||||
if (exe_name == "kb.exe")
|
||||
{
|
||||
autofix = KINGS_BOUNTY_LEGEND;
|
||||
PrintLog("AutoFix for \"Kings Bounty: Legend\" enabled");
|
||||
}
|
||||
//workaround for template deduction after including <locale>
|
||||
std::transform(exe_name.begin(), exe_name.end(), exe_name.begin(), [&](int i) { return std::tolower(i); });
|
||||
|
||||
if (exe_name == "ffxiiiimg.exe")
|
||||
{
|
||||
autofix = FINAL_FANTASY_XIII;
|
||||
PrintLog("AutoFix for \"Final Fantasy XIII\" enabled");
|
||||
autofix = AutoFixes::FINAL_FANTASY_XIII;
|
||||
spdlog::info("AutoFix for \"Final Fantasy XIII\" enabled");
|
||||
FF13_InitializeGameAddresses();
|
||||
FF13_HandleLargeAddressAwarePatch();
|
||||
}
|
||||
|
||||
if (exe_name == "ffxiii2img.exe")
|
||||
{
|
||||
autofix = FINAL_FANTASY_XIII2;
|
||||
PrintLog("AutoFix for \"Final Fantasy XIII-2\" enabled");
|
||||
autofix = AutoFixes::FINAL_FANTASY_XIII2;
|
||||
spdlog::info("AutoFix for \"Final Fantasy XIII-2\" enabled");
|
||||
FF13_2_InitializeGameAddresses();
|
||||
FF13_2_CreateSetFrameRateCodeBlock();
|
||||
}
|
||||
}
|
||||
|
||||
const std::map<const MainContext::AutoFixes, const uint32_t> MainContext::behaviorflags_fixes =
|
||||
const std::map<const MainContext::AutoFixes, const uint32_t> MainContext::behaviorflags_add =
|
||||
{
|
||||
{ RESIDENT_EVIL_4, D3DCREATE_SOFTWARE_VERTEXPROCESSING },
|
||||
{ KINGS_BOUNTY_LEGEND, D3DCREATE_MIXED_VERTEXPROCESSING }
|
||||
|
||||
};
|
||||
|
||||
const std::map<const MainContext::AutoFixes, const uint32_t> MainContext::behaviorflags_sub =
|
||||
{
|
||||
//{ AutoFixes::FINAL_FANTASY_XIII, D3DCREATE_PUREDEVICE },
|
||||
//{ AutoFixes::FINAL_FANTASY_XIII2, D3DCREATE_PUREDEVICE }
|
||||
};
|
||||
|
||||
|
||||
HANDLE WINAPI MainContext::HookCreateFileA(LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile) {
|
||||
const char* ffxiiiimgPrt = strstr(lpFileName, "ffxiiiimg.exe");
|
||||
if (ffxiiiimgPrt) {
|
||||
spdlog::info("HookCreateFileA Before Replacement: {}", lpFileName);
|
||||
|
||||
int arrayPosition = ffxiiiimgPrt - lpFileName;
|
||||
int len = strlen(lpFileName);
|
||||
char* newFileName = new char[len + 1];
|
||||
strcpy_s(newFileName, len + 1, lpFileName);
|
||||
const char* untouched = "untouched"; // needs to have the size of "ffxiiiimg"
|
||||
|
||||
memcpy(newFileName + arrayPosition, untouched, strlen(untouched));
|
||||
spdlog::info("HookCreateFileA After Replacement: {}", newFileName);
|
||||
MH_STATUS disableHookCreateFileA = MH_DisableHook(CreateFileA);
|
||||
spdlog::info("disableHookCreateFileA = {}", disableHookCreateFileA);
|
||||
MH_STATUS disableHookCreateFileW = MH_DisableHook(CreateFileW);
|
||||
spdlog::info("disableHookCreateFileW = {}", disableHookCreateFileW);
|
||||
if (GetFileAttributesA(newFileName) == INVALID_FILE_ATTRIBUTES) {
|
||||
spdlog::info("ERROR: Unable to get attributes of {}. Does the file exist? Using the regular ffxiiiimg.exe", newFileName);
|
||||
strcpy_s(newFileName, len + 1, lpFileName);
|
||||
}
|
||||
HANDLE fileHandle = context.TrueCreateFileA(newFileName, dwDesiredAccess, dwShareMode, lpSecurityAttributes, dwCreationDisposition, dwFlagsAndAttributes, hTemplateFile);;
|
||||
spdlog::info("Returning File Handle for {}", newFileName);
|
||||
delete[] newFileName;
|
||||
return fileHandle;
|
||||
}
|
||||
else {
|
||||
return context.TrueCreateFileA(lpFileName, dwDesiredAccess, dwShareMode, lpSecurityAttributes, dwCreationDisposition, dwFlagsAndAttributes, hTemplateFile);
|
||||
}
|
||||
}
|
||||
|
||||
HANDLE WINAPI MainContext::HookCreateFileW(LPCWSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile) {
|
||||
const wchar_t* ffxiiiimgPrt = wcsstr(lpFileName, L"ffxiiiimg.exe");;
|
||||
|
||||
if (ffxiiiimgPrt) {
|
||||
spdlog::info(L"HookCreateFileW Before Replacement: {}", lpFileName);
|
||||
|
||||
int arrayPosition = ffxiiiimgPrt - lpFileName;
|
||||
int len = wcslen(lpFileName);
|
||||
wchar_t* newFileName = new wchar_t[len + 1];
|
||||
wcscpy_s(newFileName, len + 1, lpFileName);
|
||||
const wchar_t* untouched = L"untouched"; //needs to have the size of L"ffxiiiimg"
|
||||
wmemcpy(newFileName + arrayPosition, untouched, wcslen(untouched));
|
||||
spdlog::info(L"HookCreateFileW After Replacement: {}", newFileName);
|
||||
MH_STATUS disableHookCreateFileA = MH_DisableHook(CreateFileA);
|
||||
spdlog::info("disableHookCreateFileA = {}", disableHookCreateFileA);
|
||||
MH_STATUS disableHookCreateFileW = MH_DisableHook(CreateFileW);
|
||||
spdlog::info("disableHookCreateFileW = {}", disableHookCreateFileW);
|
||||
if (GetFileAttributesW(newFileName) == INVALID_FILE_ATTRIBUTES) {
|
||||
spdlog::info(L"ERROR: Unable to get attributes of {}. Does the file exist?", newFileName);
|
||||
wcscpy_s(newFileName, len + 1, lpFileName);
|
||||
}
|
||||
HANDLE fileHandle = context.TrueCreateFileW(newFileName, dwDesiredAccess, dwShareMode, lpSecurityAttributes, dwCreationDisposition, dwFlagsAndAttributes, hTemplateFile);;
|
||||
spdlog::info(L"Returning File Handle {}", newFileName);
|
||||
delete[] newFileName;
|
||||
return fileHandle;
|
||||
}
|
||||
else {
|
||||
return context.TrueCreateFileW(lpFileName, dwDesiredAccess, dwShareMode, lpSecurityAttributes, dwCreationDisposition, dwFlagsAndAttributes, hTemplateFile);
|
||||
}
|
||||
}
|
||||
|
||||
void MainContext::FixBehaviorFlagConflict(const DWORD flags_in, DWORD* flags_out)
|
||||
{
|
||||
if (flags_in & D3DCREATE_SOFTWARE_VERTEXPROCESSING)
|
||||
|
@ -61,65 +121,127 @@ void MainContext::FixBehaviorFlagConflict(const DWORD flags_in, DWORD* flags_out
|
|||
}
|
||||
}
|
||||
|
||||
bool MainContext::ApplyBehaviorFlagsFix(DWORD* flags)
|
||||
void MainContext::ApplyBehaviorFlagsFix(DWORD* flags)
|
||||
{
|
||||
if (autofix == AutoFixes::NONE) return false;
|
||||
if (autofix == AutoFixes::NONE) return;
|
||||
|
||||
auto&& fix = behaviorflags_fixes.find(autofix);
|
||||
if (fix != behaviorflags_fixes.end())
|
||||
auto&& add = behaviorflags_add.find(autofix);
|
||||
if (add != behaviorflags_add.end())
|
||||
FixBehaviorFlagConflict(add->second, flags);
|
||||
|
||||
auto&& sub = behaviorflags_sub.find(autofix);
|
||||
if (sub != behaviorflags_sub.end())
|
||||
{
|
||||
FixBehaviorFlagConflict(fix->second, flags);
|
||||
return true;
|
||||
*flags = *flags & ~sub->second;
|
||||
FixBehaviorFlagConflict(sub->second, flags);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void MainContext::ScaleScissorRect(RECT * rect) {
|
||||
rect->left = (LONG) (rect->left * scissor_scaling_factor_w);
|
||||
rect->top = (LONG) (rect->top * scissor_scaling_factor_h);
|
||||
rect->right = (LONG)(rect->right * scissor_scaling_factor_w);
|
||||
rect->bottom = (LONG) (rect-> bottom * scissor_scaling_factor_h);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY MainContext::ApplyVertexBufferFix(IDirect3DDevice9* pIDirect3DDevice9, UINT Length, DWORD Usage, DWORD FVF, D3DPOOL Pool, IDirect3DVertexBuffer9** ppVertexBuffer, HANDLE* pSharedHandle)
|
||||
HRESULT MainContext::SetScissorRect(IDirect3DDevice9* pIDirect3DDevice9, CONST RECT* rect)
|
||||
{
|
||||
switch (autofix) {
|
||||
case AutoFixes::NONE:
|
||||
return pIDirect3DDevice9->CreateVertexBuffer(Length, Usage, FVF, Pool, ppVertexBuffer, pSharedHandle);
|
||||
case FINAL_FANTASY_XIII:
|
||||
case FINAL_FANTASY_XIII2:
|
||||
if (rect)
|
||||
{
|
||||
RECT* r = const_cast<RECT*>(rect);
|
||||
r->left = (LONG)(r->left * scissor_scaling_factor_w);
|
||||
r->top = (LONG)(r->top * scissor_scaling_factor_h);
|
||||
r->right = (LONG)(r->right * scissor_scaling_factor_w);
|
||||
r->bottom = (LONG)(r->bottom * scissor_scaling_factor_h);
|
||||
return pIDirect3DDevice9->SetScissorRect(r);
|
||||
}
|
||||
return pIDirect3DDevice9->SetScissorRect(rect);
|
||||
}
|
||||
|
||||
// hate this workaround but we cant directly mix d3d9 include with and without defined CINTERFACE
|
||||
namespace cinterface {
|
||||
void VertexBufferFix(IDirect3DVertexBuffer9* pVertexBuffer);
|
||||
}
|
||||
|
||||
HRESULT MainContext::CreateVertexBuffer(IDirect3DDevice9* pIDirect3DDevice9, UINT Length, DWORD Usage, DWORD FVF, D3DPOOL Pool, IDirect3DVertexBuffer9** ppVertexBuffer, HANDLE* pSharedHandle)
|
||||
{
|
||||
if (autofix == AutoFixes::FINAL_FANTASY_XIII ||
|
||||
autofix == AutoFixes::FINAL_FANTASY_XIII2)
|
||||
{
|
||||
// Both games lock a vertex buffer 358400 before drawing any 2D element on screen (sometimes multiple times per frame)
|
||||
if (Length == 358400 && Pool == D3DPOOL_MANAGED) {
|
||||
Usage = D3DUSAGE_DYNAMIC | D3DUSAGE_WRITEONLY;
|
||||
Pool = D3DPOOL_SYSTEMMEM;
|
||||
HRESULT hr = pIDirect3DDevice9->CreateVertexBuffer(Length, Usage, FVF, Pool, ppVertexBuffer, pSharedHandle);
|
||||
|
||||
//IDirect3DVertexBuffer9* buffer = nullptr;
|
||||
//HRESULT hr = pIDirect3DDevice9->CreateVertexBuffer(Length, Usage, FVF, Pool, &buffer, NULL);
|
||||
//if (FAILED(hr))
|
||||
//{
|
||||
// return pIDirect3DDevice9->CreateVertexBuffer(Length, Usage, FVF, Pool, ppVertexBuffer, pSharedHandle);
|
||||
//}
|
||||
|
||||
//if(ppVertexBuffer) *ppVertexBuffer = new hkIDirect3DVertexBuffer9(pIDirect3DDevice9, buffer);
|
||||
//return hr;
|
||||
if (config.GetFFXIIIDiscardUIVertexBuffer() && ppVertexBuffer && *ppVertexBuffer)
|
||||
{
|
||||
//Pool = D3DPOOL_DEFAULT;
|
||||
cinterface::VertexBufferFix(*ppVertexBuffer);
|
||||
}
|
||||
return hr;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return pIDirect3DDevice9->CreateVertexBuffer(Length, Usage, FVF, Pool, ppVertexBuffer, pSharedHandle);
|
||||
}
|
||||
HRESULT MainContext::DrawPrimitiveUP(IDirect3DDevice9* pIDirect3DDevice9, D3DPRIMITIVETYPE PrimitiveType, UINT PrimitiveCount, const void* pVertexStreamZeroData, UINT VertexStreamZeroStride)
|
||||
{
|
||||
if (PrimitiveType == D3DPT_TRIANGLEFAN && PrimitiveCount == 2 && VertexStreamZeroStride == 20 && MatchesExpectedVertexStream((const float*)pVertexStreamZeroData)) {
|
||||
return pIDirect3DDevice9->DrawPrimitiveUP(PrimitiveType, PrimitiveCount, fixedDrawPrimitiveUpVertexData, VertexStreamZeroStride);
|
||||
}
|
||||
else {
|
||||
return pIDirect3DDevice9->DrawPrimitiveUP(PrimitiveType, PrimitiveCount, pVertexStreamZeroData, VertexStreamZeroStride);
|
||||
}
|
||||
}
|
||||
|
||||
void MainContext::FF13_AsyncPatching() {
|
||||
bool MainContext::MatchesExpectedVertexStream(const float* pVertexStreamZeroData) {
|
||||
for (int i = 0; i < 4 * 5; i++) {
|
||||
if (fabs(expectedDrawPrimitiveUpVertexData[i] - pVertexStreamZeroData[i]) > 0.000001f) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool MainContext::OneTimeFixInit(std::unique_ptr<wchar_t[]>& className, HWND hWnd)
|
||||
{
|
||||
if (wcscmp(className.get(), L"SQEX.CDev.Engine.Framework.MainWindow") == 0) {
|
||||
otf_init = true;
|
||||
hWndFF13 = hWnd;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void MainContext::OneTimeFix()
|
||||
{
|
||||
if (otf_init)
|
||||
{
|
||||
otf_init = false;
|
||||
std::thread fix(&context.Fix_Thread);
|
||||
fix.detach();
|
||||
}
|
||||
}
|
||||
|
||||
void MainContext::Fix_Thread()
|
||||
{
|
||||
auto start = std::chrono::high_resolution_clock::now();
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(2000));
|
||||
context.FF13_OneTimeFixes();
|
||||
auto end = std::chrono::high_resolution_clock::now();
|
||||
std::chrono::duration<double, std::milli> elapsed = end - start;
|
||||
spdlog::info("Waited {} ms", elapsed.count());
|
||||
|
||||
std::lock_guard<std::mutex> lock(context.fix_mutex);
|
||||
if (context.autofix == AutoFixes::FINAL_FANTASY_XIII) {
|
||||
spdlog::info("Starting FFXIII one time RAM patches.");
|
||||
context.FF13_OneTimeFixes();
|
||||
}
|
||||
else if (context.autofix == AutoFixes::FINAL_FANTASY_XIII2) {
|
||||
spdlog::info("Starting FFXIII-2 one time RAM patches.");
|
||||
context.FF13_2_OneTimeFixes();
|
||||
}
|
||||
MessageBeep(MB_ICONASTERISK);
|
||||
}
|
||||
|
||||
void MainContext::FF13_InitializeGameAddresses()
|
||||
{
|
||||
// FF13 always seem to use the same addresses (even if you force ASLR on the OS), but we are calculating the addresses just in case...
|
||||
uint8_t* baseAddr = (uint8_t*)GetModuleHandle(NULL); // Should be 400000
|
||||
PrintLog("Base Addr = %x", baseAddr);
|
||||
spdlog::info("Base Addr = {}", (void*)baseAddr);
|
||||
|
||||
ff13_frame_pacer_ptr = (float**)(baseAddr + 0x243E34C);
|
||||
ff13_set_framerate_ingame_instruction_address = baseAddr + 0xA8D65F;
|
||||
|
@ -139,79 +261,111 @@ void MainContext::FF13_InitializeGameAddresses()
|
|||
ff13_party_screen_scissor_scaling_factor_2 = baseAddr + 0x668E1E;
|
||||
ff13_party_screen_scissor_scaling_factor_3 = baseAddr + 0x668E56;
|
||||
ff13_party_screen_scissor_scaling_factor_4 = baseAddr + 0x668E91;
|
||||
ff13_message_box_call_address = baseAddr + 0xA8A98F;
|
||||
ff13_message_box_stack_push_address = baseAddr + 0xA8A982;
|
||||
ff13_exe_large_address_aware_flag_address = baseAddr + 0x126;
|
||||
ff13_exe_checksum_address = (uint32_t*)(baseAddr + 0x168);
|
||||
}
|
||||
|
||||
void MainContext::FF13_HandleLargeAddressAwarePatch() {
|
||||
const uint8_t laaMask = 0x20;
|
||||
if (*ff13_exe_large_address_aware_flag_address & laaMask) {
|
||||
spdlog::info("LargeAddressAwarePatch found. ff13_exe_large_address_aware_flag = {:X}; ff13_exe_checksum = {:X}", *ff13_exe_large_address_aware_flag_address, *ff13_exe_checksum_address);
|
||||
|
||||
const MH_STATUS createHookCreateFileA = MH_CreateHook(CreateFileA, HookCreateFileA, reinterpret_cast<void**>(&TrueCreateFileA));
|
||||
spdlog::info("createHookCreateFileA = {}", createHookCreateFileA);
|
||||
const MH_STATUS enableHookCreateFileA = MH_EnableHook(CreateFileA);
|
||||
spdlog::info("enableHookCreateFileA = {}", enableHookCreateFileA);
|
||||
|
||||
const MH_STATUS createHookCreateFileW = MH_CreateHook(CreateFileW, HookCreateFileW, reinterpret_cast<void**>(&TrueCreateFileW));
|
||||
spdlog::info("createHookCreateFileW = {}", createHookCreateFileW);
|
||||
const MH_STATUS enableHookCreateFileW = MH_EnableHook(CreateFileW);
|
||||
spdlog::info("enableHookCreateFileW = {}", enableHookCreateFileW);
|
||||
|
||||
uint8_t new_ff13_exe_large_address_aware_flag = *ff13_exe_large_address_aware_flag_address & ~laaMask;
|
||||
MemPatch::Patch(ff13_exe_large_address_aware_flag_address, &new_ff13_exe_large_address_aware_flag, 1);
|
||||
spdlog::info("LargeAddressAware patched back. ff13_exe_large_address_aware_flag = {:X};", *ff13_exe_large_address_aware_flag_address);
|
||||
|
||||
uint32_t new_ff13_exe_checksum = 0;
|
||||
MemPatch::Patch(ff13_exe_checksum_address, &new_ff13_exe_checksum, sizeof(uint32_t));
|
||||
spdlog::info("Checksum patched back. ff13_exe_checksum = {:X}", *ff13_exe_checksum_address);
|
||||
|
||||
spdlog::info("LargeAddressAwarePatch handled");
|
||||
}
|
||||
else {
|
||||
spdlog::info("LargeAddressAwarePatch not found.");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void MainContext::ForceWindowActivate(const HWND hWnd) {
|
||||
PostMessage(hWnd, WM_ACTIVATE, WA_INACTIVE, NULL);
|
||||
PostMessage(hWnd, WM_ACTIVATE, WA_CLICKACTIVE, NULL);
|
||||
SetForegroundWindow(hWnd);
|
||||
}
|
||||
|
||||
void MainContext::FF13_OneTimeFixes() {
|
||||
MainContext::FF13_Workaround_1440_Res_Bug();
|
||||
MainContext::FF13_NOPIngameFrameRateLimitSetter();
|
||||
MainContext::FF13_RemoveContinuousControllerScan();
|
||||
MainContext::FF13_FixScissorRect();
|
||||
MainContext::FF13_EnableControllerVibration();
|
||||
MainContext::FF13_SetFrameRateVariables();
|
||||
|
||||
PrintLog("Finished FF13 One Time Fixes");
|
||||
context.didOneTimeFixes = true;
|
||||
if (IsDXVK()) {
|
||||
FF13_PatchMessageBox();
|
||||
}
|
||||
|
||||
ForceWindowActivate(hWndFF13);
|
||||
|
||||
FF13_NOPIngameFrameRateLimitSetter();
|
||||
FF13_RemoveContinuousControllerScan();
|
||||
FF13_FixScissorRect();
|
||||
FF13_EnableControllerVibration();
|
||||
FF13_SetFrameRateVariables();
|
||||
AdjustVertexData(*ff13_internal_res_w, *ff13_internal_res_h);
|
||||
|
||||
spdlog::info("Finished FF13 One Time Fixes");
|
||||
}
|
||||
|
||||
void MainContext::FF13_Workaround_1440_Res_Bug()
|
||||
void MainContext::FF13_PatchMessageBox()
|
||||
{
|
||||
if (*ff13_internal_res_w == 2560 && *ff13_internal_res_h == 1440) {
|
||||
// We need to reduce one or another. Increasing the internal res causes crashes.
|
||||
// Decreasing the internal res width by one pixel causes the last pixel column displayed on the screen to stay black.
|
||||
PrintLog("Applying workaround for resolution 2560x1440 bug.");
|
||||
*ff13_internal_res_w = 2559;
|
||||
}
|
||||
else if (*ff13_internal_res_w == 3440 && *ff13_internal_res_h == 1440) {
|
||||
// Fix ultrawide pixelation also.
|
||||
PrintLog("Applying workaround for resolution 3440x1440 bug.");
|
||||
*ff13_internal_res_w = 3439;
|
||||
}
|
||||
}
|
||||
spdlog::info("Removing 'Quit game' textbox");
|
||||
|
||||
MemPatch::Nop(ff13_message_box_stack_push_address, 1);
|
||||
MemPatch::Nop(ff13_message_box_stack_push_address + 1 * 4, 1);
|
||||
MemPatch::Nop(ff13_message_box_stack_push_address + 2 * 4, 1);
|
||||
MemPatch::Nop(ff13_message_box_stack_push_address + 3 * 4, 1);
|
||||
PatchMessageBoxCall(ff13_message_box_call_address);
|
||||
}
|
||||
|
||||
void MainContext::FF13_EnableControllerVibration()
|
||||
{
|
||||
if (!config.GetFFXIIIEnableControllerVibration()) {
|
||||
PrintLog("Vibration should not be enabled (config file)");
|
||||
spdlog::info("Vibration should not be enabled (config file)");
|
||||
return;
|
||||
}
|
||||
if (!config.GetFFXIIIDisableIngameControllerHotSwapping()) {
|
||||
PrintLog("Vibration disabled because FFXIIIDisableIngameControllerHotSwapping is set to false (config file)");
|
||||
spdlog::info("Vibration disabled because FFXIIIDisableIngameControllerHotSwapping is set to false (config file)");
|
||||
return;
|
||||
}
|
||||
PrintLog("Enabling controller vibration...");
|
||||
ChangeMemoryProtectionToReadWriteExecute(ff13_vibration_low_set_zero_address, 5);
|
||||
spdlog::info("Enabling controller vibration...");
|
||||
MemPatch::Nop(ff13_vibration_low_set_zero_address, 5);
|
||||
MemPatch::Nop(ff13_vibration_high_set_zero_address, 5);
|
||||
|
||||
*ff13_vibration_low_set_zero_address = 0x90;
|
||||
*(ff13_vibration_low_set_zero_address + 1) = 0x90;
|
||||
*(ff13_vibration_low_set_zero_address + 2) = 0x90;
|
||||
*(ff13_vibration_low_set_zero_address + 3) = 0x90;
|
||||
*(ff13_vibration_low_set_zero_address + 4) = 0x90;
|
||||
|
||||
ChangeMemoryProtectionToReadWriteExecute(ff13_vibration_high_set_zero_address, 5);
|
||||
*ff13_vibration_high_set_zero_address = 0x90;
|
||||
*(ff13_vibration_high_set_zero_address + 1) = 0x90;
|
||||
*(ff13_vibration_high_set_zero_address + 2) = 0x90;
|
||||
*(ff13_vibration_high_set_zero_address + 3) = 0x90;
|
||||
*(ff13_vibration_high_set_zero_address + 4) = 0x90;
|
||||
xinputManager = new XInputManager(ff13_base_controller_input_address_ptr);
|
||||
xinputManager = new XInputManager(ff13_base_controller_input_address_ptr, config.GetFFXIIIVibrationStrengthFactor());
|
||||
}
|
||||
|
||||
void MainContext::FF13_RemoveContinuousControllerScan() {
|
||||
void MainContext::FF13_RemoveContinuousControllerScan()
|
||||
{
|
||||
if (!config.GetFFXIIIDisableIngameControllerHotSwapping()) {
|
||||
PrintLog("Continuous controller scanning not disabled (config)");
|
||||
spdlog::info("Continuous controller scanning not disabled (config)");
|
||||
return;
|
||||
}
|
||||
// Disable continuous controller scanning.
|
||||
|
||||
PrintLog("Removing game slow and synchronous controller continuous controller scanning...");
|
||||
context.ChangeMemoryProtectionToReadWriteExecute(ff13_continuous_scan_instruction_address, 1);
|
||||
spdlog::info("Removing game slow and synchronous controller continuous controller scanning...");
|
||||
// change a jne to jmp
|
||||
*(uint8_t*)ff13_continuous_scan_instruction_address = 0xEB;
|
||||
MemPatch::Fill(ff13_continuous_scan_instruction_address, 0xEB, 1);
|
||||
}
|
||||
|
||||
void MainContext::FF13_FixScissorRect() {
|
||||
PrintLog("Fixing ScissorRect...");
|
||||
void MainContext::FF13_FixScissorRect()
|
||||
{
|
||||
spdlog::info("Fixing ScissorRect...");
|
||||
const float originalWidth = 1280.0F;
|
||||
const float resolutionFactorW = (float)*ff13_internal_res_w / originalWidth;
|
||||
scissor_scaling_factor_w = resolutionFactorW;
|
||||
|
@ -223,177 +377,130 @@ void MainContext::FF13_FixScissorRect() {
|
|||
// The game scales some scissor rects, but not all of them.
|
||||
// It seems easier to neuter its internal scaling process and scale everything on our own...
|
||||
|
||||
context.ChangeMemoryProtectionToReadWriteExecute(ff13_loading_screen_scissor_scaling_factor_1, 3);
|
||||
*(ff13_loading_screen_scissor_scaling_factor_1) = 0x90; // NOP
|
||||
*(ff13_loading_screen_scissor_scaling_factor_1 + 1) = 0x90; // NOP
|
||||
*(ff13_loading_screen_scissor_scaling_factor_1 + 2) = 0x90; // NOP
|
||||
|
||||
context.ChangeMemoryProtectionToReadWriteExecute(ff13_loading_screen_scissor_scaling_factor_2, 3);
|
||||
*(ff13_loading_screen_scissor_scaling_factor_2 + 0) = 0x90; // NOP
|
||||
*(ff13_loading_screen_scissor_scaling_factor_2 + 1) = 0x90; // NOP
|
||||
*(ff13_loading_screen_scissor_scaling_factor_2 + 2) = 0x90; // NOP
|
||||
|
||||
context.ChangeMemoryProtectionToReadWriteExecute(ff13_loading_screen_scissor_scaling_factor_3, 3);
|
||||
*(ff13_loading_screen_scissor_scaling_factor_3 + 0) = 0x90; // NOP
|
||||
*(ff13_loading_screen_scissor_scaling_factor_3 + 1) = 0x90; // NOP
|
||||
*(ff13_loading_screen_scissor_scaling_factor_3 + 2) = 0x90; // NOP
|
||||
|
||||
context.ChangeMemoryProtectionToReadWriteExecute(ff13_loading_screen_scissor_scaling_factor_4, 3);
|
||||
*(ff13_loading_screen_scissor_scaling_factor_4 + 0) = 0x90; // NOP
|
||||
*(ff13_loading_screen_scissor_scaling_factor_4 + 1) = 0x90; // NOP
|
||||
*(ff13_loading_screen_scissor_scaling_factor_4 + 2) = 0x90; // NOP
|
||||
|
||||
context.ChangeMemoryProtectionToReadWriteExecute(ff13_settings_screen_scissor_scaling_factor, 5);
|
||||
*(ff13_settings_screen_scissor_scaling_factor) = 0x90; // NOP
|
||||
*(ff13_settings_screen_scissor_scaling_factor + 1) = 0x90; // NOP
|
||||
*(ff13_settings_screen_scissor_scaling_factor + 2) = 0x90; // NOP
|
||||
*(ff13_settings_screen_scissor_scaling_factor + 3) = 0x90; // NOP
|
||||
*(ff13_settings_screen_scissor_scaling_factor + 4) = 0x90; // NOP
|
||||
|
||||
context.ChangeMemoryProtectionToReadWriteExecute(ff13_party_screen_scissor_scaling_factor_1, 4);
|
||||
*(ff13_party_screen_scissor_scaling_factor_1) = 0x90; // NOP
|
||||
*(ff13_party_screen_scissor_scaling_factor_1 + 1) = 0x90; // NOP
|
||||
*(ff13_party_screen_scissor_scaling_factor_1 + 2) = 0x90; // NOP
|
||||
*(ff13_party_screen_scissor_scaling_factor_1 + 3) = 0x90; // NOP
|
||||
|
||||
context.ChangeMemoryProtectionToReadWriteExecute(ff13_party_screen_scissor_scaling_factor_2, 7);
|
||||
*(ff13_party_screen_scissor_scaling_factor_2) = 0x90; // NOP
|
||||
*(ff13_party_screen_scissor_scaling_factor_2 + 1) = 0x90; // NOP
|
||||
*(ff13_party_screen_scissor_scaling_factor_2 + 2) = 0x90; // NOP
|
||||
*(ff13_party_screen_scissor_scaling_factor_2 + 3) = 0x90; // NOP
|
||||
*(ff13_party_screen_scissor_scaling_factor_2 + 4) = 0x90; // NOP
|
||||
*(ff13_party_screen_scissor_scaling_factor_2 + 5) = 0x90; // NOP
|
||||
*(ff13_party_screen_scissor_scaling_factor_2 + 6) = 0x90; // NOP
|
||||
|
||||
context.ChangeMemoryProtectionToReadWriteExecute(ff13_party_screen_scissor_scaling_factor_3, 7);
|
||||
*(ff13_party_screen_scissor_scaling_factor_3) = 0x90; // NOP
|
||||
*(ff13_party_screen_scissor_scaling_factor_3 + 1) = 0x90; // NOP
|
||||
*(ff13_party_screen_scissor_scaling_factor_3 + 2) = 0x90; // NOP
|
||||
*(ff13_party_screen_scissor_scaling_factor_3 + 3) = 0x90; // NOP
|
||||
*(ff13_party_screen_scissor_scaling_factor_3 + 4) = 0x90; // NOP
|
||||
*(ff13_party_screen_scissor_scaling_factor_3 + 5) = 0x90; // NOP
|
||||
*(ff13_party_screen_scissor_scaling_factor_3 + 6) = 0x90; // NOP
|
||||
|
||||
context.ChangeMemoryProtectionToReadWriteExecute(ff13_party_screen_scissor_scaling_factor_4, 5);
|
||||
*(ff13_party_screen_scissor_scaling_factor_4) = 0x90; // NOP
|
||||
*(ff13_party_screen_scissor_scaling_factor_4 + 1) = 0x90; // NOP
|
||||
*(ff13_party_screen_scissor_scaling_factor_4 + 2) = 0x90; // NOP
|
||||
*(ff13_party_screen_scissor_scaling_factor_4 + 3) = 0x90; // NOP
|
||||
*(ff13_party_screen_scissor_scaling_factor_4 + 4) = 0x90; // NOP
|
||||
*(ff13_party_screen_scissor_scaling_factor_4 + 5) = 0x90; // NOP
|
||||
*(ff13_party_screen_scissor_scaling_factor_4 + 6) = 0x90; // NOP
|
||||
MemPatch::Nop(ff13_loading_screen_scissor_scaling_factor_1, 3);
|
||||
MemPatch::Nop(ff13_loading_screen_scissor_scaling_factor_2, 3);
|
||||
MemPatch::Nop(ff13_loading_screen_scissor_scaling_factor_3, 3);
|
||||
MemPatch::Nop(ff13_loading_screen_scissor_scaling_factor_4, 3);
|
||||
MemPatch::Nop(ff13_settings_screen_scissor_scaling_factor, 5);
|
||||
MemPatch::Nop(ff13_party_screen_scissor_scaling_factor_1, 4);
|
||||
MemPatch::Nop(ff13_party_screen_scissor_scaling_factor_2, 7);
|
||||
MemPatch::Nop(ff13_party_screen_scissor_scaling_factor_3, 7);
|
||||
MemPatch::Nop(ff13_party_screen_scissor_scaling_factor_4, 7);
|
||||
}
|
||||
|
||||
void MainContext::FF13_NOPIngameFrameRateLimitSetter() {
|
||||
PrintLog("NOPing the in-game instruction that sets the frame rate.");
|
||||
|
||||
context.ChangeMemoryProtectionToReadWriteExecute(ff13_set_framerate_ingame_instruction_address, 5);
|
||||
|
||||
// patching to: NOP NOP NOP NOP
|
||||
*ff13_set_framerate_ingame_instruction_address = 0x90;
|
||||
*(ff13_set_framerate_ingame_instruction_address + 1) = 0x90;
|
||||
*(ff13_set_framerate_ingame_instruction_address + 2) = 0x90;
|
||||
*(ff13_set_framerate_ingame_instruction_address + 3) = 0x90;
|
||||
*(ff13_set_framerate_ingame_instruction_address + 4) = 0x90;
|
||||
void MainContext::FF13_NOPIngameFrameRateLimitSetter()
|
||||
{
|
||||
spdlog::info("NOPing the in-game instruction that sets the frame rate.");
|
||||
MemPatch::Nop(ff13_set_framerate_ingame_instruction_address, 5);
|
||||
}
|
||||
|
||||
void MainContext::FF13_SetFrameRateVariables() {
|
||||
void MainContext::FF13_SetFrameRateVariables()
|
||||
{
|
||||
float* framePacerTargetPtr = *ff13_frame_pacer_ptr;
|
||||
if (framePacerTargetPtr) {
|
||||
PrintLog("Frame pacer target frame rate is at address %x", framePacerTargetPtr);
|
||||
spdlog::info("Frame pacer target frame rate is at address {}", (void*)framePacerTargetPtr);
|
||||
|
||||
float* ingameFrameRateFramePacerTarget = framePacerTargetPtr;
|
||||
*ingameFrameRateFramePacerTarget = MAX_FRAME_RATE_LIMIT;
|
||||
PrintLog("Frame pacer disabled.");
|
||||
spdlog::info("Frame pacer disabled.");
|
||||
|
||||
const float frameRateConfig = (float)context.config.GetFFXIIIIngameFrameRateLimit();
|
||||
const bool unlimitedFrameRate = AreAlmostTheSame(frameRateConfig, -1.0f);
|
||||
const bool shouldSetFrameRateLimit = !AreAlmostTheSame(frameRateConfig, 0.0f);
|
||||
if (config.GetFFXIIIIngameFrameRateLimit() != 0)
|
||||
{
|
||||
const s32 frameRateConfig = config.GetFFXIIIIngameFrameRateLimit();
|
||||
float frameRateLimit = 0;
|
||||
|
||||
float frameRateLimit = 0;
|
||||
if (frameRateConfig == -1) {
|
||||
frameRateLimit = MAX_FRAME_RATE_LIMIT;
|
||||
}
|
||||
else if (frameRateConfig > 0) {
|
||||
frameRateLimit = (float)std::min(frameRateConfig, (s32)MAX_FRAME_RATE_LIMIT);
|
||||
}
|
||||
|
||||
if (unlimitedFrameRate) {
|
||||
frameRateLimit = MAX_FRAME_RATE_LIMIT;
|
||||
}
|
||||
else {
|
||||
frameRateLimit = frameRateConfig;
|
||||
}
|
||||
|
||||
if (shouldSetFrameRateLimit) {
|
||||
float* ingameFrameRateLimitPtr = framePacerTargetPtr + 1;
|
||||
*ingameFrameRateLimitPtr = frameRateLimit;
|
||||
PrintLog("Target frame rate set to %f", frameRateLimit);
|
||||
}
|
||||
spdlog::info("Target frame rate set to {}", frameRateLimit); }
|
||||
}
|
||||
else {
|
||||
PrintLog("Unable to find frame pacer / frame rate address. This shouldn't happen! Report this.");
|
||||
spdlog::info("Unable to find frame pacer / frame rate address. This shouldn't happen! Report this.");
|
||||
}
|
||||
}
|
||||
|
||||
void MainContext::FF13_2_AsyncPatching() {
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(2000));
|
||||
context.FF13_2_OneTimeFixes();
|
||||
}
|
||||
|
||||
void MainContext::FF13_2_OneTimeFixes() {
|
||||
void MainContext::FF13_2_OneTimeFixes()
|
||||
{
|
||||
ForceWindowActivate(hWndFF13);
|
||||
if (IsDXVK()) {
|
||||
FF13_2_PatchMessageBox();
|
||||
}
|
||||
|
||||
if (*ff13_2_frame_pacer_ptr_address) {
|
||||
**ff13_2_frame_pacer_ptr_address = MAX_FRAME_RATE_LIMIT;
|
||||
PrintLog("Frame pacer disabled");
|
||||
spdlog::info("Frame pacer disabled");
|
||||
|
||||
context.FF13_2_Workaround_2560_1440_Res_Bug();
|
||||
context.FF13_2_AddHookIngameFrameRateLimitSetter();
|
||||
context.FF13_2_RemoveContinuousControllerScan();
|
||||
context.FF13_2_EnableControllerVibration();
|
||||
PrintLog("Finished FF13-2 One Time Fixes");
|
||||
context.didOneTimeFixes = true;
|
||||
FF13_2_AddHookIngameFrameRateLimitSetter();
|
||||
FF13_2_RemoveContinuousControllerScan();
|
||||
FF13_2_EnableControllerVibration();
|
||||
AdjustVertexData(*ff13_2_internal_res_w, *ff13_2_internal_res_h);
|
||||
spdlog::info("Finished FF13-2 One Time Fixes");
|
||||
}
|
||||
else {
|
||||
PrintLog("Unable to apply FF13-2 One Time Fixes. Report this!");
|
||||
spdlog::info("Unable to apply FF13-2 One Time Fixes. Report this!");
|
||||
}
|
||||
}
|
||||
|
||||
void MainContext::FF13_2_Workaround_2560_1440_Res_Bug()
|
||||
void MainContext::FF13_2_PatchMessageBox()
|
||||
{
|
||||
if (*ff13_2_internal_res_w == 2560 && *ff13_2_internal_res_h == 1440) {
|
||||
// We need to reduce one or another. Increasing the internal res causes crashes.
|
||||
// Decreasing the internal res width by one pixel causes the last pixel column displayed on the screen to stay black.
|
||||
PrintLog("Applying workaround for resolution 2560x1440 bug.");
|
||||
*ff13_2_internal_res_w = 2559;
|
||||
}
|
||||
spdlog::info("Removing 'Quit game' textbox");
|
||||
|
||||
// NOP push of registers to call MessageBox
|
||||
MemPatch::Nop(ff13_2_message_box_stack_push_address, 5);
|
||||
PatchMessageBoxCall(ff13_2_message_box_call_address);
|
||||
}
|
||||
|
||||
void MainContext::PatchMessageBoxCall(uint8_t* callInstructionAddress)
|
||||
{
|
||||
const int patchSize = 6;
|
||||
uint8_t patch[patchSize];
|
||||
|
||||
// mov eax, IDYES
|
||||
patch[0] = 0xB8;
|
||||
*((uint32_t*)(patch + 1)) = IDYES;
|
||||
|
||||
// nop
|
||||
patch[5] = 0x90;
|
||||
|
||||
MemPatch::Patch(callInstructionAddress, patch, patchSize);
|
||||
}
|
||||
|
||||
void MainContext::FF13_2_EnableControllerVibration()
|
||||
{
|
||||
if (!config.GetFFXIIIEnableControllerVibration()) {
|
||||
PrintLog("Vibration should not be enabled (config file)");
|
||||
spdlog::info("Vibration should not be enabled (config file)");
|
||||
return;
|
||||
}
|
||||
PrintLog("Enabling controller vibration...");
|
||||
ChangeMemoryProtectionToReadWriteExecute(ff13_2_vibration_low_set_zero_address, 5);
|
||||
spdlog::info("Enabling controller vibration...");
|
||||
|
||||
*ff13_2_vibration_low_set_zero_address = 0x90;
|
||||
*(ff13_2_vibration_low_set_zero_address + 1) = 0x90;
|
||||
*(ff13_2_vibration_low_set_zero_address + 2) = 0x90;
|
||||
*(ff13_2_vibration_low_set_zero_address + 3) = 0x90;
|
||||
*(ff13_2_vibration_low_set_zero_address + 4) = 0x90;
|
||||
MemPatch::Nop(ff13_2_vibration_low_set_zero_address, 5);
|
||||
MemPatch::Nop(ff13_2_vibration_high_set_zero_address, 5);
|
||||
|
||||
ChangeMemoryProtectionToReadWriteExecute(ff13_2_vibration_high_set_zero_address, 5);
|
||||
*ff13_2_vibration_high_set_zero_address = 0x90;
|
||||
*(ff13_2_vibration_high_set_zero_address + 1) = 0x90;
|
||||
*(ff13_2_vibration_high_set_zero_address + 2) = 0x90;
|
||||
*(ff13_2_vibration_high_set_zero_address + 3) = 0x90;
|
||||
*(ff13_2_vibration_high_set_zero_address + 4) = 0x90;
|
||||
xinputManager = new XInputManager(ff13_2_base_controller_input_address_ptr, config.GetFFXIIIVibrationStrengthFactor());
|
||||
}
|
||||
|
||||
xinputManager = new XInputManager(ff13_2_base_controller_input_address_ptr);
|
||||
void MainContext::AdjustVertexData(const uint32_t width, const uint32_t height)
|
||||
{
|
||||
const float widthHalfPixelSize = 1.0f / width;
|
||||
const float heightHalfPixelSize = 1.0f / height;
|
||||
for (int i = 0; i < 4; i++) {
|
||||
const unsigned int rowBaseIndex = i * 5;
|
||||
context.fixedDrawPrimitiveUpVertexData[rowBaseIndex] -= widthHalfPixelSize;
|
||||
context.fixedDrawPrimitiveUpVertexData[1 + rowBaseIndex] += heightHalfPixelSize;
|
||||
}
|
||||
}
|
||||
|
||||
void MainContext::FF13_2_InitializeGameAddresses()
|
||||
{
|
||||
// FF13-2 uses address space layout randomization (ASLR) so we can't rely on fixed addresses without considering the base address
|
||||
uint8_t* baseAddr = (uint8_t*)GetModuleHandle(NULL);
|
||||
PrintLog("Base Addr = %x", baseAddr);
|
||||
spdlog::info("Base Addr = {}", (void*)baseAddr);
|
||||
|
||||
ff13_2_continuous_scan_instruction_address = baseAddr + 0x2A6E7F;
|
||||
ff13_2_set_frame_rate_address = baseAddr + 0x802616;
|
||||
|
@ -403,30 +510,33 @@ void MainContext::FF13_2_InitializeGameAddresses()
|
|||
ff13_2_vibration_high_set_zero_address = baseAddr + 0x2A7226;
|
||||
ff13_2_internal_res_w = (uint32_t*)(baseAddr + 0x1FA864C);
|
||||
ff13_2_internal_res_h = ff13_2_internal_res_w + 1;
|
||||
ff13_2_message_box_call_address = baseAddr + 0x8047C0;
|
||||
ff13_2_message_box_stack_push_address = baseAddr + 0x8047B4;
|
||||
}
|
||||
|
||||
void MainContext::FF13_2_RemoveContinuousControllerScan() {
|
||||
void MainContext::FF13_2_RemoveContinuousControllerScan()
|
||||
{
|
||||
if (!config.GetFFXIIIDisableIngameControllerHotSwapping()) {
|
||||
PrintLog("Continuous controller scanning not disabled (config)");
|
||||
spdlog::info("Continuous controller scanning not disabled (config)");
|
||||
return;
|
||||
}
|
||||
// Disable continuous controller scanning.
|
||||
|
||||
PrintLog("Removing game slow and synchronous controller continuous controller scanning...");
|
||||
context.ChangeMemoryProtectionToReadWriteExecute(ff13_2_continuous_scan_instruction_address, 1);
|
||||
spdlog::info("Removing game slow and synchronous controller continuous controller scanning...");
|
||||
// change a jne to jmp
|
||||
*(uint8_t*)ff13_2_continuous_scan_instruction_address = 0xEB;
|
||||
MemPatch::Fill(ff13_2_continuous_scan_instruction_address, 0xEB, 1);
|
||||
}
|
||||
|
||||
void MainContext::FF13_2_AddHookIngameFrameRateLimitSetter() {
|
||||
if (context.AreAlmostTheSame((float)context.config.GetFFXIIIIngameFrameRateLimit(), 0.0F)) {
|
||||
PrintLog("Frame rate should not be changed (config = 0)");
|
||||
void MainContext::FF13_2_AddHookIngameFrameRateLimitSetter()
|
||||
{
|
||||
if (config.GetFFXIIIIngameFrameRateLimit() == 0) {
|
||||
spdlog::info("Frame rate should not be changed (config = 0)");
|
||||
return;
|
||||
}
|
||||
|
||||
PrintLog("Hooking the instruction that sets the frame rate...");
|
||||
spdlog::info("Hooking the instruction that sets the frame rate...");
|
||||
|
||||
context.ChangeMemoryProtectionToReadWriteExecute(ff13_2_set_frame_rate_address, 5);
|
||||
MemPatch::CUnprotect unp(ff13_2_set_frame_rate_address, 5);
|
||||
|
||||
// patching to: jmp FF13_2_SET_FRAME_RATE_INJECTED_CODE
|
||||
*ff13_2_set_frame_rate_address = 0xE9;
|
||||
|
@ -436,16 +546,26 @@ void MainContext::FF13_2_AddHookIngameFrameRateLimitSetter() {
|
|||
void MainContext::FF13_2_CreateSetFrameRateCodeBlock()
|
||||
{
|
||||
const int blockSize = 31;
|
||||
FF13_2_SET_FRAME_RATE_INJECTED_CODE = new uint8_t[blockSize];
|
||||
|
||||
ChangeMemoryProtectionToReadWriteExecute(FF13_2_SET_FRAME_RATE_INJECTED_CODE, blockSize);
|
||||
|
||||
float frameRateConfigValue = (float)context.config.GetFFXIIIIngameFrameRateLimit();
|
||||
if (AreAlmostTheSame(frameRateConfigValue, -1.0F) || frameRateConfigValue > FF13_2_MAX_FRAME_CAP) {
|
||||
ff13_2_targetFrameRate = FF13_2_MAX_FRAME_CAP;
|
||||
FF13_2_SET_FRAME_RATE_INJECTED_CODE = new(std::nothrow) uint8_t[blockSize];
|
||||
if (!FF13_2_SET_FRAME_RATE_INJECTED_CODE) {
|
||||
spdlog::info("Failed to initialize FFXIII-2 code block");
|
||||
return;
|
||||
}
|
||||
else {
|
||||
ff13_2_targetFrameRate = frameRateConfigValue;
|
||||
DWORD oldProtect;
|
||||
VirtualProtect(FF13_2_SET_FRAME_RATE_INJECTED_CODE, blockSize, PAGE_EXECUTE_READWRITE, &oldProtect);
|
||||
|
||||
if (config.GetFFXIIIIngameFrameRateLimit() != 0)
|
||||
{
|
||||
const s32 frameRateConfig = config.GetFFXIIIIngameFrameRateLimit();
|
||||
|
||||
if (frameRateConfig == -1) {
|
||||
ff13_2_targetFrameRate = FF13_2_MAX_FRAME_CAP;
|
||||
}
|
||||
else if (frameRateConfig > 0) {
|
||||
ff13_2_targetFrameRate = (float)std::min(frameRateConfig, (s32)FF13_2_MAX_FRAME_CAP);
|
||||
}
|
||||
|
||||
spdlog::info("Target frame rate set to {}", ff13_2_targetFrameRate);
|
||||
}
|
||||
|
||||
// movss xmm1,[&FF13_2_30_FPS]
|
||||
|
@ -484,16 +604,6 @@ void MainContext::FF13_2_CreateSetFrameRateCodeBlock()
|
|||
*(uint32_t*)(FF13_2_SET_FRAME_RATE_INJECTED_CODE + 27) = ff13_2_set_frame_rate_address - FF13_2_SET_FRAME_RATE_INJECTED_CODE - 26;
|
||||
}
|
||||
|
||||
|
||||
void MainContext::ChangeMemoryProtectionToReadWriteExecute(void* address, const int size) {
|
||||
DWORD oldProtection;
|
||||
VirtualProtect(address, size, PAGE_EXECUTE_READWRITE, &oldProtection);
|
||||
}
|
||||
|
||||
void MainContext::PrintVersionInfo() {
|
||||
PrintLog("FF13Fix 1.4.6 https://github.com/rebtd7/FF13Fix");
|
||||
spdlog::info("FF13Fix 1.6.5 https://github.com/rebtd7/FF13Fix");
|
||||
}
|
||||
|
||||
bool MainContext::AreAlmostTheSame(float a, float b) {
|
||||
return fabs(a - b) < 0.01f;
|
||||
}
|
|
@ -1,11 +1,15 @@
|
|||
#include "stdafx.h"
|
||||
#include <windows.h>
|
||||
|
||||
#include "Wrapper.h"
|
||||
|
||||
#include "Context.h"
|
||||
#include "IDirect3D9.h"
|
||||
#include <thread>
|
||||
#include <array>
|
||||
|
||||
#include "MinHook.h"
|
||||
#include "SimpleIni.h"
|
||||
|
||||
#include "IDirect3D9.h"
|
||||
#include "IDirect3DDevice9.h"
|
||||
#include "Context.h"
|
||||
#include "Wrapper.h"
|
||||
|
||||
MainContext context;
|
||||
|
||||
|
@ -22,8 +26,8 @@ Config::Config()
|
|||
// save file and reload
|
||||
ini.Reset();
|
||||
|
||||
#define SETTING(_type, _func, _var, _section, _defaultval) \
|
||||
ini.Set##_func(L#_section, L#_var, _defaultval)
|
||||
#define SETTING(_type, _func, _var, _section, _defaultval, _comment) \
|
||||
ini.Set##_func(L#_section, L#_var, _defaultval, _comment)
|
||||
#include "Settings.h"
|
||||
#undef SETTING
|
||||
|
||||
|
@ -33,49 +37,63 @@ Config::Config()
|
|||
ini.LoadFile(inifile.c_str());
|
||||
}
|
||||
|
||||
#define SETTING(_type, _func, _var, _section, _defaultval) \
|
||||
#define SETTING(_type, _func, _var, _section, _defaultval, _comment) \
|
||||
_var = ini.Get##_func(L#_section, L#_var)
|
||||
#include "Settings.h"
|
||||
#undef SETTING
|
||||
}
|
||||
|
||||
MainContext::MainContext() : oldWndProc(nullptr)
|
||||
MainContext::MainContext()
|
||||
{
|
||||
LogFile("FF13Fix.log");
|
||||
std::string logfilename = FullPathFromPath("FF13Fix.log");
|
||||
auto file_logger = spdlog::basic_logger_mt("file_logger", logfilename, true);
|
||||
spdlog::set_default_logger(file_logger);
|
||||
|
||||
//[2014-10-31 23:46:59.678] [thread] [level] Some message
|
||||
spdlog::set_pattern("[%Y-%m-%d %T.%e] [%6t] [%l] %v");
|
||||
spdlog::set_level(static_cast<spdlog::level::level_enum>(config.GetLogLogLevel()));
|
||||
spdlog::flush_on(spdlog::level::err); // trigger flush whenever errors or more severe messages are logged
|
||||
|
||||
if(config.GetLogLogFlush())
|
||||
spdlog::flush_on(spdlog::level::trace); // trigger flush whenever trace or more severe messages are logged => always
|
||||
|
||||
context.PrintVersionInfo();
|
||||
|
||||
if (config.GetAutoFix()) EnableAutoFix();
|
||||
|
||||
PrintLog("Enabling hooks:");
|
||||
spdlog::info("Enabling hooks:");
|
||||
const MH_STATUS initializeHooks = MH_Initialize();
|
||||
PrintLog("initializeHooks = %d", initializeHooks);
|
||||
spdlog::info("initializeHooks = {}", initializeHooks);
|
||||
|
||||
const MH_STATUS createHookDirect3DCreate9 = MH_CreateHook(D3D9DLL::Get().Direct3DCreate9, HookDirect3DCreate9, reinterpret_cast<void**>(&TrueDirect3DCreate9));
|
||||
PrintLog("createHookDirect3DCreate9 = %d", createHookDirect3DCreate9);
|
||||
spdlog::info("createHookDirect3DCreate9 = {}", createHookDirect3DCreate9);
|
||||
const MH_STATUS enableHookDirect3DCreate9 = MH_EnableHook(D3D9DLL::Get().Direct3DCreate9);
|
||||
PrintLog("enableHookDirect3DCreate9 = %d", enableHookDirect3DCreate9);
|
||||
spdlog::info("enableHookDirect3DCreate9 = {}", enableHookDirect3DCreate9);
|
||||
|
||||
const MH_STATUS createHookDirect3DCreate9Ex = MH_CreateHook(D3D9DLL::Get().Direct3DCreate9Ex, HookDirect3DCreate9Ex, reinterpret_cast<void**>(&TrueDirect3DCreate9Ex));
|
||||
spdlog::info("createHookDirect3DCreate9Ex = {}", createHookDirect3DCreate9Ex);
|
||||
const MH_STATUS enableHookDirect3DCreate9Ex = MH_EnableHook(D3D9DLL::Get().Direct3DCreate9Ex);
|
||||
spdlog::info("enableHookDirect3DCreate9Ex = {}", enableHookDirect3DCreate9Ex);
|
||||
|
||||
const MH_STATUS createHookCreateWindowExA = MH_CreateHook(CreateWindowExA, HookCreateWindowExA, reinterpret_cast<void**>(&TrueCreateWindowExA));
|
||||
PrintLog("createHookCreateWindowExA = %d", createHookCreateWindowExA);
|
||||
spdlog::info("createHookCreateWindowExA = {}", createHookCreateWindowExA);
|
||||
const MH_STATUS enableHookCreateWindowExA = MH_EnableHook(CreateWindowExA);
|
||||
PrintLog("enableHookCreateWindowExA = %d", enableHookCreateWindowExA);
|
||||
spdlog::info("enableHookCreateWindowExA = {}", enableHookCreateWindowExA);
|
||||
|
||||
const MH_STATUS createHookCreateWindowExW = MH_CreateHook(CreateWindowExW, HookCreateWindowExW, reinterpret_cast<void**>(&TrueCreateWindowExW));
|
||||
PrintLog("createHookCreateWindowExW = %d", createHookCreateWindowExW);
|
||||
spdlog::info("createHookCreateWindowExW = {}", createHookCreateWindowExW);
|
||||
const MH_STATUS enableHookCreateWindowExW = MH_EnableHook(CreateWindowExW);
|
||||
PrintLog("enableHookCreateWindowExW = %d", enableHookCreateWindowExW);
|
||||
spdlog::info("enableHookCreateWindowExW = {}", enableHookCreateWindowExW);
|
||||
|
||||
const MH_STATUS createHookSetWindowLongA = MH_CreateHook(SetWindowLongA, HookSetWindowLongA, reinterpret_cast<void**>(&TrueSetWindowLongA));
|
||||
PrintLog("createHookSetWindowLongA = %d", createHookSetWindowLongA);
|
||||
spdlog::info("createHookSetWindowLongA = {}", createHookSetWindowLongA);
|
||||
const MH_STATUS enableHookSetWindowLongA = MH_EnableHook(SetWindowLongA);
|
||||
PrintLog("enableHookSetWindowLongA = %d", enableHookSetWindowLongA);
|
||||
spdlog::info("enableHookSetWindowLongA = {}", enableHookSetWindowLongA);
|
||||
|
||||
const MH_STATUS createHookSetWindowLongW = MH_CreateHook(SetWindowLongW, HookSetWindowLongW, reinterpret_cast<void**>(&TrueSetWindowLongW));
|
||||
PrintLog("createHookSetWindowLongW = %d", createHookSetWindowLongW);
|
||||
spdlog::info("createHookSetWindowLongW = {}", createHookSetWindowLongW);
|
||||
const MH_STATUS enableHookSetWindowLongW = MH_EnableHook(SetWindowLongW);
|
||||
PrintLog("enableHookSetWindowLongW = %d", enableHookSetWindowLongW);
|
||||
|
||||
spdlog::info("enableHookSetWindowLongW = {}", enableHookSetWindowLongW);
|
||||
|
||||
if (config.GetOptionsAutoFix()) EnableAutoFix();
|
||||
}
|
||||
|
||||
MainContext::~MainContext()
|
||||
|
@ -85,15 +103,27 @@ MainContext::~MainContext()
|
|||
|
||||
IDirect3D9* WINAPI MainContext::HookDirect3DCreate9(UINT SDKVersion)
|
||||
{
|
||||
spdlog::info(__FUNCTION__);
|
||||
IDirect3D9* d3d9 = context.TrueDirect3DCreate9(SDKVersion);
|
||||
if (d3d9)
|
||||
{
|
||||
return new hkIDirect3D9(d3d9);
|
||||
if (d3d9) {
|
||||
return new hkIDirect3D9(static_cast<IDirect3D9Ex*>(d3d9));
|
||||
}
|
||||
|
||||
return d3d9;
|
||||
}
|
||||
|
||||
HRESULT WINAPI MainContext::HookDirect3DCreate9Ex(UINT SDKVersion, IDirect3D9Ex** ppIDirect3D9Ex)
|
||||
{
|
||||
spdlog::info(__FUNCTION__);
|
||||
HRESULT hr = context.TrueDirect3DCreate9Ex(SDKVersion, ppIDirect3D9Ex);
|
||||
if (SUCCEEDED(hr)) {
|
||||
hkIDirect3D9* pIDirect3D9Ex = new hkIDirect3D9(*ppIDirect3D9Ex);
|
||||
*ppIDirect3D9Ex = pIDirect3D9Ex;
|
||||
}
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
bool MainContext::BehaviorFlagsToString(DWORD BehaviorFlags, std::string* BehaviorFlagsString)
|
||||
{
|
||||
#define BF2STR(x) if (BehaviorFlags & x) BehaviorFlagsString->append(#x" ");
|
||||
|
@ -125,56 +155,62 @@ bool MainContext::ApplyPresentationParameters(D3DPRESENT_PARAMETERS* pPresentati
|
|||
{
|
||||
if (pPresentationParameters)
|
||||
{
|
||||
if (config.GetTripleBuffering())
|
||||
// -1 = Auto, enabled when no DXVK is used
|
||||
if (config.GetOptionsTripleBuffering() == 1 || (config.GetOptionsTripleBuffering() == -1 && !IsDXVK()))
|
||||
{
|
||||
pPresentationParameters->BackBufferCount = 3;
|
||||
PrintLog("BackBufferCount: BackBufferCount set to %u", pPresentationParameters->BackBufferCount);
|
||||
spdlog::info("BackBufferCount: BackBufferCount set to {}", pPresentationParameters->BackBufferCount);
|
||||
}
|
||||
|
||||
if ((s32)config.GetFullScreenRefreshRate() >= 0 && pPresentationParameters->FullScreen_RefreshRateInHz != 0)
|
||||
if ((s32)config.GetOptionsFullScreenRefreshRate() >= 0 && pPresentationParameters->FullScreen_RefreshRateInHz != 0)
|
||||
{
|
||||
PrintLog("Changing refresh rate from %u to %u", pPresentationParameters->FullScreen_RefreshRateInHz, config.GetFullScreenRefreshRate());
|
||||
pPresentationParameters->FullScreen_RefreshRateInHz = config.GetFullScreenRefreshRate();
|
||||
spdlog::info("Changing refresh rate from {} to {}", pPresentationParameters->FullScreen_RefreshRateInHz, config.GetOptionsFullScreenRefreshRate());
|
||||
pPresentationParameters->FullScreen_RefreshRateInHz = config.GetOptionsFullScreenRefreshRate();
|
||||
}
|
||||
|
||||
if (config.GetMultisample() > 0)
|
||||
if (config.GetOptionsMultisample() > 0)
|
||||
{
|
||||
pPresentationParameters->SwapEffect = D3DSWAPEFFECT_DISCARD;
|
||||
pPresentationParameters->MultiSampleType = (D3DMULTISAMPLE_TYPE)config.GetMultisample();
|
||||
pPresentationParameters->MultiSampleType = (D3DMULTISAMPLE_TYPE)config.GetOptionsMultisample();
|
||||
pPresentationParameters->MultiSampleQuality = 0;
|
||||
|
||||
PrintLog("MultiSampleType %u, MultiSampleQuality %u", pPresentationParameters->MultiSampleType, pPresentationParameters->MultiSampleQuality);
|
||||
spdlog::info("MultiSampleType {}, MultiSampleQuality {}", pPresentationParameters->MultiSampleType, pPresentationParameters->MultiSampleQuality);
|
||||
}
|
||||
|
||||
if (config.GetPresentationInterval() != -1)
|
||||
if (config.GetOptionsPresentationInterval() != 0)
|
||||
{
|
||||
pPresentationParameters->PresentationInterval = config.GetPresentationInterval();
|
||||
PrintLog("PresentationInterval: PresentationInterval set to %u", pPresentationParameters->PresentationInterval);
|
||||
if (config.GetOptionsPresentationInterval() == -1)
|
||||
pPresentationParameters->PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE;
|
||||
else if (config.GetOptionsPresentationInterval() > 0)
|
||||
pPresentationParameters->PresentationInterval = D3DPRESENT_INTERVAL_ONE;
|
||||
|
||||
spdlog::info("PresentationInterval: PresentationInterval set to {:X}", pPresentationParameters->PresentationInterval);
|
||||
}
|
||||
|
||||
if ((s32)config.GetSwapEffect() != -1)
|
||||
if (config.GetOptionsSwapEffect() != -1)
|
||||
{
|
||||
pPresentationParameters->SwapEffect = (D3DSWAPEFFECT)config.GetSwapEffect();
|
||||
PrintLog("SwapEffect: SwapEffect set to %u", pPresentationParameters->SwapEffect);
|
||||
pPresentationParameters->SwapEffect = (D3DSWAPEFFECT)config.GetOptionsSwapEffect();
|
||||
spdlog::info("SwapEffect: SwapEffect set to {}", pPresentationParameters->SwapEffect);
|
||||
}
|
||||
|
||||
if (config.GetBorderless())
|
||||
if (config.GetBorderlessBorderless())
|
||||
{
|
||||
int cx = GetSystemMetrics(SM_CXSCREEN);
|
||||
int cy = GetSystemMetrics(SM_CYSCREEN);
|
||||
|
||||
SetWindowPos(pPresentationParameters->hDeviceWindow, HWND_TOP, 0, 0, cx, cy, SWP_SHOWWINDOW | SWP_NOCOPYBITS | SWP_NOSENDCHANGING);
|
||||
|
||||
if (config.GetForceWindowedMode())
|
||||
if (config.GetBorderlessForceWindowedMode())
|
||||
{
|
||||
pPresentationParameters->SwapEffect = pPresentationParameters->MultiSampleType == D3DMULTISAMPLE_NONE ? D3DSWAPEFFECT_DISCARD : D3DSWAPEFFECT_FLIP;
|
||||
pPresentationParameters->Windowed = TRUE;
|
||||
pPresentationParameters->FullScreen_RefreshRateInHz = 0;
|
||||
PrintLog("ForceWindowedMode");
|
||||
|
||||
spdlog::info("ForceWindowedMode");
|
||||
}
|
||||
}
|
||||
|
||||
if (config.GetHideCursor()) while (::ShowCursor(FALSE) >= 0); // ShowCursor < 0 -> hidden
|
||||
if (config.GetOptionsHideCursor()) while (::ShowCursor(FALSE) >= 0); // ShowCursor < 0 -> hidden
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -189,34 +225,19 @@ bool MainContext::CheckWindow(HWND hWnd)
|
|||
GetClassNameW(hWnd, className.get(), MAX_PATH);
|
||||
GetWindowTextW(hWnd, windowName.get(), MAX_PATH);
|
||||
|
||||
PrintLog("HWND 0x%p: ClassName \"%ls\", WindowName: \"%ls\"", hWnd, className.get(), windowName.get());
|
||||
spdlog::info(L"HWND {}: ClassName \"{}\", WindowName: \"{}\"", (void*)hWnd, className.get(), windowName.get());
|
||||
|
||||
if (!context.didOneTimeFixes) {
|
||||
if (context.autofix == FINAL_FANTASY_XIII && wcscmp(className.get(), L"SQEX.CDev.Engine.Framework.MainWindow") == 0) {
|
||||
const std::lock_guard<std::mutex> lock(context.oneTimeFixesMutex);
|
||||
if(!context.didOneTimeFixes && patchingThread == NULL){
|
||||
PrintLog("Starting FFXIII one time RAM patches.");
|
||||
patchingThread = new std::thread(&context.FF13_AsyncPatching);
|
||||
}
|
||||
}
|
||||
else if (context.autofix == FINAL_FANTASY_XIII2 && wcscmp(className.get(), L"SQEX.CDev.Engine.Framework.MainWindow") == 0) {
|
||||
const std::lock_guard<std::mutex> lock(context.oneTimeFixesMutex);
|
||||
if (!context.didOneTimeFixes && patchingThread == NULL) {
|
||||
PrintLog("Starting FFXIII-2 one time RAM patches.");
|
||||
patchingThread = new std::thread(&context.FF13_2_AsyncPatching);
|
||||
}
|
||||
}
|
||||
}
|
||||
bool class_found = config.GetWindowClass().compare(className.get()) == 0;
|
||||
bool window_found = config.GetWindowName().compare(windowName.get()) == 0;
|
||||
bool force = config.GetAllWindows();
|
||||
bool class_found = config.GetWindowWindowClass().compare(className.get()) == 0;
|
||||
bool window_found = config.GetWindowWindowName().compare(windowName.get()) == 0;
|
||||
bool force = config.GetBorderlessAllWindows();
|
||||
bool ff13fix = OneTimeFixInit(className, hWnd);
|
||||
|
||||
return class_found || window_found || force;
|
||||
return class_found || window_found || force || ff13fix;
|
||||
}
|
||||
|
||||
void MainContext::ApplyWndProc(HWND hWnd)
|
||||
void MainContext::ApplyWindow(HWND hWnd)
|
||||
{
|
||||
if (config.GetAlwaysActive() || config.GetHideCursor())
|
||||
if (config.GetOptionsAlwaysActive() || config.GetOptionsHideCursor())
|
||||
{
|
||||
context.oldWndProc = (WNDPROC)context.TrueSetWindowLongA(hWnd, GWLP_WNDPROC, (LONG_PTR)context.WindowProc);
|
||||
}
|
||||
|
@ -224,7 +245,7 @@ void MainContext::ApplyWndProc(HWND hWnd)
|
|||
|
||||
void MainContext::ApplyBorderless(HWND hWnd)
|
||||
{
|
||||
if (config.GetBorderless())
|
||||
if (config.GetBorderlessBorderless())
|
||||
{
|
||||
LONG_PTR dwStyle = GetWindowLongPtr(hWnd, GWL_STYLE);
|
||||
LONG_PTR dwExStyle = GetWindowLongPtr(hWnd, GWL_EXSTYLE);
|
||||
|
@ -238,12 +259,16 @@ void MainContext::ApplyBorderless(HWND hWnd)
|
|||
int cx = GetSystemMetrics(SM_CXSCREEN);
|
||||
int cy = GetSystemMetrics(SM_CYSCREEN);
|
||||
|
||||
SetWindowPos(hWnd, HWND_TOP, 0, 0, cx, cy, SWP_SHOWWINDOW | SWP_NOCOPYBITS | SWP_NOSENDCHANGING);
|
||||
HWND insertAfter = HWND_TOP;
|
||||
|
||||
if (config.GetWindowTopMost())
|
||||
insertAfter = HWND_TOPMOST;
|
||||
|
||||
SetWindowPos(hWnd, insertAfter, 0, 0, cx, cy, SWP_SHOWWINDOW | SWP_NOCOPYBITS | SWP_NOSENDCHANGING);
|
||||
SetFocus(hWnd);
|
||||
|
||||
PrintLog("HWND 0x%p: Borderless dwStyle: %lX->%lX", hWnd, dwStyle, new_dwStyle);
|
||||
PrintLog("HWND 0x%p: Borderless dwExStyle: %lX->%lX", hWnd, dwExStyle, new_dwExStyle);
|
||||
MessageBeep(MB_ICONASTERISK);
|
||||
spdlog::info("HWND {:X}: Borderless dwStyle: {:X}->{:X}", (void*)hWnd, dwStyle, new_dwStyle);
|
||||
spdlog::info("HWND {:X}: Borderless dwExStyle: {:X}->{:X}", (void*)hWnd, dwExStyle, new_dwExStyle);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -261,21 +286,20 @@ LRESULT CALLBACK MainContext::WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LP
|
|||
break;
|
||||
|
||||
case WA_INACTIVE:
|
||||
if (context.config.GetAlwaysActive())
|
||||
if (context.config.GetOptionsAlwaysActive())
|
||||
return TRUE;
|
||||
|
||||
if (!context.config.GetForceHideCursor())
|
||||
if (!context.config.GetOptionsForceHideCursor())
|
||||
while (::ShowCursor(TRUE) < 0);
|
||||
break;
|
||||
}
|
||||
|
||||
case WM_ACTIVATEAPP:
|
||||
if (context.config.GetAlwaysActive())
|
||||
if (context.config.GetOptionsAlwaysActive())
|
||||
return TRUE;
|
||||
|
||||
}
|
||||
|
||||
if (context.config.GetForceHideCursor())
|
||||
if (context.config.GetOptionsForceHideCursor())
|
||||
while (::ShowCursor(FALSE) >= 0);
|
||||
|
||||
return CallWindowProc(context.oldWndProc, hWnd, uMsg, wParam, lParam);
|
||||
|
@ -283,19 +307,19 @@ LRESULT CALLBACK MainContext::WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LP
|
|||
|
||||
LONG WINAPI MainContext::HookSetWindowLongA(HWND hWnd, int nIndex, LONG dwNewLong)
|
||||
{
|
||||
if (context.config.GetBorderless())
|
||||
if (context.config.GetBorderlessBorderless())
|
||||
{
|
||||
DWORD olddwNewLong = dwNewLong;
|
||||
if (nIndex == GWL_STYLE)
|
||||
{
|
||||
dwNewLong &= ~WS_OVERLAPPEDWINDOW;
|
||||
PrintLog("SetWindowLongA dwStyle: %lX->%lX", olddwNewLong, dwNewLong);
|
||||
spdlog::info("SetWindowLongA dwStyle: {:X}->{:X}", olddwNewLong, dwNewLong);
|
||||
}
|
||||
|
||||
if (nIndex == GWL_EXSTYLE)
|
||||
{
|
||||
dwNewLong &= ~(WS_EX_OVERLAPPEDWINDOW);
|
||||
PrintLog("SetWindowLongA dwExStyle: %lX->%lX", olddwNewLong, dwNewLong);
|
||||
spdlog::info("SetWindowLongA dwExStyle: {:X}->{:X}", olddwNewLong, dwNewLong);
|
||||
}
|
||||
}
|
||||
return context.TrueSetWindowLongA(hWnd, nIndex, dwNewLong);
|
||||
|
@ -303,19 +327,19 @@ LONG WINAPI MainContext::HookSetWindowLongA(HWND hWnd, int nIndex, LONG dwNewLon
|
|||
|
||||
LONG WINAPI MainContext::HookSetWindowLongW(HWND hWnd, int nIndex, LONG dwNewLong)
|
||||
{
|
||||
if (context.config.GetBorderless())
|
||||
if (context.config.GetBorderlessBorderless())
|
||||
{
|
||||
DWORD olddwNewLong = dwNewLong;
|
||||
if (nIndex == GWL_STYLE)
|
||||
{
|
||||
dwNewLong &= ~WS_OVERLAPPEDWINDOW;
|
||||
PrintLog("SetWindowLongW dwStyle: %lX->%lX", olddwNewLong, dwNewLong);
|
||||
spdlog::info("SetWindowLongW dwStyle: {:X}->{:X}", olddwNewLong, dwNewLong);
|
||||
}
|
||||
|
||||
if (nIndex == GWL_EXSTYLE)
|
||||
{
|
||||
dwNewLong &= ~(WS_EX_OVERLAPPEDWINDOW);
|
||||
PrintLog("SetWindowLongW dwExStyle: %lX->%lX", olddwNewLong, dwNewLong);
|
||||
spdlog::info("SetWindowLongW dwExStyle: {:X}->{:X}", olddwNewLong, dwNewLong);
|
||||
}
|
||||
}
|
||||
return context.TrueSetWindowLongW(hWnd, nIndex, dwNewLong);
|
||||
|
@ -326,13 +350,13 @@ HWND WINAPI MainContext::HookCreateWindowExA(DWORD dwExStyle, LPCSTR lpClassName
|
|||
HWND hWnd = context.TrueCreateWindowExA(dwExStyle, lpClassName, lpWindowName, dwStyle, X, Y, nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam);
|
||||
if (!hWnd)
|
||||
{
|
||||
PrintLog("CreateWindowExA failed");
|
||||
spdlog::info("CreateWindowExA failed");
|
||||
return hWnd;
|
||||
}
|
||||
|
||||
if (context.CheckWindow(hWnd))
|
||||
{
|
||||
context.ApplyWndProc(hWnd);
|
||||
context.ApplyWindow(hWnd);
|
||||
context.ApplyBorderless(hWnd);
|
||||
}
|
||||
|
||||
|
@ -344,15 +368,17 @@ HWND WINAPI MainContext::HookCreateWindowExW(DWORD dwExStyle, LPCWSTR lpClassNam
|
|||
HWND hWnd = context.TrueCreateWindowExW(dwExStyle, lpClassName, lpWindowName, dwStyle, X, Y, nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam);
|
||||
if (!hWnd)
|
||||
{
|
||||
PrintLog("CreateWindowExW failed");
|
||||
spdlog::info("CreateWindowExW failed");
|
||||
return hWnd;
|
||||
}
|
||||
|
||||
if (context.CheckWindow(hWnd))
|
||||
{
|
||||
context.ApplyWndProc(hWnd);
|
||||
context.ApplyWindow(hWnd);
|
||||
context.ApplyBorderless(hWnd);
|
||||
}
|
||||
|
||||
return hWnd;
|
||||
}
|
||||
|
||||
bool MainContext::IsDXVK() { return D3D9DLL::Get().IsDXVK(); }
|
316
d3d9ex/Context.h
316
d3d9ex/Context.h
|
@ -1,151 +1,189 @@
|
|||
#pragma once
|
||||
|
||||
#include <array>
|
||||
#include "d3d9.h"
|
||||
#include <MinHook.h>
|
||||
#include "SimpleIni.h"
|
||||
#include "XInputManager.h"
|
||||
|
||||
struct hkIDirect3D9;
|
||||
|
||||
static const char* inifilename = "FF13Fix.ini";
|
||||
#define CONFIG_VERSION 4
|
||||
|
||||
class Config
|
||||
{
|
||||
public:
|
||||
Config(const Config&) = delete;
|
||||
const Config& operator=(Config& other) = delete;
|
||||
|
||||
Config();
|
||||
|
||||
#define SETTING(_type, _func, _var, _section, _defaultval) \
|
||||
private: _type _var; \
|
||||
public: const _type& Get##_var() const { return _var; };
|
||||
#include "Settings.h"
|
||||
#undef SETTING
|
||||
};
|
||||
|
||||
#define DECLARE_HOOK(type, callconv, name, ...) \
|
||||
public: type(callconv* True##name)(__VA_ARGS__) = name; \
|
||||
private: static type callconv Hook##name(__VA_ARGS__);
|
||||
|
||||
class MainContext
|
||||
{
|
||||
MainContext(const MainContext&) = delete;
|
||||
const MainContext& operator=(MainContext& other) = delete;
|
||||
|
||||
DECLARE_HOOK(IDirect3D9*, WINAPI, Direct3DCreate9, UINT SDKVersion);
|
||||
DECLARE_HOOK(LONG, WINAPI, SetWindowLongA, HWND hWnd, int nIndex, LONG dwNewLong);
|
||||
DECLARE_HOOK(LONG, WINAPI, SetWindowLongW, HWND hWnd, int nIndex, LONG dwNewLong);
|
||||
DECLARE_HOOK(HWND, WINAPI, CreateWindowExA, DWORD dwExStyle, LPCSTR lpClassName, LPCSTR lpWindowName,
|
||||
DWORD dwStyle, int X, int Y, int nWidth, int nHeight, HWND hWndParent, HMENU hMenu, HINSTANCE hInstance, LPVOID lpParam);
|
||||
DECLARE_HOOK(HWND, WINAPI, CreateWindowExW, DWORD dwExStyle, LPCWSTR lpClassName, LPCWSTR lpWindowName,
|
||||
DWORD dwStyle, int X, int Y, int nWidth, int nHeight, HWND hWndParent, HMENU hMenu, HINSTANCE hInstance, LPVOID lpParam);
|
||||
|
||||
public:
|
||||
#pragma once
|
||||
|
||||
#include <atomic>
|
||||
#include <d3d9.h>
|
||||
|
||||
#include "spdlog/spdlog.h"
|
||||
#include "spdlog/sinks/basic_file_sink.h"
|
||||
|
||||
#include "WinUtil.h"
|
||||
|
||||
#include "Types.h"
|
||||
#include "XInputManager.h"
|
||||
|
||||
static const char* inifilename = "FF13Fix.ini";
|
||||
#define CONFIG_VERSION 7
|
||||
|
||||
class Config
|
||||
{
|
||||
public:
|
||||
Config(const Config&) = delete;
|
||||
const Config& operator=(Config& other) = delete;
|
||||
|
||||
Config();
|
||||
|
||||
#define SETTING(_type, _func, _var, _section, _defaultval, _comment) \
|
||||
private: _type _var; \
|
||||
public: const _type& Get##_section##_var() const { return _var; };
|
||||
#include "Settings.h"
|
||||
#undef SETTING
|
||||
};
|
||||
|
||||
#define DECLARE_HOOK(type, callconv, name, ...) \
|
||||
public: type(callconv* True##name)(__VA_ARGS__) = name; \
|
||||
private: static type callconv Hook##name(__VA_ARGS__);
|
||||
|
||||
class MainContext
|
||||
{
|
||||
MainContext(const MainContext&) = delete;
|
||||
const MainContext& operator=(MainContext& other) = delete;
|
||||
|
||||
DECLARE_HOOK(IDirect3D9*, WINAPI, Direct3DCreate9, UINT SDKVersion);
|
||||
DECLARE_HOOK(HRESULT, WINAPI, Direct3DCreate9Ex, UINT SDKVersion, IDirect3D9Ex** ppIDirect3D9Ex);
|
||||
DECLARE_HOOK(LONG, WINAPI, SetWindowLongA, HWND hWnd, int nIndex, LONG dwNewLong);
|
||||
DECLARE_HOOK(LONG, WINAPI, SetWindowLongW, HWND hWnd, int nIndex, LONG dwNewLong);
|
||||
DECLARE_HOOK(HWND, WINAPI, CreateWindowExA, DWORD dwExStyle, LPCSTR lpClassName, LPCSTR lpWindowName,
|
||||
DWORD dwStyle, int X, int Y, int nWidth, int nHeight, HWND hWndParent, HMENU hMenu, HINSTANCE hInstance, LPVOID lpParam);
|
||||
DECLARE_HOOK(HWND, WINAPI, CreateWindowExW, DWORD dwExStyle, LPCWSTR lpClassName, LPCWSTR lpWindowName,
|
||||
DWORD dwStyle, int X, int Y, int nWidth, int nHeight, HWND hWndParent, HMENU hMenu, HINSTANCE hInstance, LPVOID lpParam);
|
||||
|
||||
DECLARE_HOOK(HANDLE, WINAPI, CreateFileA, LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile);
|
||||
DECLARE_HOOK(HANDLE, WINAPI, CreateFileW, LPCWSTR lpFileName,DWORD dwDesiredAccess,DWORD dwShareMode,LPSECURITY_ATTRIBUTES lpSecurityAttributes,DWORD dwCreationDisposition,DWORD dwFlagsAndAttributes,HANDLE hTemplateFile);
|
||||
public:
|
||||
MainContext();
|
||||
~MainContext();
|
||||
|
||||
bool ApplyPresentationParameters(D3DPRESENT_PARAMETERS* pPresentationParameters);
|
||||
bool ApplyBehaviorFlagsFix(DWORD* flags);
|
||||
void ScaleScissorRect(RECT * rect);
|
||||
HRESULT APIENTRY ApplyVertexBufferFix(IDirect3DDevice9* pIDirect3DDevice9, UINT Length, DWORD Usage, DWORD FVF, D3DPOOL Pool, IDirect3DVertexBuffer9** ppVertexBuffer, HANDLE* pSharedHandle);
|
||||
bool BehaviorFlagsToString(DWORD BehaviorFlags, std::string* BehaviorFlagsString);
|
||||
|
||||
bool CheckWindow(HWND hWnd);
|
||||
|
||||
void ApplyWndProc(HWND hWnd);
|
||||
void ApplyBorderless(HWND hWnd);
|
||||
|
||||
Config config;
|
||||
|
||||
private:
|
||||
enum AutoFixes : u32
|
||||
{
|
||||
NONE = 0,
|
||||
RESIDENT_EVIL_4,
|
||||
KINGS_BOUNTY_LEGEND,
|
||||
FINAL_FANTASY_XIII,
|
||||
FINAL_FANTASY_XIII2,
|
||||
};
|
||||
|
||||
void EnableAutoFix();
|
||||
|
||||
AutoFixes autofix = AutoFixes::NONE;
|
||||
|
||||
std::mutex oneTimeFixesMutex;
|
||||
bool didOneTimeFixes = false;
|
||||
|
||||
const float MAX_FRAME_RATE_LIMIT = 250000.0F;
|
||||
float** ff13_frame_pacer_ptr = NULL;
|
||||
uint8_t* ff13_set_framerate_ingame_instruction_address = NULL;
|
||||
uint8_t* ff13_continuous_scan_instruction_address = NULL;
|
||||
uint8_t* ff13_enemy_scan_box_code_address = NULL;
|
||||
uint8_t** ff13_base_controller_input_address_ptr = NULL;
|
||||
uint8_t* ff13_vibration_high_set_zero_address = NULL;
|
||||
uint8_t* ff13_vibration_low_set_zero_address = NULL;
|
||||
uint8_t* ff13_loading_screen_scissor_scaling_factor_1 = NULL;
|
||||
uint8_t* ff13_loading_screen_scissor_scaling_factor_2 = NULL;
|
||||
uint8_t* ff13_loading_screen_scissor_scaling_factor_3 = NULL;
|
||||
uint8_t* ff13_loading_screen_scissor_scaling_factor_4 = NULL;
|
||||
uint8_t* ff13_settings_screen_scissor_scaling_factor = NULL;
|
||||
uint8_t* ff13_party_screen_scissor_scaling_factor_1 = NULL;
|
||||
uint8_t* ff13_party_screen_scissor_scaling_factor_2 = NULL;
|
||||
uint8_t* ff13_party_screen_scissor_scaling_factor_3 = NULL;
|
||||
uint8_t* ff13_party_screen_scissor_scaling_factor_4 = NULL;
|
||||
uint32_t* ff13_internal_res_w;
|
||||
uint32_t* ff13_internal_res_h;
|
||||
|
||||
uint8_t* FF13_2_SET_FRAME_RATE_INJECTED_CODE = NULL;
|
||||
uint8_t* ff13_2_continuous_scan_instruction_address;
|
||||
virtual ~MainContext();
|
||||
|
||||
bool ApplyPresentationParameters(D3DPRESENT_PARAMETERS* pPresentationParameters);
|
||||
void ApplyBehaviorFlagsFix(DWORD* flags);
|
||||
HRESULT SetScissorRect(IDirect3DDevice9* pIDirect3DDevice9, CONST RECT* rect);
|
||||
HRESULT CreateVertexBuffer(IDirect3DDevice9* pIDirect3DDevice9, UINT Length, DWORD Usage, DWORD FVF, D3DPOOL Pool, IDirect3DVertexBuffer9** ppVertexBuffer, HANDLE* pSharedHandle);
|
||||
HRESULT DrawPrimitiveUP(IDirect3DDevice9* pIDirect3DDevice9, D3DPRIMITIVETYPE PrimitiveType, UINT PrimitiveCount, CONST void* pVertexStreamZeroData, UINT VertexStreamZeroStride);
|
||||
bool BehaviorFlagsToString(DWORD BehaviorFlags, std::string* BehaviorFlagsString);
|
||||
|
||||
bool CheckWindow(HWND hWnd);
|
||||
|
||||
void ApplyWindow(HWND hWnd);
|
||||
void ApplyBorderless(HWND hWnd);
|
||||
|
||||
Config config;
|
||||
|
||||
void OneTimeFix();
|
||||
bool IsDXVK();
|
||||
|
||||
private:
|
||||
enum class AutoFixes : u32
|
||||
{
|
||||
NONE = 0,
|
||||
FINAL_FANTASY_XIII,
|
||||
FINAL_FANTASY_XIII2,
|
||||
};
|
||||
|
||||
void EnableAutoFix();
|
||||
|
||||
AutoFixes autofix = AutoFixes::NONE;
|
||||
HWND hWndFF13 = 0;
|
||||
|
||||
std::mutex fix_mutex;
|
||||
|
||||
//MainContext is global!
|
||||
//TODO this class is cluttered, separate fixes class from MainContext
|
||||
|
||||
const float MAX_FRAME_RATE_LIMIT = 250000.0F;
|
||||
float** ff13_frame_pacer_ptr = NULL;
|
||||
uint8_t* ff13_set_framerate_ingame_instruction_address = NULL;
|
||||
uint8_t* ff13_continuous_scan_instruction_address = NULL;
|
||||
uint8_t* ff13_enemy_scan_box_code_address = NULL;
|
||||
uint8_t** ff13_base_controller_input_address_ptr = NULL;
|
||||
uint8_t* ff13_vibration_high_set_zero_address = NULL;
|
||||
uint8_t* ff13_vibration_low_set_zero_address = NULL;
|
||||
uint8_t* ff13_loading_screen_scissor_scaling_factor_1 = NULL;
|
||||
uint8_t* ff13_loading_screen_scissor_scaling_factor_2 = NULL;
|
||||
uint8_t* ff13_loading_screen_scissor_scaling_factor_3 = NULL;
|
||||
uint8_t* ff13_loading_screen_scissor_scaling_factor_4 = NULL;
|
||||
uint8_t* ff13_settings_screen_scissor_scaling_factor = NULL;
|
||||
uint8_t* ff13_party_screen_scissor_scaling_factor_1 = NULL;
|
||||
uint8_t* ff13_party_screen_scissor_scaling_factor_2 = NULL;
|
||||
uint8_t* ff13_party_screen_scissor_scaling_factor_3 = NULL;
|
||||
uint8_t* ff13_party_screen_scissor_scaling_factor_4 = NULL;
|
||||
uint8_t* ff13_message_box_stack_push_address = NULL;
|
||||
uint8_t* ff13_message_box_call_address = NULL;
|
||||
uint8_t* ff13_exe_large_address_aware_flag_address = NULL;
|
||||
uint32_t* ff13_exe_checksum_address = NULL;
|
||||
uint32_t* ff13_internal_res_w;
|
||||
uint32_t* ff13_internal_res_h;
|
||||
|
||||
uint8_t* FF13_2_SET_FRAME_RATE_INJECTED_CODE = NULL;
|
||||
uint8_t* ff13_2_continuous_scan_instruction_address;
|
||||
uint8_t* ff13_2_set_frame_rate_address;
|
||||
float** ff13_2_frame_pacer_ptr_address;
|
||||
float ff13_2_targetFrameRate;
|
||||
uint8_t** ff13_2_base_controller_input_address_ptr = NULL;
|
||||
uint8_t* ff13_2_vibration_high_set_zero_address = NULL;
|
||||
uint8_t* ff13_2_vibration_high_set_zero_address = NULL;
|
||||
uint8_t* ff13_2_vibration_low_set_zero_address = NULL;
|
||||
uint32_t* ff13_2_internal_res_w;
|
||||
uint8_t* ff13_2_message_box_stack_push_address = NULL;
|
||||
uint8_t* ff13_2_message_box_call_address = NULL;
|
||||
uint32_t* ff13_2_internal_res_w;
|
||||
uint32_t* ff13_2_internal_res_h;
|
||||
|
||||
const float FF13_2_30_FPS = 30.0F;
|
||||
const float FF13_2_MAX_FRAME_CAP = 1000.0F;
|
||||
|
||||
float scissor_scaling_factor_w = 1.0f;
|
||||
float scissor_scaling_factor_h = 1.0f;
|
||||
|
||||
XInputManager* xinputManager;
|
||||
std::thread * patchingThread = NULL;
|
||||
|
||||
void FixBehaviorFlagConflict(const DWORD flags_in, DWORD* flags_out);
|
||||
static const std::map<const AutoFixes, const uint32_t> behaviorflags_fixes;
|
||||
|
||||
static LRESULT CALLBACK WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
|
||||
WNDPROC oldWndProc;
|
||||
|
||||
void ChangeMemoryProtectionToReadWriteExecute(void* address, const int size);
|
||||
bool AreAlmostTheSame(float a, float b);
|
||||
void PrintVersionInfo();
|
||||
|
||||
|
||||
static void FF13_AsyncPatching();
|
||||
void FF13_InitializeGameAddresses();
|
||||
void FF13_OneTimeFixes();
|
||||
void FF13_Workaround_1440_Res_Bug();
|
||||
void FF13_EnableControllerVibration();
|
||||
void FF13_NOPIngameFrameRateLimitSetter();
|
||||
void FF13_SetFrameRateVariables();
|
||||
void FF13_FixScissorRect();
|
||||
void FF13_RemoveContinuousControllerScan();
|
||||
|
||||
static void FF13_2_AsyncPatching();
|
||||
float expectedDrawPrimitiveUpVertexData[5 * 4]
|
||||
{ -1.00f - 1.0f / 1280.0f, 1.00f + 1.0f / 720.0f, 0.0f, 0.0f, 0.0f,
|
||||
1.00f - 1.0f / 1280.0f, 1.00f + 1.0f / 720.0f, 0.0f, 1.0f, 0.0f,
|
||||
1.00f - 1.0f / 1280.0f, -1.00f + 1.0f / 720.0f, 0.0f, 1.0f, 1.0f,
|
||||
-1.00f - 1.0f / 1280.0f, -1.00f + 1.0f / 720.0f, 0.0f, 0.0f, 1.0f
|
||||
};
|
||||
|
||||
float fixedDrawPrimitiveUpVertexData[5 * 4]
|
||||
{ -1.00f, 1.00f, 0.0f, 0.0f, 0.0f,
|
||||
1.00f, 1.00f, 0.0f, 1.0f, 0.0f,
|
||||
1.00f, -1.00f, 0.0f, 1.0f, 1.0f,
|
||||
-1.00f, -1.00f, 0.0f, 0.0f, 1.0f
|
||||
};
|
||||
|
||||
const float FF13_2_30_FPS = 30.0F;
|
||||
const float FF13_2_MAX_FRAME_CAP = 1000.0F;
|
||||
|
||||
float scissor_scaling_factor_w = 1.0f;
|
||||
float scissor_scaling_factor_h = 1.0f;
|
||||
|
||||
XInputManager* xinputManager;
|
||||
|
||||
void FixBehaviorFlagConflict(const DWORD flags_in, DWORD* flags_out);
|
||||
static const std::map<const AutoFixes, const uint32_t> behaviorflags_add;
|
||||
static const std::map<const AutoFixes, const uint32_t> behaviorflags_sub;
|
||||
|
||||
static LRESULT CALLBACK WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
|
||||
WNDPROC oldWndProc = nullptr;
|
||||
|
||||
void PrintVersionInfo();
|
||||
|
||||
void FF13_InitializeGameAddresses();
|
||||
|
||||
void FF13_OneTimeFixes();
|
||||
void FF13_PatchMessageBox();
|
||||
void FF13_EnableControllerVibration();
|
||||
void FF13_NOPIngameFrameRateLimitSetter();
|
||||
void FF13_SetFrameRateVariables();
|
||||
void FF13_FixScissorRect();
|
||||
void FF13_RemoveContinuousControllerScan();
|
||||
void FF13_HandleLargeAddressAwarePatch();
|
||||
|
||||
void FF13_2_CreateSetFrameRateCodeBlock();
|
||||
void FF13_2_InitializeGameAddresses();
|
||||
void FF13_2_RemoveContinuousControllerScan();
|
||||
void FF13_2_AddHookIngameFrameRateLimitSetter();
|
||||
void FF13_2_AddHookIngameFrameRateLimitSetter();
|
||||
void FF13_2_OneTimeFixes();
|
||||
void FF13_2_Workaround_2560_1440_Res_Bug();
|
||||
void FF13_2_EnableControllerVibration();
|
||||
};
|
||||
|
||||
extern MainContext context;
|
||||
void FF13_2_PatchMessageBox();
|
||||
void FF13_2_EnableControllerVibration();
|
||||
|
||||
void AdjustVertexData(const uint32_t width, const uint32_t height);
|
||||
bool MatchesExpectedVertexStream(const float* pVertexStreamZeroData);
|
||||
void ForceWindowActivate(const HWND hWnd);
|
||||
void PatchMessageBoxCall(uint8_t* callInstructionAddress);
|
||||
|
||||
bool OneTimeFixInit(std::unique_ptr<wchar_t[]>& className, HWND hWnd);
|
||||
std::atomic_bool otf_init = false;
|
||||
|
||||
static void Fix_Thread();
|
||||
};
|
||||
|
||||
extern MainContext context;
|
||||
|
|
|
@ -1,156 +1,221 @@
|
|||
// wrapper for IDirect3D9 in d3d9.h
|
||||
// generated using wrapper_gen.rb
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
#include "Context.h"
|
||||
|
||||
#include "IDirect3D9.h"
|
||||
#include "IDirect3DDevice9.h"
|
||||
|
||||
#define IDirect3D9_PrintLog(format, ...) //PrintLog(format, __VA_ARGS__);
|
||||
|
||||
HRESULT APIENTRY hkIDirect3D9::QueryInterface(REFIID riid, void** ppvObj) {
|
||||
PrintLog(__FUNCTION__);
|
||||
if (ppvObj == nullptr) return E_POINTER;
|
||||
spdlog::info(__FUNCTION__);
|
||||
if (ppvObj == nullptr)
|
||||
return E_POINTER;
|
||||
|
||||
if (riid == __uuidof(IUnknown) ||
|
||||
riid == __uuidof(IDirect3D9))
|
||||
if (riid == __uuidof(this) ||
|
||||
riid == __uuidof(IUnknown) ||
|
||||
riid == __uuidof(IDirect3D9) ||
|
||||
riid == __uuidof(IDirect3D9Ex))
|
||||
{
|
||||
*ppvObj = static_cast<IDirect3D9*>(this);
|
||||
if (!m_is_ex && riid == __uuidof(IDirect3D9Ex))
|
||||
{
|
||||
//we are queried for IDirect3D9Ex but we hold IDirect3D9
|
||||
//upgrade wrapped interface, query it
|
||||
IDirect3D9Ex* pIDirect3D9Ex = nullptr;
|
||||
HRESULT hr = m_pWrapped->QueryInterface(riid, reinterpret_cast<void**>(&pIDirect3D9Ex));
|
||||
if (FAILED(hr))
|
||||
return hr;
|
||||
|
||||
// release one reference from old one and take new IDirect3DDevice9Ex pointer
|
||||
m_pWrapped->Release();
|
||||
m_pWrapped = pIDirect3D9Ex;
|
||||
m_is_ex = true;
|
||||
}
|
||||
|
||||
AddRef();
|
||||
*ppvObj = this;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
*ppvObj = nullptr;
|
||||
return E_NOINTERFACE;
|
||||
return m_pWrapped->QueryInterface(riid, ppvObj);
|
||||
}
|
||||
|
||||
ULONG APIENTRY hkIDirect3D9::AddRef() {
|
||||
PrintLog(__FUNCTION__);
|
||||
return _InterlockedIncrement(&m_refCount);
|
||||
ULONG STDMETHODCALLTYPE hkIDirect3D9::AddRef() {
|
||||
m_pWrapped->AddRef();
|
||||
return InterlockedIncrement(&m_ref);
|
||||
}
|
||||
|
||||
ULONG APIENTRY hkIDirect3D9::Release() {
|
||||
PrintLog(__FUNCTION__);
|
||||
const LONG ref = _InterlockedDecrement(&m_refCount);
|
||||
if (ref == 0)
|
||||
{
|
||||
delete this;
|
||||
ULONG STDMETHODCALLTYPE hkIDirect3D9::Release() {
|
||||
const ULONG ref = InterlockedDecrement(&m_ref);
|
||||
if (ref != 0) {
|
||||
m_pWrapped->Release();
|
||||
return ref;
|
||||
}
|
||||
return ref;
|
||||
const auto pWrapped = m_pWrapped;
|
||||
m_pWrapped = nullptr;
|
||||
delete this;
|
||||
|
||||
const ULONG ref_last = pWrapped->Release();
|
||||
if (ref_last != 0)
|
||||
spdlog::error("Reference count for IDirect3D9 is wrong: {} {} {}", (void*)this, ref, ref_last);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3D9::RegisterSoftwareDevice(void* pInitializeFunction) {
|
||||
IDirect3D9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->RegisterSoftwareDevice(pInitializeFunction);
|
||||
}
|
||||
|
||||
UINT APIENTRY hkIDirect3D9::GetAdapterCount() {
|
||||
IDirect3D9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->GetAdapterCount();
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3D9::GetAdapterIdentifier(UINT Adapter, DWORD Flags, D3DADAPTER_IDENTIFIER9* pIdentifier) {
|
||||
PrintLog(__FUNCTION__);
|
||||
spdlog::info(__FUNCTION__);
|
||||
HRESULT rt = m_pWrapped->GetAdapterIdentifier(Adapter, Flags, pIdentifier);
|
||||
if (context.config.GetAdapter() && SUCCEEDED(rt) && pIdentifier)
|
||||
if (context.config.GetAdapterAdapter() && SUCCEEDED(rt) && pIdentifier)
|
||||
{
|
||||
pIdentifier->VendorId = context.config.GetVendorId();
|
||||
pIdentifier->DeviceId = context.config.GetDeviceId();
|
||||
pIdentifier->VendorId = context.config.GetAdapterVendorId();
|
||||
pIdentifier->DeviceId = context.config.GetAdapterDeviceId();
|
||||
}
|
||||
|
||||
return rt;
|
||||
}
|
||||
|
||||
UINT APIENTRY hkIDirect3D9::GetAdapterModeCount(UINT Adapter, D3DFORMAT Format) {
|
||||
IDirect3D9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->GetAdapterModeCount(Adapter, Format);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3D9::EnumAdapterModes(UINT Adapter, D3DFORMAT Format, UINT Mode, D3DDISPLAYMODE* pMode) {
|
||||
IDirect3D9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->EnumAdapterModes(Adapter, Format, Mode, pMode);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3D9::GetAdapterDisplayMode(UINT Adapter, D3DDISPLAYMODE* pMode) {
|
||||
IDirect3D9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->GetAdapterDisplayMode(Adapter, pMode);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3D9::CheckDeviceType(UINT Adapter, D3DDEVTYPE DevType, D3DFORMAT AdapterFormat, D3DFORMAT BackBufferFormat, BOOL bWindowed) {
|
||||
IDirect3D9_PrintLog(__FUNCTION__);
|
||||
if (context.config.GetForceWindowedMode()) bWindowed = TRUE;
|
||||
spdlog::trace(__FUNCTION__);
|
||||
if (context.config.GetBorderlessForceWindowedMode()) bWindowed = TRUE;
|
||||
return m_pWrapped->CheckDeviceType(Adapter, DevType, AdapterFormat, BackBufferFormat, bWindowed);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3D9::CheckDeviceFormat(UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT AdapterFormat, DWORD Usage, D3DRESOURCETYPE RType, D3DFORMAT CheckFormat) {
|
||||
IDirect3D9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->CheckDeviceFormat(Adapter, DeviceType, AdapterFormat, Usage, RType, CheckFormat);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3D9::CheckDeviceMultiSampleType(UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT SurfaceFormat, BOOL Windowed, D3DMULTISAMPLE_TYPE MultiSampleType, DWORD* pQualityLevels) {
|
||||
IDirect3D9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->CheckDeviceMultiSampleType(Adapter, DeviceType, SurfaceFormat, Windowed, MultiSampleType, pQualityLevels);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3D9::CheckDepthStencilMatch(UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT AdapterFormat, D3DFORMAT RenderTargetFormat, D3DFORMAT DepthStencilFormat) {
|
||||
IDirect3D9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->CheckDepthStencilMatch(Adapter, DeviceType, AdapterFormat, RenderTargetFormat, DepthStencilFormat);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3D9::CheckDeviceFormatConversion(UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT SourceFormat, D3DFORMAT TargetFormat) {
|
||||
IDirect3D9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->CheckDeviceFormatConversion(Adapter, DeviceType, SourceFormat, TargetFormat);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3D9::GetDeviceCaps(UINT Adapter, D3DDEVTYPE DeviceType, D3DCAPS9* pCaps) {
|
||||
IDirect3D9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->GetDeviceCaps(Adapter, DeviceType, pCaps);
|
||||
}
|
||||
|
||||
HMONITOR APIENTRY hkIDirect3D9::GetAdapterMonitor(UINT Adapter) {
|
||||
IDirect3D9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->GetAdapterMonitor(Adapter);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3D9::CreateDevice(UINT Adapter, D3DDEVTYPE DeviceType, HWND hFocusWindow, DWORD BehaviorFlags, D3DPRESENT_PARAMETERS* pPresentationParameters, IDirect3DDevice9** ppReturnedDeviceInterface) {
|
||||
PrintLog(__FUNCTION__);
|
||||
spdlog::info(__FUNCTION__);
|
||||
return ApplyCreateDeviceFix<IDirect3DDevice9, false>(Adapter, DeviceType, hFocusWindow, BehaviorFlags, pPresentationParameters, nullptr, ppReturnedDeviceInterface);
|
||||
}
|
||||
|
||||
UINT STDMETHODCALLTYPE hkIDirect3D9::GetAdapterModeCountEx(UINT Adapter, CONST D3DDISPLAYMODEFILTER* pFilter) {
|
||||
spdlog::trace(__FUNCTION__);
|
||||
|
||||
return static_cast<IDirect3D9Ex*>(m_pWrapped)->GetAdapterModeCountEx(Adapter, pFilter);
|
||||
}
|
||||
|
||||
HRESULT STDMETHODCALLTYPE hkIDirect3D9::EnumAdapterModesEx(UINT Adapter, CONST D3DDISPLAYMODEFILTER* pFilter, UINT Mode, D3DDISPLAYMODEEX* pMode) {
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return static_cast<IDirect3D9Ex*>(m_pWrapped)->EnumAdapterModesEx(Adapter, pFilter, Mode, pMode);
|
||||
}
|
||||
|
||||
HRESULT STDMETHODCALLTYPE hkIDirect3D9::GetAdapterDisplayModeEx(UINT Adapter, D3DDISPLAYMODEEX* pMode, D3DDISPLAYROTATION* pRotation) {
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return static_cast<IDirect3D9Ex*>(m_pWrapped)->GetAdapterDisplayModeEx(Adapter, pMode, pRotation);
|
||||
}
|
||||
|
||||
HRESULT STDMETHODCALLTYPE hkIDirect3D9::CreateDeviceEx(UINT Adapter, D3DDEVTYPE DeviceType, HWND hFocusWindow, DWORD BehaviorFlags, D3DPRESENT_PARAMETERS* pPresentationParameters, D3DDISPLAYMODEEX* pFullscreenDisplayMode, IDirect3DDevice9Ex** ppReturnedDeviceInterface) {
|
||||
spdlog::info(__FUNCTION__);
|
||||
return ApplyCreateDeviceFix<IDirect3DDevice9Ex, true>(Adapter, DeviceType, hFocusWindow, BehaviorFlags, pPresentationParameters, pFullscreenDisplayMode, ppReturnedDeviceInterface);
|
||||
}
|
||||
|
||||
HRESULT STDMETHODCALLTYPE hkIDirect3D9::GetAdapterLUID(UINT Adapter, LUID* pLUID) {
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return static_cast<IDirect3D9Ex*>(m_pWrapped)->GetAdapterLUID(Adapter, pLUID);
|
||||
}
|
||||
|
||||
//TODO move this to other file
|
||||
template <typename T, bool ex>
|
||||
HRESULT hkIDirect3D9::ApplyCreateDeviceFix(UINT Adapter, D3DDEVTYPE DeviceType, HWND hFocusWindow, DWORD BehaviorFlags, D3DPRESENT_PARAMETERS* pPresentationParameters, D3DDISPLAYMODEEX* pFullscreenDisplayMode, T** ppReturnedDeviceInterface)
|
||||
{
|
||||
spdlog::info(__FUNCTION__);
|
||||
|
||||
DWORD OriginalBehaviorFlags = BehaviorFlags;
|
||||
std::string BehaviorFlagsString;
|
||||
context.BehaviorFlagsToString(BehaviorFlags, &BehaviorFlagsString);
|
||||
|
||||
PrintLog("BehaviorFlags: %08X %s", BehaviorFlags, BehaviorFlagsString.c_str());
|
||||
spdlog::info("BehaviorFlags: {:#08x} {}", BehaviorFlags, BehaviorFlagsString);
|
||||
|
||||
if (context.config.GetBehaviorFlags() > 0)
|
||||
{
|
||||
BehaviorFlags = context.config.GetBehaviorFlags();
|
||||
PrintLog("Advanced Mode: BehaviorFlags set");
|
||||
if (context.config.GetOptionsBehaviorFlags() > 0) {
|
||||
BehaviorFlags = context.config.GetOptionsBehaviorFlags();
|
||||
spdlog::info("Advanced Mode: BehaviorFlags set");
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
context.ApplyBehaviorFlagsFix(&BehaviorFlags);
|
||||
}
|
||||
|
||||
if (hFocusWindow == NULL) hFocusWindow = pPresentationParameters->hDeviceWindow;
|
||||
if (hFocusWindow == NULL)
|
||||
hFocusWindow = pPresentationParameters->hDeviceWindow;
|
||||
|
||||
context.ApplyPresentationParameters(pPresentationParameters);
|
||||
|
||||
if (OriginalBehaviorFlags != BehaviorFlags)
|
||||
{
|
||||
if (OriginalBehaviorFlags != BehaviorFlags) {
|
||||
std::string BehaviorFlagsString;
|
||||
context.BehaviorFlagsToString(BehaviorFlags, &BehaviorFlagsString);
|
||||
PrintLog("BehaviorFlags changed: %08X %s", BehaviorFlags, BehaviorFlagsString.c_str());
|
||||
spdlog::info("BehaviorFlags changed: {:#08x} {}", BehaviorFlags, BehaviorFlagsString);
|
||||
}
|
||||
|
||||
IDirect3DDevice9* device = nullptr;
|
||||
HRESULT hr = m_pWrapped->CreateDevice(Adapter, DeviceType, hFocusWindow, BehaviorFlags, pPresentationParameters, &device);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
PrintLog("CreateDevice fail with HRESULT: %08X", hr);
|
||||
T* device = nullptr;
|
||||
HRESULT hr = S_FALSE;
|
||||
bool is_ex;
|
||||
|
||||
if (ex) {
|
||||
hr = m_pWrapped->CreateDeviceEx(Adapter, DeviceType, hFocusWindow, BehaviorFlags, pPresentationParameters, pFullscreenDisplayMode, reinterpret_cast<IDirect3DDevice9Ex**>(&device));
|
||||
is_ex = true;
|
||||
}
|
||||
else {
|
||||
hr = m_pWrapped->CreateDevice(Adapter, DeviceType, hFocusWindow, BehaviorFlags, pPresentationParameters, reinterpret_cast<IDirect3DDevice9**>(&device));
|
||||
is_ex = false;
|
||||
}
|
||||
|
||||
if (FAILED(hr)) {
|
||||
spdlog::info("CreateDevice fail with HRESULT: {:X}", hr);
|
||||
*ppReturnedDeviceInterface = nullptr;
|
||||
return hr;
|
||||
}
|
||||
|
||||
*ppReturnedDeviceInterface = new hkIDirect3DDevice9(device);
|
||||
else {
|
||||
*ppReturnedDeviceInterface = new hkIDirect3DDevice9(static_cast<IDirect3DDevice9Ex*>(device), is_ex);
|
||||
context.OneTimeFix();
|
||||
}
|
||||
|
||||
return hr;
|
||||
}
|
||||
}
|
|
@ -1,44 +1,52 @@
|
|||
// wrapper for IDirect3D9 in d3d9.h
|
||||
// generated using wrapper_gen.rb
|
||||
#pragma once
|
||||
#include <d3d9.h>
|
||||
|
||||
#include "d3d9.h"
|
||||
#include "IDirect3DDevice9.h"
|
||||
|
||||
interface hkIDirect3D9 final : public IDirect3D9 {
|
||||
interface DECLSPEC_UUID("16760376-B89E-4CD9-9CE1-5B1C7AFC2E16") hkIDirect3D9 final : public IDirect3D9Ex{
|
||||
public:
|
||||
// original interface
|
||||
STDMETHOD(QueryInterface)(REFIID riid, void** ppvObj);
|
||||
STDMETHOD_(ULONG, AddRef)();
|
||||
STDMETHOD_(ULONG, Release)();
|
||||
STDMETHOD(RegisterSoftwareDevice)(void* pInitializeFunction);
|
||||
STDMETHOD_(UINT, GetAdapterCount)();
|
||||
STDMETHOD(GetAdapterIdentifier)(UINT Adapter, DWORD Flags, D3DADAPTER_IDENTIFIER9* pIdentifier);
|
||||
STDMETHOD_(UINT, GetAdapterModeCount)(UINT Adapter, D3DFORMAT Format);
|
||||
STDMETHOD(EnumAdapterModes)(UINT Adapter, D3DFORMAT Format, UINT Mode, D3DDISPLAYMODE* pMode);
|
||||
STDMETHOD(GetAdapterDisplayMode)(UINT Adapter, D3DDISPLAYMODE* pMode);
|
||||
STDMETHOD(CheckDeviceType)(UINT Adapter, D3DDEVTYPE DevType, D3DFORMAT AdapterFormat, D3DFORMAT BackBufferFormat, BOOL bWindowed);
|
||||
STDMETHOD(CheckDeviceFormat)(UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT AdapterFormat, DWORD Usage, D3DRESOURCETYPE RType, D3DFORMAT CheckFormat);
|
||||
STDMETHOD(CheckDeviceMultiSampleType)(UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT SurfaceFormat, BOOL Windowed, D3DMULTISAMPLE_TYPE MultiSampleType, DWORD* pQualityLevels);
|
||||
STDMETHOD(CheckDepthStencilMatch)(UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT AdapterFormat, D3DFORMAT RenderTargetFormat, D3DFORMAT DepthStencilFormat);
|
||||
STDMETHOD(CheckDeviceFormatConversion)(UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT SourceFormat, D3DFORMAT TargetFormat);
|
||||
STDMETHOD(GetDeviceCaps)(UINT Adapter, D3DDEVTYPE DeviceType, D3DCAPS9* pCaps);
|
||||
STDMETHOD_(HMONITOR, GetAdapterMonitor)(UINT Adapter);
|
||||
STDMETHOD(CreateDevice)(UINT Adapter, D3DDEVTYPE DeviceType, HWND hFocusWindow, DWORD BehaviorFlags, D3DPRESENT_PARAMETERS* pPresentationParameters, IDirect3DDevice9** ppReturnedDeviceInterface);
|
||||
#pragma region IUnknown
|
||||
HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void** ppvObj);
|
||||
ULONG STDMETHODCALLTYPE AddRef();
|
||||
ULONG STDMETHODCALLTYPE Release();
|
||||
#pragma endregion
|
||||
#pragma region IDirect3D9
|
||||
HRESULT STDMETHODCALLTYPE RegisterSoftwareDevice(void* pInitializeFunction);
|
||||
UINT STDMETHODCALLTYPE GetAdapterCount();
|
||||
HRESULT STDMETHODCALLTYPE GetAdapterIdentifier(UINT Adapter, DWORD Flags, D3DADAPTER_IDENTIFIER9* pIdentifier);
|
||||
UINT STDMETHODCALLTYPE GetAdapterModeCount(UINT Adapter, D3DFORMAT Format);
|
||||
HRESULT STDMETHODCALLTYPE EnumAdapterModes(UINT Adapter, D3DFORMAT Format, UINT Mode, D3DDISPLAYMODE* pMode);
|
||||
HRESULT STDMETHODCALLTYPE GetAdapterDisplayMode(UINT Adapter, D3DDISPLAYMODE* pMode);
|
||||
HRESULT STDMETHODCALLTYPE CheckDeviceType(UINT Adapter, D3DDEVTYPE DevType, D3DFORMAT AdapterFormat, D3DFORMAT BackBufferFormat, BOOL bWindowed);
|
||||
HRESULT STDMETHODCALLTYPE CheckDeviceFormat(UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT AdapterFormat, DWORD Usage, D3DRESOURCETYPE RType, D3DFORMAT CheckFormat);
|
||||
HRESULT STDMETHODCALLTYPE CheckDeviceMultiSampleType(UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT SurfaceFormat, BOOL Windowed, D3DMULTISAMPLE_TYPE MultiSampleType, DWORD* pQualityLevels);
|
||||
HRESULT STDMETHODCALLTYPE CheckDepthStencilMatch(UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT AdapterFormat, D3DFORMAT RenderTargetFormat, D3DFORMAT DepthStencilFormat);
|
||||
HRESULT STDMETHODCALLTYPE CheckDeviceFormatConversion(UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT SourceFormat, D3DFORMAT TargetFormat);
|
||||
HRESULT STDMETHODCALLTYPE GetDeviceCaps(UINT Adapter, D3DDEVTYPE DeviceType, D3DCAPS9* pCaps);
|
||||
HMONITOR STDMETHODCALLTYPE GetAdapterMonitor(UINT Adapter);
|
||||
HRESULT STDMETHODCALLTYPE CreateDevice(UINT Adapter, D3DDEVTYPE DeviceType, HWND hFocusWindow, DWORD BehaviorFlags, D3DPRESENT_PARAMETERS* pPresentationParameters, IDirect3DDevice9** ppReturnedDeviceInterface);
|
||||
#pragma endregion
|
||||
#pragma region IDirect3D9Ex
|
||||
UINT STDMETHODCALLTYPE GetAdapterModeCountEx(UINT Adapter, const D3DDISPLAYMODEFILTER* pFilter);
|
||||
HRESULT STDMETHODCALLTYPE EnumAdapterModesEx(UINT Adapter, const D3DDISPLAYMODEFILTER* pFilter, UINT Mode, D3DDISPLAYMODEEX* pMode);
|
||||
HRESULT STDMETHODCALLTYPE GetAdapterDisplayModeEx(UINT Adapter, D3DDISPLAYMODEEX* pMode, D3DDISPLAYROTATION* pRotation);
|
||||
HRESULT STDMETHODCALLTYPE CreateDeviceEx(UINT Adapter, D3DDEVTYPE DeviceType, HWND hFocusWindow, DWORD BehaviorFlags, D3DPRESENT_PARAMETERS* pPresentationParameters, D3DDISPLAYMODEEX* pFullscreenDisplayMode, IDirect3DDevice9Ex** ppReturnedDeviceInterface);
|
||||
HRESULT STDMETHODCALLTYPE GetAdapterLUID(UINT Adapter, LUID* pLUID);
|
||||
#pragma endregion
|
||||
|
||||
public:
|
||||
hkIDirect3D9(IDirect3D9 *pIDirect3D9)
|
||||
hkIDirect3D9(IDirect3D9Ex* pIDirect3D9)
|
||||
: m_pWrapped(pIDirect3D9)
|
||||
{
|
||||
}
|
||||
|
||||
private:
|
||||
~hkIDirect3D9()
|
||||
{
|
||||
m_pWrapped->Release();
|
||||
}
|
||||
virtual ~hkIDirect3D9() { }
|
||||
|
||||
private:
|
||||
IDirect3D9Ex* m_pWrapped;
|
||||
ULONG m_ref = 1;
|
||||
bool m_is_ex = false;
|
||||
|
||||
template <typename T, bool ex>
|
||||
HRESULT ApplyCreateDeviceFix(UINT Adapter, D3DDEVTYPE DeviceType, HWND hFocusWindow, DWORD BehaviorFlags, D3DPRESENT_PARAMETERS* pPresentationParameters, D3DDISPLAYMODEEX* pFullscreenDisplayMode, T** ppReturnedDeviceInterface);
|
||||
|
||||
LONG m_refCount = 1;
|
||||
IDirect3D9 *m_pWrapped;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -1,645 +1,728 @@
|
|||
// wrapper for IDirect3DDevice9 in d3d9.h
|
||||
// generated using wrapper_gen.rb
|
||||
|
||||
#pragma once
|
||||
#include "stdafx.h"
|
||||
|
||||
#include "Context.h"
|
||||
|
||||
#include "IDirect3DDevice9.h"
|
||||
|
||||
#include <intrin.h>
|
||||
|
||||
#define IDirect3DDevice9_PrintLog(...) //PrintLog(format, __VA_ARGS__);
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::QueryInterface(REFIID riid, void** ppvObj) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
if (ppvObj == nullptr) return E_POINTER;
|
||||
|
||||
if (riid == __uuidof(IUnknown) ||
|
||||
riid == __uuidof(IDirect3DDevice9))
|
||||
if (riid == __uuidof(this) ||
|
||||
riid == __uuidof(IUnknown) ||
|
||||
riid == __uuidof(IDirect3DDevice9) ||
|
||||
riid == __uuidof(IDirect3DDevice9Ex))
|
||||
{
|
||||
*ppvObj = static_cast<IDirect3DDevice9*>(this);
|
||||
if (!m_is_ex && riid == __uuidof(IDirect3DDevice9Ex))
|
||||
{
|
||||
//we are queried for IDirect3DDevice9Ex but we hold IDirect3DDevice9
|
||||
//upgrade wrapped interface, query it
|
||||
IDirect3DDevice9Ex* pIDirect3DDevice9Ex = nullptr;
|
||||
HRESULT hr = m_pWrapped->QueryInterface(riid, reinterpret_cast<void**>(&pIDirect3DDevice9Ex));
|
||||
if (FAILED(hr))
|
||||
return hr;
|
||||
|
||||
// release one reference from old one and take new IDirect3DDevice9Ex pointer
|
||||
m_pWrapped->Release();
|
||||
m_pWrapped = pIDirect3DDevice9Ex;
|
||||
m_is_ex = true;
|
||||
}
|
||||
|
||||
AddRef();
|
||||
*ppvObj = this;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
*ppvObj = nullptr;
|
||||
return E_NOINTERFACE;
|
||||
return m_pWrapped->QueryInterface(riid, ppvObj);
|
||||
}
|
||||
|
||||
ULONG APIENTRY hkIDirect3DDevice9::AddRef() {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
return _InterlockedIncrement(&m_refCount);
|
||||
ULONG STDMETHODCALLTYPE hkIDirect3DDevice9::AddRef() {
|
||||
m_pWrapped->AddRef();
|
||||
return InterlockedIncrement(&m_ref);
|
||||
}
|
||||
|
||||
ULONG APIENTRY hkIDirect3DDevice9::Release() {
|
||||
const LONG ref = _InterlockedDecrement(&m_refCount);
|
||||
if (ref == 0)
|
||||
{
|
||||
delete this;
|
||||
ULONG STDMETHODCALLTYPE hkIDirect3DDevice9::Release() {
|
||||
const ULONG ref = InterlockedDecrement(&m_ref);
|
||||
if (ref != 0) {
|
||||
m_pWrapped->Release();
|
||||
return ref;
|
||||
}
|
||||
return ref;
|
||||
const auto pWrapped = m_pWrapped;
|
||||
m_pWrapped = nullptr;
|
||||
delete this;
|
||||
|
||||
const ULONG ref_last = pWrapped->Release();
|
||||
if (ref_last != 0) {
|
||||
spdlog::error("Reference count for IDirect3DDevice9 is wrong: {} {} {}", (void*)this, ref, ref_last);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::TestCooperativeLevel() {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->TestCooperativeLevel();
|
||||
}
|
||||
|
||||
UINT APIENTRY hkIDirect3DDevice9::GetAvailableTextureMem() {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->GetAvailableTextureMem();
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::EvictManagedResources() {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->EvictManagedResources();
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::GetDirect3D(IDirect3D9** ppD3D9) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->GetDirect3D(ppD3D9);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::GetDeviceCaps(D3DCAPS9* pCaps) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->GetDeviceCaps(pCaps);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::GetDisplayMode(UINT iSwapChain, D3DDISPLAYMODE* pMode) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->GetDisplayMode(iSwapChain, pMode);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::GetCreationParameters(D3DDEVICE_CREATION_PARAMETERS *pParameters) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::GetCreationParameters(D3DDEVICE_CREATION_PARAMETERS* pParameters) {
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->GetCreationParameters(pParameters);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::SetCursorProperties(UINT XHotSpot, UINT YHotSpot, IDirect3DSurface9* pCursorBitmap) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->SetCursorProperties(XHotSpot, YHotSpot, pCursorBitmap);
|
||||
}
|
||||
|
||||
void APIENTRY hkIDirect3DDevice9::SetCursorPosition(int X, int Y, DWORD Flags) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->SetCursorPosition(X, Y, Flags);
|
||||
}
|
||||
|
||||
BOOL APIENTRY hkIDirect3DDevice9::ShowCursor(BOOL bShow) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->ShowCursor(bShow);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::CreateAdditionalSwapChain(D3DPRESENT_PARAMETERS* pPresentationParameters, IDirect3DSwapChain9** pSwapChain) {
|
||||
PrintLog(__FUNCTION__);
|
||||
spdlog::info(__FUNCTION__);
|
||||
context.ApplyPresentationParameters(pPresentationParameters);
|
||||
return m_pWrapped->CreateAdditionalSwapChain(pPresentationParameters, pSwapChain);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::GetSwapChain(UINT iSwapChain, IDirect3DSwapChain9** pSwapChain) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
|
||||
// Steam Overlay Fix
|
||||
// Add some space, 16bytes should be enough
|
||||
__nop();
|
||||
__nop();
|
||||
__nop();
|
||||
__nop();
|
||||
__nop();
|
||||
__nop();
|
||||
__nop();
|
||||
__nop();
|
||||
__nop();
|
||||
__nop();
|
||||
__nop();
|
||||
__nop();
|
||||
__nop();
|
||||
__nop();
|
||||
__nop();
|
||||
__nop();
|
||||
// Steam Overlay crash fix
|
||||
// Add some space, 16bytes should be more than enough
|
||||
__nop(); __nop(); __nop(); __nop();
|
||||
__nop(); __nop(); __nop(); __nop();
|
||||
__nop(); __nop(); __nop(); __nop();
|
||||
__nop(); __nop(); __nop(); __nop();
|
||||
|
||||
return m_pWrapped->GetSwapChain(iSwapChain, pSwapChain);
|
||||
}
|
||||
|
||||
UINT APIENTRY hkIDirect3DDevice9::GetNumberOfSwapChains() {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->GetNumberOfSwapChains();
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::Reset(D3DPRESENT_PARAMETERS* pPresentationParameters) {
|
||||
PrintLog("hkIDirect3DDevice9::Reset");
|
||||
|
||||
spdlog::debug("hkIDirect3DDevice9::Reset");
|
||||
context.ApplyPresentationParameters(pPresentationParameters);
|
||||
return m_pWrapped->Reset(pPresentationParameters);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::Present(CONST RECT* pSourceRect, CONST RECT* pDestRect, HWND hDestWindowOverride, CONST RGNDATA* pDirtyRegion) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->Present(pSourceRect, pDestRect, hDestWindowOverride, pDirtyRegion);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::GetBackBuffer(UINT iSwapChain, UINT iBackBuffer, D3DBACKBUFFER_TYPE Type, IDirect3DSurface9** ppBackBuffer) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->GetBackBuffer(iSwapChain, iBackBuffer, Type, ppBackBuffer);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::GetRasterStatus(UINT iSwapChain, D3DRASTER_STATUS* pRasterStatus) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->GetRasterStatus(iSwapChain, pRasterStatus);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::SetDialogBoxMode(BOOL bEnableDialogs) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->SetDialogBoxMode(bEnableDialogs);
|
||||
}
|
||||
|
||||
void APIENTRY hkIDirect3DDevice9::SetGammaRamp(UINT iSwapChain, DWORD Flags, CONST D3DGAMMARAMP* pRamp) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->SetGammaRamp(iSwapChain, Flags, pRamp);
|
||||
}
|
||||
|
||||
void APIENTRY hkIDirect3DDevice9::GetGammaRamp(UINT iSwapChain, D3DGAMMARAMP* pRamp) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->GetGammaRamp(iSwapChain, pRamp);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::CreateTexture(UINT Width, UINT Height, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DTexture9** ppTexture, HANDLE* pSharedHandle) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->CreateTexture(Width, Height, Levels, Usage, Format, Pool, ppTexture, pSharedHandle);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::CreateVolumeTexture(UINT Width, UINT Height, UINT Depth, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DVolumeTexture9** ppVolumeTexture, HANDLE* pSharedHandle) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->CreateVolumeTexture(Width, Height, Depth, Levels, Usage, Format, Pool, ppVolumeTexture, pSharedHandle);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::CreateCubeTexture(UINT EdgeLength, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DCubeTexture9** ppCubeTexture, HANDLE* pSharedHandle) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->CreateCubeTexture(EdgeLength, Levels, Usage, Format, Pool, ppCubeTexture, pSharedHandle);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::CreateVertexBuffer(UINT Length, DWORD Usage, DWORD FVF, D3DPOOL Pool, IDirect3DVertexBuffer9** ppVertexBuffer, HANDLE* pSharedHandle) {
|
||||
//PrintLog("hkIDirect3DDevice9::CreateVertexBuffer %08u %x %x %x %p %p", Length, Usage, FVF, Pool, ppVertexBuffer, pSharedHandle);
|
||||
return context.ApplyVertexBufferFix(m_pWrapped, Length, Usage, FVF, Pool, ppVertexBuffer, pSharedHandle);
|
||||
spdlog::trace(__FUNCTION__" {} {} {} {} {} {}", Length, Usage, FVF, Pool, (void*)ppVertexBuffer, (void*)pSharedHandle);
|
||||
return context.CreateVertexBuffer(m_pWrapped, Length, Usage, FVF, Pool, ppVertexBuffer, pSharedHandle);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::CreateIndexBuffer(UINT Length, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DIndexBuffer9** ppIndexBuffer, HANDLE* pSharedHandle) {
|
||||
//PrintLog("hkIDirect3DDevice9::CreateIndexBuffer %u %x %x %x %p %p", Length, Usage, Format, Pool, ppIndexBuffer, pSharedHandle);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->CreateIndexBuffer(Length, Usage, Format, Pool, ppIndexBuffer, pSharedHandle);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::CreateRenderTarget(UINT Width, UINT Height, D3DFORMAT Format, D3DMULTISAMPLE_TYPE MultiSample, DWORD MultisampleQuality, BOOL Lockable, IDirect3DSurface9** ppSurface, HANDLE* pSharedHandle) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->CreateRenderTarget(Width, Height, Format, MultiSample, MultisampleQuality, Lockable, ppSurface, pSharedHandle);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::CreateDepthStencilSurface(UINT Width, UINT Height, D3DFORMAT Format, D3DMULTISAMPLE_TYPE MultiSample, DWORD MultisampleQuality, BOOL Discard, IDirect3DSurface9** ppSurface, HANDLE* pSharedHandle) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->CreateDepthStencilSurface(Width, Height, Format, MultiSample, MultisampleQuality, Discard, ppSurface, pSharedHandle);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::UpdateSurface(IDirect3DSurface9* pSourceSurface, CONST RECT* pSourceRect, IDirect3DSurface9* pDestinationSurface, CONST POINT* pDestPoint) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->UpdateSurface(pSourceSurface, pSourceRect, pDestinationSurface, pDestPoint);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::UpdateTexture(IDirect3DBaseTexture9* pSourceTexture, IDirect3DBaseTexture9* pDestinationTexture) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->UpdateTexture(pSourceTexture, pDestinationTexture);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::GetRenderTargetData(IDirect3DSurface9* pRenderTarget, IDirect3DSurface9* pDestSurface) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->GetRenderTargetData(pRenderTarget, pDestSurface);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::GetFrontBufferData(UINT iSwapChain, IDirect3DSurface9* pDestSurface) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->GetFrontBufferData(iSwapChain, pDestSurface);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::StretchRect(IDirect3DSurface9* pSourceSurface, CONST RECT* pSourceRect, IDirect3DSurface9* pDestSurface, CONST RECT* pDestRect, D3DTEXTUREFILTERTYPE Filter) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->StretchRect(pSourceSurface, pSourceRect, pDestSurface, pDestRect, Filter);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::ColorFill(IDirect3DSurface9* pSurface, CONST RECT* pRect, D3DCOLOR color) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->ColorFill(pSurface, pRect, color);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::CreateOffscreenPlainSurface(UINT Width, UINT Height, D3DFORMAT Format, D3DPOOL Pool, IDirect3DSurface9** ppSurface, HANDLE* pSharedHandle) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->CreateOffscreenPlainSurface(Width, Height, Format, Pool, ppSurface, pSharedHandle);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::SetRenderTarget(DWORD RenderTargetIndex, IDirect3DSurface9* pRenderTarget) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->SetRenderTarget(RenderTargetIndex, pRenderTarget);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::GetRenderTarget(DWORD RenderTargetIndex, IDirect3DSurface9** ppRenderTarget) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->GetRenderTarget(RenderTargetIndex, ppRenderTarget);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::SetDepthStencilSurface(IDirect3DSurface9* pNewZStencil) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->SetDepthStencilSurface(pNewZStencil);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::GetDepthStencilSurface(IDirect3DSurface9** ppZStencilSurface) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->GetDepthStencilSurface(ppZStencilSurface);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::BeginScene() {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->BeginScene();
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::EndScene() {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->EndScene();
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::Clear(DWORD Count, CONST D3DRECT* pRects, DWORD Flags, D3DCOLOR Color, float Z, DWORD Stencil) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->Clear(Count, pRects, Flags, Color, Z, Stencil);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::SetTransform(D3DTRANSFORMSTATETYPE State, CONST D3DMATRIX* pMatrix) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->SetTransform(State, pMatrix);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::GetTransform(D3DTRANSFORMSTATETYPE State, D3DMATRIX* pMatrix) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->GetTransform(State, pMatrix);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::MultiplyTransform(D3DTRANSFORMSTATETYPE State, CONST D3DMATRIX* pMatrix) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->MultiplyTransform(State, pMatrix);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::SetViewport(CONST D3DVIEWPORT9* pViewport) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->SetViewport(pViewport);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::GetViewport(D3DVIEWPORT9* pViewport) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->GetViewport(pViewport);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::SetMaterial(CONST D3DMATERIAL9* pMaterial) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->SetMaterial(pMaterial);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::GetMaterial(D3DMATERIAL9* pMaterial) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->GetMaterial(pMaterial);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::SetLight(DWORD Index, CONST D3DLIGHT9* pLight) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->SetLight(Index, pLight);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::GetLight(DWORD Index, D3DLIGHT9* pLight) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->GetLight(Index, pLight);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::LightEnable(DWORD Index, BOOL Enable) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->LightEnable(Index, Enable);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::GetLightEnable(DWORD Index, BOOL* pEnable) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->GetLightEnable(Index, pEnable);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::SetClipPlane(DWORD Index, CONST float* pPlane) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->SetClipPlane(Index, pPlane);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::GetClipPlane(DWORD Index, float* pPlane) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->GetClipPlane(Index, pPlane);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::SetRenderState(D3DRENDERSTATETYPE State, DWORD Value) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->SetRenderState(State, Value);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::GetRenderState(D3DRENDERSTATETYPE State, DWORD* pValue) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->GetRenderState(State, pValue);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::CreateStateBlock(D3DSTATEBLOCKTYPE Type, IDirect3DStateBlock9** ppSB) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->CreateStateBlock(Type, ppSB);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::BeginStateBlock() {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->BeginStateBlock();
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::EndStateBlock(IDirect3DStateBlock9** ppSB) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->EndStateBlock(ppSB);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::SetClipStatus(CONST D3DCLIPSTATUS9* pClipStatus) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->SetClipStatus(pClipStatus);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::GetClipStatus(D3DCLIPSTATUS9* pClipStatus) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->GetClipStatus(pClipStatus);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::GetTexture(DWORD Stage, IDirect3DBaseTexture9** ppTexture) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->GetTexture(Stage, ppTexture);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::SetTexture(DWORD Stage, IDirect3DBaseTexture9* pTexture) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->SetTexture(Stage, pTexture);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::GetTextureStageState(DWORD Stage, D3DTEXTURESTAGESTATETYPE Type, DWORD* pValue) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->GetTextureStageState(Stage, Type, pValue);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::SetTextureStageState(DWORD Stage, D3DTEXTURESTAGESTATETYPE Type, DWORD Value) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->SetTextureStageState(Stage, Type, Value);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::GetSamplerState(DWORD Sampler, D3DSAMPLERSTATETYPE Type, DWORD* pValue) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->GetSamplerState(Sampler, Type, pValue);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::SetSamplerState(DWORD Sampler, D3DSAMPLERSTATETYPE Type, DWORD Value) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->SetSamplerState(Sampler, Type, Value);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::ValidateDevice(DWORD* pNumPasses) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->ValidateDevice(pNumPasses);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::SetPaletteEntries(UINT PaletteNumber, CONST PALETTEENTRY* pEntries) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->SetPaletteEntries(PaletteNumber, pEntries);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::GetPaletteEntries(UINT PaletteNumber, PALETTEENTRY* pEntries) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->GetPaletteEntries(PaletteNumber, pEntries);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::SetCurrentTexturePalette(UINT PaletteNumber) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->SetCurrentTexturePalette(PaletteNumber);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::GetCurrentTexturePalette(UINT *PaletteNumber) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::GetCurrentTexturePalette(UINT* PaletteNumber) {
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->GetCurrentTexturePalette(PaletteNumber);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::SetScissorRect(CONST RECT* pRect) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
return m_pWrapped->SetScissorRect(pRect);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return context.SetScissorRect(m_pWrapped, pRect);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::GetScissorRect(RECT* pRect) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->GetScissorRect(pRect);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::SetSoftwareVertexProcessing(BOOL bSoftware) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->SetSoftwareVertexProcessing(bSoftware);
|
||||
}
|
||||
|
||||
BOOL APIENTRY hkIDirect3DDevice9::GetSoftwareVertexProcessing() {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->GetSoftwareVertexProcessing();
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::SetNPatchMode(float nSegments) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->SetNPatchMode(nSegments);
|
||||
}
|
||||
|
||||
float APIENTRY hkIDirect3DDevice9::GetNPatchMode() {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->GetNPatchMode();
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::DrawPrimitive(D3DPRIMITIVETYPE PrimitiveType, UINT StartVertex, UINT PrimitiveCount) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->DrawPrimitive(PrimitiveType, StartVertex, PrimitiveCount);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::DrawIndexedPrimitive(D3DPRIMITIVETYPE PrimitiveType, INT BaseVertexIndex, UINT MinVertexIndex, UINT NumVertices, UINT startIndex, UINT primCount) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->DrawIndexedPrimitive(PrimitiveType, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::DrawPrimitiveUP(D3DPRIMITIVETYPE PrimitiveType, UINT PrimitiveCount, CONST void* pVertexStreamZeroData, UINT VertexStreamZeroStride) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
return m_pWrapped->DrawPrimitiveUP(PrimitiveType, PrimitiveCount, pVertexStreamZeroData, VertexStreamZeroStride);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return context.DrawPrimitiveUP(m_pWrapped, PrimitiveType, PrimitiveCount, pVertexStreamZeroData, VertexStreamZeroStride);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::DrawIndexedPrimitiveUP(D3DPRIMITIVETYPE PrimitiveType, UINT MinVertexIndex, UINT NumVertices, UINT PrimitiveCount, CONST void* pIndexData, D3DFORMAT IndexDataFormat, CONST void* pVertexStreamZeroData, UINT VertexStreamZeroStride) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->DrawIndexedPrimitiveUP(PrimitiveType, MinVertexIndex, NumVertices, PrimitiveCount, pIndexData, IndexDataFormat, pVertexStreamZeroData, VertexStreamZeroStride);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::ProcessVertices(UINT SrcStartIndex, UINT DestIndex, UINT VertexCount, IDirect3DVertexBuffer9* pDestBuffer, IDirect3DVertexDeclaration9* pVertexDecl, DWORD Flags) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->ProcessVertices(SrcStartIndex, DestIndex, VertexCount, pDestBuffer, pVertexDecl, Flags);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::CreateVertexDeclaration(CONST D3DVERTEXELEMENT9* pVertexElements, IDirect3DVertexDeclaration9** ppDecl) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->CreateVertexDeclaration(pVertexElements, ppDecl);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::SetVertexDeclaration(IDirect3DVertexDeclaration9* pDecl) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->SetVertexDeclaration(pDecl);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::GetVertexDeclaration(IDirect3DVertexDeclaration9** ppDecl) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->GetVertexDeclaration(ppDecl);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::SetFVF(DWORD FVF) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->SetFVF(FVF);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::GetFVF(DWORD* pFVF) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->GetFVF(pFVF);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::CreateVertexShader(CONST DWORD* pFunction, IDirect3DVertexShader9** ppShader) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->CreateVertexShader(pFunction, ppShader);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::SetVertexShader(IDirect3DVertexShader9* pShader) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->SetVertexShader(pShader);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::GetVertexShader(IDirect3DVertexShader9** ppShader) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->GetVertexShader(ppShader);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::SetVertexShaderConstantF(UINT StartRegister, CONST float* pConstantData, UINT Vector4fCount) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->SetVertexShaderConstantF(StartRegister, pConstantData, Vector4fCount);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::GetVertexShaderConstantF(UINT StartRegister, float* pConstantData, UINT Vector4fCount) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->GetVertexShaderConstantF(StartRegister, pConstantData, Vector4fCount);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::SetVertexShaderConstantI(UINT StartRegister, CONST int* pConstantData, UINT Vector4iCount) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->SetVertexShaderConstantI(StartRegister, pConstantData, Vector4iCount);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::GetVertexShaderConstantI(UINT StartRegister, int* pConstantData, UINT Vector4iCount) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->GetVertexShaderConstantI(StartRegister, pConstantData, Vector4iCount);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::SetVertexShaderConstantB(UINT StartRegister, CONST BOOL* pConstantData, UINT BoolCount) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->SetVertexShaderConstantB(StartRegister, pConstantData, BoolCount);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::GetVertexShaderConstantB(UINT StartRegister, BOOL* pConstantData, UINT BoolCount) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->GetVertexShaderConstantB(StartRegister, pConstantData, BoolCount);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::SetStreamSource(UINT StreamNumber, IDirect3DVertexBuffer9* pStreamData, UINT OffsetInBytes, UINT Stride) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->SetStreamSource(StreamNumber, pStreamData, OffsetInBytes, Stride);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::GetStreamSource(UINT StreamNumber, IDirect3DVertexBuffer9** ppStreamData, UINT* pOffsetInBytes, UINT* pStride) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->GetStreamSource(StreamNumber, ppStreamData, pOffsetInBytes, pStride);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::SetStreamSourceFreq(UINT StreamNumber, UINT Setting) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->SetStreamSourceFreq(StreamNumber, Setting);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::GetStreamSourceFreq(UINT StreamNumber, UINT* pSetting) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->GetStreamSourceFreq(StreamNumber, pSetting);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::SetIndices(IDirect3DIndexBuffer9* pIndexData) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->SetIndices(pIndexData);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::GetIndices(IDirect3DIndexBuffer9** ppIndexData) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->GetIndices(ppIndexData);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::CreatePixelShader(CONST DWORD* pFunction, IDirect3DPixelShader9** ppShader) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->CreatePixelShader(pFunction, ppShader);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::SetPixelShader(IDirect3DPixelShader9* pShader) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->SetPixelShader(pShader);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::GetPixelShader(IDirect3DPixelShader9** ppShader) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->GetPixelShader(ppShader);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::SetPixelShaderConstantF(UINT StartRegister, CONST float* pConstantData, UINT Vector4fCount) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->SetPixelShaderConstantF(StartRegister, pConstantData, Vector4fCount);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::GetPixelShaderConstantF(UINT StartRegister, float* pConstantData, UINT Vector4fCount) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->GetPixelShaderConstantF(StartRegister, pConstantData, Vector4fCount);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::SetPixelShaderConstantI(UINT StartRegister, CONST int* pConstantData, UINT Vector4iCount) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->SetPixelShaderConstantI(StartRegister, pConstantData, Vector4iCount);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::GetPixelShaderConstantI(UINT StartRegister, int* pConstantData, UINT Vector4iCount) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->GetPixelShaderConstantI(StartRegister, pConstantData, Vector4iCount);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::SetPixelShaderConstantB(UINT StartRegister, CONST BOOL* pConstantData, UINT BoolCount) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->SetPixelShaderConstantB(StartRegister, pConstantData, BoolCount);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::GetPixelShaderConstantB(UINT StartRegister, BOOL* pConstantData, UINT BoolCount) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->GetPixelShaderConstantB(StartRegister, pConstantData, BoolCount);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::DrawRectPatch(UINT Handle, CONST float* pNumSegs, CONST D3DRECTPATCH_INFO* pRectPatchInfo) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->DrawRectPatch(Handle, pNumSegs, pRectPatchInfo);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::DrawTriPatch(UINT Handle, CONST float* pNumSegs, CONST D3DTRIPATCH_INFO* pTriPatchInfo) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->DrawTriPatch(Handle, pNumSegs, pTriPatchInfo);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::DeletePatch(UINT Handle) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->DeletePatch(Handle);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DDevice9::CreateQuery(D3DQUERYTYPE Type, IDirect3DQuery9** ppQuery) {
|
||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->CreateQuery(Type, ppQuery);
|
||||
}
|
||||
|
||||
HRESULT STDMETHODCALLTYPE hkIDirect3DDevice9::SetConvolutionMonoKernel(UINT width, UINT height, float* rows, float* columns) {
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->SetConvolutionMonoKernel(width, height, rows, columns);
|
||||
}
|
||||
|
||||
HRESULT STDMETHODCALLTYPE hkIDirect3DDevice9::ComposeRects(IDirect3DSurface9* pSrc, IDirect3DSurface9* pDst, IDirect3DVertexBuffer9* pSrcRectDescs, UINT NumRects, IDirect3DVertexBuffer9* pDstRectDescs, D3DCOMPOSERECTSOP Operation, int Xoffset, int Yoffset) {
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->ComposeRects(pSrc, pDst, pSrcRectDescs, NumRects, pDstRectDescs, Operation, Xoffset, Yoffset);
|
||||
}
|
||||
|
||||
HRESULT STDMETHODCALLTYPE hkIDirect3DDevice9::PresentEx(const RECT* pSourceRect, const RECT* pDestRect, HWND hDestWindowOverride, const RGNDATA* pDirtyRegion, DWORD dwFlags) {
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->PresentEx(pSourceRect, pDestRect, hDestWindowOverride, pDirtyRegion, dwFlags);
|
||||
}
|
||||
|
||||
HRESULT STDMETHODCALLTYPE hkIDirect3DDevice9::GetGPUThreadPriority(INT* pPriority) {
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->GetGPUThreadPriority(pPriority);
|
||||
}
|
||||
|
||||
HRESULT STDMETHODCALLTYPE hkIDirect3DDevice9::SetGPUThreadPriority(INT Priority) {
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->SetGPUThreadPriority(Priority);
|
||||
}
|
||||
|
||||
HRESULT STDMETHODCALLTYPE hkIDirect3DDevice9::WaitForVBlank(UINT iSwapChain) {
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->WaitForVBlank(iSwapChain);
|
||||
}
|
||||
|
||||
HRESULT STDMETHODCALLTYPE hkIDirect3DDevice9::CheckResourceResidency(IDirect3DResource9** pResourceArray, UINT32 NumResources) {
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->CheckResourceResidency(pResourceArray, NumResources);
|
||||
}
|
||||
|
||||
HRESULT STDMETHODCALLTYPE hkIDirect3DDevice9::SetMaximumFrameLatency(UINT MaxLatency) {
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->SetMaximumFrameLatency(MaxLatency);
|
||||
}
|
||||
|
||||
HRESULT STDMETHODCALLTYPE hkIDirect3DDevice9::GetMaximumFrameLatency(UINT* pMaxLatency) {
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->GetMaximumFrameLatency(pMaxLatency);
|
||||
}
|
||||
|
||||
HRESULT STDMETHODCALLTYPE hkIDirect3DDevice9::CheckDeviceState(HWND hDestinationWindow) {
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->CheckDeviceState(hDestinationWindow);
|
||||
}
|
||||
|
||||
HRESULT STDMETHODCALLTYPE hkIDirect3DDevice9::CreateRenderTargetEx(UINT Width, UINT Height, D3DFORMAT Format, D3DMULTISAMPLE_TYPE MultiSample, DWORD MultisampleQuality, BOOL Lockable, IDirect3DSurface9** ppSurface, HANDLE* pSharedHandle, DWORD Usage) {
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->CreateRenderTargetEx(Width, Height, Format, MultiSample, MultisampleQuality, Lockable, ppSurface, pSharedHandle, Usage);
|
||||
}
|
||||
|
||||
HRESULT STDMETHODCALLTYPE hkIDirect3DDevice9::CreateOffscreenPlainSurfaceEx(UINT Width, UINT Height, D3DFORMAT Format, D3DPOOL Pool, IDirect3DSurface9** ppSurface, HANDLE* pSharedHandle, DWORD Usage) {
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->CreateOffscreenPlainSurfaceEx(Width, Height, Format, Pool, ppSurface, pSharedHandle, Usage);
|
||||
}
|
||||
|
||||
HRESULT STDMETHODCALLTYPE hkIDirect3DDevice9::CreateDepthStencilSurfaceEx(UINT Width, UINT Height, D3DFORMAT Format, D3DMULTISAMPLE_TYPE MultiSample, DWORD MultisampleQuality, BOOL Discard, IDirect3DSurface9** ppSurface, HANDLE* pSharedHandle, DWORD Usage) {
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->CreateDepthStencilSurfaceEx(Width, Height, Format, MultiSample, MultisampleQuality, Discard, ppSurface, pSharedHandle, Usage);
|
||||
}
|
||||
|
||||
HRESULT STDMETHODCALLTYPE hkIDirect3DDevice9::ResetEx(D3DPRESENT_PARAMETERS* pPresentationParameters, D3DDISPLAYMODEEX* pFullscreenDisplayMode) {
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->ResetEx(pPresentationParameters, pFullscreenDisplayMode);
|
||||
}
|
||||
|
||||
HRESULT STDMETHODCALLTYPE hkIDirect3DDevice9::GetDisplayModeEx(UINT iSwapChain, D3DDISPLAYMODEEX* pMode, D3DDISPLAYROTATION* pRotation) {
|
||||
spdlog::trace(__FUNCTION__);
|
||||
return m_pWrapped->GetDisplayModeEx(iSwapChain, pMode, pRotation);
|
||||
}
|
|
@ -1,145 +1,159 @@
|
|||
// wrapper for IDirect3DDevice9 in d3d9.h
|
||||
// generated using wrapper_gen.rb
|
||||
|
||||
#pragma once
|
||||
#include "d3d9.h"
|
||||
#include <d3d9.h>
|
||||
|
||||
interface hkIDirect3DDevice9 final : public IDirect3DDevice9 {
|
||||
interface DECLSPEC_UUID("DD98C5F4-40E6-43D9-A0EA-0C32ABDFDF9C") hkIDirect3DDevice9 final : public IDirect3DDevice9Ex{
|
||||
public:
|
||||
// original interface
|
||||
STDMETHOD(QueryInterface)(REFIID riid, void** ppvObj);
|
||||
STDMETHOD_(ULONG, AddRef)();
|
||||
STDMETHOD_(ULONG, Release)();
|
||||
STDMETHOD(TestCooperativeLevel)();
|
||||
STDMETHOD_(UINT, GetAvailableTextureMem)();
|
||||
STDMETHOD(EvictManagedResources)();
|
||||
STDMETHOD(GetDirect3D)(IDirect3D9** ppD3D9);
|
||||
STDMETHOD(GetDeviceCaps)(D3DCAPS9* pCaps);
|
||||
STDMETHOD(GetDisplayMode)(UINT iSwapChain, D3DDISPLAYMODE* pMode);
|
||||
STDMETHOD(GetCreationParameters)(D3DDEVICE_CREATION_PARAMETERS *pParameters);
|
||||
STDMETHOD(SetCursorProperties)(UINT XHotSpot, UINT YHotSpot, IDirect3DSurface9* pCursorBitmap);
|
||||
STDMETHOD_(void, SetCursorPosition)(int X, int Y, DWORD Flags);
|
||||
STDMETHOD_(BOOL, ShowCursor)(BOOL bShow);
|
||||
STDMETHOD(CreateAdditionalSwapChain)(D3DPRESENT_PARAMETERS* pPresentationParameters, IDirect3DSwapChain9** pSwapChain);
|
||||
STDMETHOD(GetSwapChain)(UINT iSwapChain, IDirect3DSwapChain9** pSwapChain);
|
||||
STDMETHOD_(UINT, GetNumberOfSwapChains)();
|
||||
STDMETHOD(Reset)(D3DPRESENT_PARAMETERS* pPresentationParameters);
|
||||
STDMETHOD(Present)(CONST RECT* pSourceRect, CONST RECT* pDestRect, HWND hDestWindowOverride, CONST RGNDATA* pDirtyRegion);
|
||||
STDMETHOD(GetBackBuffer)(UINT iSwapChain, UINT iBackBuffer, D3DBACKBUFFER_TYPE Type, IDirect3DSurface9** ppBackBuffer);
|
||||
STDMETHOD(GetRasterStatus)(UINT iSwapChain, D3DRASTER_STATUS* pRasterStatus);
|
||||
STDMETHOD(SetDialogBoxMode)(BOOL bEnableDialogs);
|
||||
STDMETHOD_(void, SetGammaRamp)(UINT iSwapChain, DWORD Flags, CONST D3DGAMMARAMP* pRamp);
|
||||
STDMETHOD_(void, GetGammaRamp)(UINT iSwapChain, D3DGAMMARAMP* pRamp);
|
||||
STDMETHOD(CreateTexture)(UINT Width, UINT Height, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DTexture9** ppTexture, HANDLE* pSharedHandle);
|
||||
STDMETHOD(CreateVolumeTexture)(UINT Width, UINT Height, UINT Depth, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DVolumeTexture9** ppVolumeTexture, HANDLE* pSharedHandle);
|
||||
STDMETHOD(CreateCubeTexture)(UINT EdgeLength, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DCubeTexture9** ppCubeTexture, HANDLE* pSharedHandle);
|
||||
STDMETHOD(CreateVertexBuffer)(UINT Length, DWORD Usage, DWORD FVF, D3DPOOL Pool, IDirect3DVertexBuffer9** ppVertexBuffer, HANDLE* pSharedHandle);
|
||||
STDMETHOD(CreateIndexBuffer)(UINT Length, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DIndexBuffer9** ppIndexBuffer, HANDLE* pSharedHandle);
|
||||
STDMETHOD(CreateRenderTarget)(UINT Width, UINT Height, D3DFORMAT Format, D3DMULTISAMPLE_TYPE MultiSample, DWORD MultisampleQuality, BOOL Lockable, IDirect3DSurface9** ppSurface, HANDLE* pSharedHandle);
|
||||
STDMETHOD(CreateDepthStencilSurface)(UINT Width, UINT Height, D3DFORMAT Format, D3DMULTISAMPLE_TYPE MultiSample, DWORD MultisampleQuality, BOOL Discard, IDirect3DSurface9** ppSurface, HANDLE* pSharedHandle);
|
||||
STDMETHOD(UpdateSurface)(IDirect3DSurface9* pSourceSurface, CONST RECT* pSourceRect, IDirect3DSurface9* pDestinationSurface, CONST POINT* pDestPoint);
|
||||
STDMETHOD(UpdateTexture)(IDirect3DBaseTexture9* pSourceTexture, IDirect3DBaseTexture9* pDestinationTexture);
|
||||
STDMETHOD(GetRenderTargetData)(IDirect3DSurface9* pRenderTarget, IDirect3DSurface9* pDestSurface);
|
||||
STDMETHOD(GetFrontBufferData)(UINT iSwapChain, IDirect3DSurface9* pDestSurface);
|
||||
STDMETHOD(StretchRect)(IDirect3DSurface9* pSourceSurface, CONST RECT* pSourceRect, IDirect3DSurface9* pDestSurface, CONST RECT* pDestRect, D3DTEXTUREFILTERTYPE Filter);
|
||||
STDMETHOD(ColorFill)(IDirect3DSurface9* pSurface, CONST RECT* pRect, D3DCOLOR color);
|
||||
STDMETHOD(CreateOffscreenPlainSurface)(UINT Width, UINT Height, D3DFORMAT Format, D3DPOOL Pool, IDirect3DSurface9** ppSurface, HANDLE* pSharedHandle);
|
||||
STDMETHOD(SetRenderTarget)(DWORD RenderTargetIndex, IDirect3DSurface9* pRenderTarget);
|
||||
STDMETHOD(GetRenderTarget)(DWORD RenderTargetIndex, IDirect3DSurface9** ppRenderTarget);
|
||||
STDMETHOD(SetDepthStencilSurface)(IDirect3DSurface9* pNewZStencil);
|
||||
STDMETHOD(GetDepthStencilSurface)(IDirect3DSurface9** ppZStencilSurface);
|
||||
STDMETHOD(BeginScene)();
|
||||
STDMETHOD(EndScene)();
|
||||
STDMETHOD(Clear)(DWORD Count, CONST D3DRECT* pRects, DWORD Flags, D3DCOLOR Color, float Z, DWORD Stencil);
|
||||
STDMETHOD(SetTransform)(D3DTRANSFORMSTATETYPE State, CONST D3DMATRIX* pMatrix);
|
||||
STDMETHOD(GetTransform)(D3DTRANSFORMSTATETYPE State, D3DMATRIX* pMatrix);
|
||||
STDMETHOD(MultiplyTransform)(D3DTRANSFORMSTATETYPE State, CONST D3DMATRIX* pMatrix);
|
||||
STDMETHOD(SetViewport)(CONST D3DVIEWPORT9* pViewport);
|
||||
STDMETHOD(GetViewport)(D3DVIEWPORT9* pViewport);
|
||||
STDMETHOD(SetMaterial)(CONST D3DMATERIAL9* pMaterial);
|
||||
STDMETHOD(GetMaterial)(D3DMATERIAL9* pMaterial);
|
||||
STDMETHOD(SetLight)(DWORD Index, CONST D3DLIGHT9* pLight);
|
||||
STDMETHOD(GetLight)(DWORD Index, D3DLIGHT9* pLight);
|
||||
STDMETHOD(LightEnable)(DWORD Index, BOOL Enable);
|
||||
STDMETHOD(GetLightEnable)(DWORD Index, BOOL* pEnable);
|
||||
STDMETHOD(SetClipPlane)(DWORD Index, CONST float* pPlane);
|
||||
STDMETHOD(GetClipPlane)(DWORD Index, float* pPlane);
|
||||
STDMETHOD(SetRenderState)(D3DRENDERSTATETYPE State, DWORD Value);
|
||||
STDMETHOD(GetRenderState)(D3DRENDERSTATETYPE State, DWORD* pValue);
|
||||
STDMETHOD(CreateStateBlock)(D3DSTATEBLOCKTYPE Type, IDirect3DStateBlock9** ppSB);
|
||||
STDMETHOD(BeginStateBlock)();
|
||||
STDMETHOD(EndStateBlock)(IDirect3DStateBlock9** ppSB);
|
||||
STDMETHOD(SetClipStatus)(CONST D3DCLIPSTATUS9* pClipStatus);
|
||||
STDMETHOD(GetClipStatus)(D3DCLIPSTATUS9* pClipStatus);
|
||||
STDMETHOD(GetTexture)(DWORD Stage, IDirect3DBaseTexture9** ppTexture);
|
||||
STDMETHOD(SetTexture)(DWORD Stage, IDirect3DBaseTexture9* pTexture);
|
||||
STDMETHOD(GetTextureStageState)(DWORD Stage, D3DTEXTURESTAGESTATETYPE Type, DWORD* pValue);
|
||||
STDMETHOD(SetTextureStageState)(DWORD Stage, D3DTEXTURESTAGESTATETYPE Type, DWORD Value);
|
||||
STDMETHOD(GetSamplerState)(DWORD Sampler, D3DSAMPLERSTATETYPE Type, DWORD* pValue);
|
||||
STDMETHOD(SetSamplerState)(DWORD Sampler, D3DSAMPLERSTATETYPE Type, DWORD Value);
|
||||
STDMETHOD(ValidateDevice)(DWORD* pNumPasses);
|
||||
STDMETHOD(SetPaletteEntries)(UINT PaletteNumber, CONST PALETTEENTRY* pEntries);
|
||||
STDMETHOD(GetPaletteEntries)(UINT PaletteNumber, PALETTEENTRY* pEntries);
|
||||
STDMETHOD(SetCurrentTexturePalette)(UINT PaletteNumber);
|
||||
STDMETHOD(GetCurrentTexturePalette)(UINT *PaletteNumber);
|
||||
STDMETHOD(SetScissorRect)(CONST RECT* pRect);
|
||||
STDMETHOD(GetScissorRect)(RECT* pRect);
|
||||
STDMETHOD(SetSoftwareVertexProcessing)(BOOL bSoftware);
|
||||
STDMETHOD_(BOOL, GetSoftwareVertexProcessing)();
|
||||
STDMETHOD(SetNPatchMode)(float nSegments);
|
||||
STDMETHOD_(float, GetNPatchMode)();
|
||||
STDMETHOD(DrawPrimitive)(D3DPRIMITIVETYPE PrimitiveType, UINT StartVertex, UINT PrimitiveCount);
|
||||
STDMETHOD(DrawIndexedPrimitive)(D3DPRIMITIVETYPE, INT BaseVertexIndex, UINT MinVertexIndex, UINT NumVertices, UINT startIndex, UINT primCount);
|
||||
STDMETHOD(DrawPrimitiveUP)(D3DPRIMITIVETYPE PrimitiveType, UINT PrimitiveCount, CONST void* pVertexStreamZeroData, UINT VertexStreamZeroStride);
|
||||
STDMETHOD(DrawIndexedPrimitiveUP)(D3DPRIMITIVETYPE PrimitiveType, UINT MinVertexIndex, UINT NumVertices, UINT PrimitiveCount, CONST void* pIndexData, D3DFORMAT IndexDataFormat, CONST void* pVertexStreamZeroData, UINT VertexStreamZeroStride);
|
||||
STDMETHOD(ProcessVertices)(UINT SrcStartIndex, UINT DestIndex, UINT VertexCount, IDirect3DVertexBuffer9* pDestBuffer, IDirect3DVertexDeclaration9* pVertexDecl, DWORD Flags);
|
||||
STDMETHOD(CreateVertexDeclaration)(CONST D3DVERTEXELEMENT9* pVertexElements, IDirect3DVertexDeclaration9** ppDecl);
|
||||
STDMETHOD(SetVertexDeclaration)(IDirect3DVertexDeclaration9* pDecl);
|
||||
STDMETHOD(GetVertexDeclaration)(IDirect3DVertexDeclaration9** ppDecl);
|
||||
STDMETHOD(SetFVF)(DWORD FVF);
|
||||
STDMETHOD(GetFVF)(DWORD* pFVF);
|
||||
STDMETHOD(CreateVertexShader)(CONST DWORD* pFunction, IDirect3DVertexShader9** ppShader);
|
||||
STDMETHOD(SetVertexShader)(IDirect3DVertexShader9* pShader);
|
||||
STDMETHOD(GetVertexShader)(IDirect3DVertexShader9** ppShader);
|
||||
STDMETHOD(SetVertexShaderConstantF)(UINT StartRegister, CONST float* pConstantData, UINT Vector4fCount);
|
||||
STDMETHOD(GetVertexShaderConstantF)(UINT StartRegister, float* pConstantData, UINT Vector4fCount);
|
||||
STDMETHOD(SetVertexShaderConstantI)(UINT StartRegister, CONST int* pConstantData, UINT Vector4iCount);
|
||||
STDMETHOD(GetVertexShaderConstantI)(UINT StartRegister, int* pConstantData, UINT Vector4iCount);
|
||||
STDMETHOD(SetVertexShaderConstantB)(UINT StartRegister, CONST BOOL* pConstantData, UINT BoolCount);
|
||||
STDMETHOD(GetVertexShaderConstantB)(UINT StartRegister, BOOL* pConstantData, UINT BoolCount);
|
||||
STDMETHOD(SetStreamSource)(UINT StreamNumber, IDirect3DVertexBuffer9* pStreamData, UINT OffsetInBytes, UINT Stride);
|
||||
STDMETHOD(GetStreamSource)(UINT StreamNumber, IDirect3DVertexBuffer9** ppStreamData, UINT* pOffsetInBytes, UINT* pStride);
|
||||
STDMETHOD(SetStreamSourceFreq)(UINT StreamNumber, UINT Setting);
|
||||
STDMETHOD(GetStreamSourceFreq)(UINT StreamNumber, UINT* pSetting);
|
||||
STDMETHOD(SetIndices)(IDirect3DIndexBuffer9* pIndexData);
|
||||
STDMETHOD(GetIndices)(IDirect3DIndexBuffer9** ppIndexData);
|
||||
STDMETHOD(CreatePixelShader)(CONST DWORD* pFunction, IDirect3DPixelShader9** ppShader);
|
||||
STDMETHOD(SetPixelShader)(IDirect3DPixelShader9* pShader);
|
||||
STDMETHOD(GetPixelShader)(IDirect3DPixelShader9** ppShader);
|
||||
STDMETHOD(SetPixelShaderConstantF)(UINT StartRegister, CONST float* pConstantData, UINT Vector4fCount);
|
||||
STDMETHOD(GetPixelShaderConstantF)(UINT StartRegister, float* pConstantData, UINT Vector4fCount);
|
||||
STDMETHOD(SetPixelShaderConstantI)(UINT StartRegister, CONST int* pConstantData, UINT Vector4iCount);
|
||||
STDMETHOD(GetPixelShaderConstantI)(UINT StartRegister, int* pConstantData, UINT Vector4iCount);
|
||||
STDMETHOD(SetPixelShaderConstantB)(UINT StartRegister, CONST BOOL* pConstantData, UINT BoolCount);
|
||||
STDMETHOD(GetPixelShaderConstantB)(UINT StartRegister, BOOL* pConstantData, UINT BoolCount);
|
||||
STDMETHOD(DrawRectPatch)(UINT Handle, CONST float* pNumSegs, CONST D3DRECTPATCH_INFO* pRectPatchInfo);
|
||||
STDMETHOD(DrawTriPatch)(UINT Handle, CONST float* pNumSegs, CONST D3DTRIPATCH_INFO* pTriPatchInfo);
|
||||
STDMETHOD(DeletePatch)(UINT Handle);
|
||||
STDMETHOD(CreateQuery)(D3DQUERYTYPE Type, IDirect3DQuery9** ppQuery);
|
||||
#pragma region IUnknown
|
||||
HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void** ppvObj);
|
||||
ULONG STDMETHODCALLTYPE AddRef();
|
||||
ULONG STDMETHODCALLTYPE Release();
|
||||
#pragma endregion
|
||||
#pragma region IDirect3DDevice9
|
||||
HRESULT STDMETHODCALLTYPE TestCooperativeLevel();
|
||||
UINT STDMETHODCALLTYPE GetAvailableTextureMem();
|
||||
HRESULT STDMETHODCALLTYPE EvictManagedResources();
|
||||
HRESULT STDMETHODCALLTYPE GetDirect3D(IDirect3D9** ppD3D9);
|
||||
HRESULT STDMETHODCALLTYPE GetDeviceCaps(D3DCAPS9* pCaps);
|
||||
HRESULT STDMETHODCALLTYPE GetDisplayMode(UINT iSwapChain, D3DDISPLAYMODE* pMode);
|
||||
HRESULT STDMETHODCALLTYPE GetCreationParameters(D3DDEVICE_CREATION_PARAMETERS* pParameters);
|
||||
HRESULT STDMETHODCALLTYPE SetCursorProperties(UINT XHotSpot, UINT YHotSpot, IDirect3DSurface9* pCursorBitmap);
|
||||
void STDMETHODCALLTYPE SetCursorPosition(int X, int Y, DWORD Flags);
|
||||
BOOL STDMETHODCALLTYPE ShowCursor(BOOL bShow);
|
||||
HRESULT STDMETHODCALLTYPE CreateAdditionalSwapChain(D3DPRESENT_PARAMETERS* pPresentationParameters, IDirect3DSwapChain9** pSwapChain);
|
||||
HRESULT STDMETHODCALLTYPE GetSwapChain(UINT iSwapChain, IDirect3DSwapChain9** pSwapChain);
|
||||
UINT STDMETHODCALLTYPE GetNumberOfSwapChains();
|
||||
HRESULT STDMETHODCALLTYPE Reset(D3DPRESENT_PARAMETERS* pPresentationParameters);
|
||||
HRESULT STDMETHODCALLTYPE Present(CONST RECT* pSourceRect, CONST RECT* pDestRect, HWND hDestWindowOverride, CONST RGNDATA* pDirtyRegion);
|
||||
HRESULT STDMETHODCALLTYPE GetBackBuffer(UINT iSwapChain, UINT iBackBuffer, D3DBACKBUFFER_TYPE Type, IDirect3DSurface9** ppBackBuffer);
|
||||
HRESULT STDMETHODCALLTYPE GetRasterStatus(UINT iSwapChain, D3DRASTER_STATUS* pRasterStatus);
|
||||
HRESULT STDMETHODCALLTYPE SetDialogBoxMode(BOOL bEnableDialogs);
|
||||
void STDMETHODCALLTYPE SetGammaRamp(UINT iSwapChain, DWORD Flags, CONST D3DGAMMARAMP* pRamp);
|
||||
void STDMETHODCALLTYPE GetGammaRamp(UINT iSwapChain, D3DGAMMARAMP* pRamp);
|
||||
HRESULT STDMETHODCALLTYPE CreateTexture(UINT Width, UINT Height, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DTexture9** ppTexture, HANDLE* pSharedHandle);
|
||||
HRESULT STDMETHODCALLTYPE CreateVolumeTexture(UINT Width, UINT Height, UINT Depth, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DVolumeTexture9** ppVolumeTexture, HANDLE* pSharedHandle);
|
||||
HRESULT STDMETHODCALLTYPE CreateCubeTexture(UINT EdgeLength, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DCubeTexture9** ppCubeTexture, HANDLE* pSharedHandle);
|
||||
HRESULT STDMETHODCALLTYPE CreateVertexBuffer(UINT Length, DWORD Usage, DWORD FVF, D3DPOOL Pool, IDirect3DVertexBuffer9** ppVertexBuffer, HANDLE* pSharedHandle);
|
||||
HRESULT STDMETHODCALLTYPE CreateIndexBuffer(UINT Length, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DIndexBuffer9** ppIndexBuffer, HANDLE* pSharedHandle);
|
||||
HRESULT STDMETHODCALLTYPE CreateRenderTarget(UINT Width, UINT Height, D3DFORMAT Format, D3DMULTISAMPLE_TYPE MultiSample, DWORD MultisampleQuality, BOOL Lockable, IDirect3DSurface9** ppSurface, HANDLE* pSharedHandle);
|
||||
HRESULT STDMETHODCALLTYPE CreateDepthStencilSurface(UINT Width, UINT Height, D3DFORMAT Format, D3DMULTISAMPLE_TYPE MultiSample, DWORD MultisampleQuality, BOOL Discard, IDirect3DSurface9** ppSurface, HANDLE* pSharedHandle);
|
||||
HRESULT STDMETHODCALLTYPE UpdateSurface(IDirect3DSurface9* pSourceSurface, CONST RECT* pSourceRect, IDirect3DSurface9* pDestinationSurface, CONST POINT* pDestPoint);
|
||||
HRESULT STDMETHODCALLTYPE UpdateTexture(IDirect3DBaseTexture9* pSourceTexture, IDirect3DBaseTexture9* pDestinationTexture);
|
||||
HRESULT STDMETHODCALLTYPE GetRenderTargetData(IDirect3DSurface9* pRenderTarget, IDirect3DSurface9* pDestSurface);
|
||||
HRESULT STDMETHODCALLTYPE GetFrontBufferData(UINT iSwapChain, IDirect3DSurface9* pDestSurface);
|
||||
HRESULT STDMETHODCALLTYPE StretchRect(IDirect3DSurface9* pSourceSurface, CONST RECT* pSourceRect, IDirect3DSurface9* pDestSurface, CONST RECT* pDestRect, D3DTEXTUREFILTERTYPE Filter);
|
||||
HRESULT STDMETHODCALLTYPE ColorFill(IDirect3DSurface9* pSurface, CONST RECT* pRect, D3DCOLOR color);
|
||||
HRESULT STDMETHODCALLTYPE CreateOffscreenPlainSurface(UINT Width, UINT Height, D3DFORMAT Format, D3DPOOL Pool, IDirect3DSurface9** ppSurface, HANDLE* pSharedHandle);
|
||||
HRESULT STDMETHODCALLTYPE SetRenderTarget(DWORD RenderTargetIndex, IDirect3DSurface9* pRenderTarget);
|
||||
HRESULT STDMETHODCALLTYPE GetRenderTarget(DWORD RenderTargetIndex, IDirect3DSurface9** ppRenderTarget);
|
||||
HRESULT STDMETHODCALLTYPE SetDepthStencilSurface(IDirect3DSurface9* pNewZStencil);
|
||||
HRESULT STDMETHODCALLTYPE GetDepthStencilSurface(IDirect3DSurface9** ppZStencilSurface);
|
||||
HRESULT STDMETHODCALLTYPE BeginScene();
|
||||
HRESULT STDMETHODCALLTYPE EndScene();
|
||||
HRESULT STDMETHODCALLTYPE Clear(DWORD Count, CONST D3DRECT* pRects, DWORD Flags, D3DCOLOR Color, float Z, DWORD Stencil);
|
||||
HRESULT STDMETHODCALLTYPE SetTransform(D3DTRANSFORMSTATETYPE State, CONST D3DMATRIX* pMatrix);
|
||||
HRESULT STDMETHODCALLTYPE GetTransform(D3DTRANSFORMSTATETYPE State, D3DMATRIX* pMatrix);
|
||||
HRESULT STDMETHODCALLTYPE MultiplyTransform(D3DTRANSFORMSTATETYPE State, CONST D3DMATRIX* pMatrix);
|
||||
HRESULT STDMETHODCALLTYPE SetViewport(CONST D3DVIEWPORT9* pViewport);
|
||||
HRESULT STDMETHODCALLTYPE GetViewport(D3DVIEWPORT9* pViewport);
|
||||
HRESULT STDMETHODCALLTYPE SetMaterial(CONST D3DMATERIAL9* pMaterial);
|
||||
HRESULT STDMETHODCALLTYPE GetMaterial(D3DMATERIAL9* pMaterial);
|
||||
HRESULT STDMETHODCALLTYPE SetLight(DWORD Index, CONST D3DLIGHT9* pLight);
|
||||
HRESULT STDMETHODCALLTYPE GetLight(DWORD Index, D3DLIGHT9* pLight);
|
||||
HRESULT STDMETHODCALLTYPE LightEnable(DWORD Index, BOOL Enable);
|
||||
HRESULT STDMETHODCALLTYPE GetLightEnable(DWORD Index, BOOL* pEnable);
|
||||
HRESULT STDMETHODCALLTYPE SetClipPlane(DWORD Index, CONST float* pPlane);
|
||||
HRESULT STDMETHODCALLTYPE GetClipPlane(DWORD Index, float* pPlane);
|
||||
HRESULT STDMETHODCALLTYPE SetRenderState(D3DRENDERSTATETYPE State, DWORD Value);
|
||||
HRESULT STDMETHODCALLTYPE GetRenderState(D3DRENDERSTATETYPE State, DWORD* pValue);
|
||||
HRESULT STDMETHODCALLTYPE CreateStateBlock(D3DSTATEBLOCKTYPE Type, IDirect3DStateBlock9** ppSB);
|
||||
HRESULT STDMETHODCALLTYPE BeginStateBlock();
|
||||
HRESULT STDMETHODCALLTYPE EndStateBlock(IDirect3DStateBlock9** ppSB);
|
||||
HRESULT STDMETHODCALLTYPE SetClipStatus(CONST D3DCLIPSTATUS9* pClipStatus);
|
||||
HRESULT STDMETHODCALLTYPE GetClipStatus(D3DCLIPSTATUS9* pClipStatus);
|
||||
HRESULT STDMETHODCALLTYPE GetTexture(DWORD Stage, IDirect3DBaseTexture9** ppTexture);
|
||||
HRESULT STDMETHODCALLTYPE SetTexture(DWORD Stage, IDirect3DBaseTexture9* pTexture);
|
||||
HRESULT STDMETHODCALLTYPE GetTextureStageState(DWORD Stage, D3DTEXTURESTAGESTATETYPE Type, DWORD* pValue);
|
||||
HRESULT STDMETHODCALLTYPE SetTextureStageState(DWORD Stage, D3DTEXTURESTAGESTATETYPE Type, DWORD Value);
|
||||
HRESULT STDMETHODCALLTYPE GetSamplerState(DWORD Sampler, D3DSAMPLERSTATETYPE Type, DWORD* pValue);
|
||||
HRESULT STDMETHODCALLTYPE SetSamplerState(DWORD Sampler, D3DSAMPLERSTATETYPE Type, DWORD Value);
|
||||
HRESULT STDMETHODCALLTYPE ValidateDevice(DWORD* pNumPasses);
|
||||
HRESULT STDMETHODCALLTYPE SetPaletteEntries(UINT PaletteNumber, CONST PALETTEENTRY* pEntries);
|
||||
HRESULT STDMETHODCALLTYPE GetPaletteEntries(UINT PaletteNumber, PALETTEENTRY* pEntries);
|
||||
HRESULT STDMETHODCALLTYPE SetCurrentTexturePalette(UINT PaletteNumber);
|
||||
HRESULT STDMETHODCALLTYPE GetCurrentTexturePalette(UINT* PaletteNumber);
|
||||
HRESULT STDMETHODCALLTYPE SetScissorRect(CONST RECT* pRect);
|
||||
HRESULT STDMETHODCALLTYPE GetScissorRect(RECT* pRect);
|
||||
HRESULT STDMETHODCALLTYPE SetSoftwareVertexProcessing(BOOL bSoftware);
|
||||
BOOL STDMETHODCALLTYPE GetSoftwareVertexProcessing();
|
||||
HRESULT STDMETHODCALLTYPE SetNPatchMode(float nSegments);
|
||||
float STDMETHODCALLTYPE GetNPatchMode();
|
||||
HRESULT STDMETHODCALLTYPE DrawPrimitive(D3DPRIMITIVETYPE PrimitiveType, UINT StartVertex, UINT PrimitiveCount);
|
||||
HRESULT STDMETHODCALLTYPE DrawIndexedPrimitive(D3DPRIMITIVETYPE, INT BaseVertexIndex, UINT MinVertexIndex, UINT NumVertices, UINT startIndex, UINT primCount);
|
||||
HRESULT STDMETHODCALLTYPE DrawPrimitiveUP(D3DPRIMITIVETYPE PrimitiveType, UINT PrimitiveCount, CONST void* pVertexStreamZeroData, UINT VertexStreamZeroStride);
|
||||
HRESULT STDMETHODCALLTYPE DrawIndexedPrimitiveUP(D3DPRIMITIVETYPE PrimitiveType, UINT MinVertexIndex, UINT NumVertices, UINT PrimitiveCount, CONST void* pIndexData, D3DFORMAT IndexDataFormat, CONST void* pVertexStreamZeroData, UINT VertexStreamZeroStride);
|
||||
HRESULT STDMETHODCALLTYPE ProcessVertices(UINT SrcStartIndex, UINT DestIndex, UINT VertexCount, IDirect3DVertexBuffer9* pDestBuffer, IDirect3DVertexDeclaration9* pVertexDecl, DWORD Flags);
|
||||
HRESULT STDMETHODCALLTYPE CreateVertexDeclaration(CONST D3DVERTEXELEMENT9* pVertexElements, IDirect3DVertexDeclaration9** ppDecl);
|
||||
HRESULT STDMETHODCALLTYPE SetVertexDeclaration(IDirect3DVertexDeclaration9* pDecl);
|
||||
HRESULT STDMETHODCALLTYPE GetVertexDeclaration(IDirect3DVertexDeclaration9** ppDecl);
|
||||
HRESULT STDMETHODCALLTYPE SetFVF(DWORD FVF);
|
||||
HRESULT STDMETHODCALLTYPE GetFVF(DWORD* pFVF);
|
||||
HRESULT STDMETHODCALLTYPE CreateVertexShader(CONST DWORD* pFunction, IDirect3DVertexShader9** ppShader);
|
||||
HRESULT STDMETHODCALLTYPE SetVertexShader(IDirect3DVertexShader9* pShader);
|
||||
HRESULT STDMETHODCALLTYPE GetVertexShader(IDirect3DVertexShader9** ppShader);
|
||||
HRESULT STDMETHODCALLTYPE SetVertexShaderConstantF(UINT StartRegister, CONST float* pConstantData, UINT Vector4fCount);
|
||||
HRESULT STDMETHODCALLTYPE GetVertexShaderConstantF(UINT StartRegister, float* pConstantData, UINT Vector4fCount);
|
||||
HRESULT STDMETHODCALLTYPE SetVertexShaderConstantI(UINT StartRegister, CONST int* pConstantData, UINT Vector4iCount);
|
||||
HRESULT STDMETHODCALLTYPE GetVertexShaderConstantI(UINT StartRegister, int* pConstantData, UINT Vector4iCount);
|
||||
HRESULT STDMETHODCALLTYPE SetVertexShaderConstantB(UINT StartRegister, CONST BOOL* pConstantData, UINT BoolCount);
|
||||
HRESULT STDMETHODCALLTYPE GetVertexShaderConstantB(UINT StartRegister, BOOL* pConstantData, UINT BoolCount);
|
||||
HRESULT STDMETHODCALLTYPE SetStreamSource(UINT StreamNumber, IDirect3DVertexBuffer9* pStreamData, UINT OffsetInBytes, UINT Stride);
|
||||
HRESULT STDMETHODCALLTYPE GetStreamSource(UINT StreamNumber, IDirect3DVertexBuffer9** ppStreamData, UINT* pOffsetInBytes, UINT* pStride);
|
||||
HRESULT STDMETHODCALLTYPE SetStreamSourceFreq(UINT StreamNumber, UINT Setting);
|
||||
HRESULT STDMETHODCALLTYPE GetStreamSourceFreq(UINT StreamNumber, UINT* pSetting);
|
||||
HRESULT STDMETHODCALLTYPE SetIndices(IDirect3DIndexBuffer9* pIndexData);
|
||||
HRESULT STDMETHODCALLTYPE GetIndices(IDirect3DIndexBuffer9** ppIndexData);
|
||||
HRESULT STDMETHODCALLTYPE CreatePixelShader(CONST DWORD* pFunction, IDirect3DPixelShader9** ppShader);
|
||||
HRESULT STDMETHODCALLTYPE SetPixelShader(IDirect3DPixelShader9* pShader);
|
||||
HRESULT STDMETHODCALLTYPE GetPixelShader(IDirect3DPixelShader9** ppShader);
|
||||
HRESULT STDMETHODCALLTYPE SetPixelShaderConstantF(UINT StartRegister, CONST float* pConstantData, UINT Vector4fCount);
|
||||
HRESULT STDMETHODCALLTYPE GetPixelShaderConstantF(UINT StartRegister, float* pConstantData, UINT Vector4fCount);
|
||||
HRESULT STDMETHODCALLTYPE SetPixelShaderConstantI(UINT StartRegister, CONST int* pConstantData, UINT Vector4iCount);
|
||||
HRESULT STDMETHODCALLTYPE GetPixelShaderConstantI(UINT StartRegister, int* pConstantData, UINT Vector4iCount);
|
||||
HRESULT STDMETHODCALLTYPE SetPixelShaderConstantB(UINT StartRegister, CONST BOOL* pConstantData, UINT BoolCount);
|
||||
HRESULT STDMETHODCALLTYPE GetPixelShaderConstantB(UINT StartRegister, BOOL* pConstantData, UINT BoolCount);
|
||||
HRESULT STDMETHODCALLTYPE DrawRectPatch(UINT Handle, CONST float* pNumSegs, CONST D3DRECTPATCH_INFO* pRectPatchInfo);
|
||||
HRESULT STDMETHODCALLTYPE DrawTriPatch(UINT Handle, CONST float* pNumSegs, CONST D3DTRIPATCH_INFO* pTriPatchInfo);
|
||||
HRESULT STDMETHODCALLTYPE DeletePatch(UINT Handle);
|
||||
HRESULT STDMETHODCALLTYPE CreateQuery(D3DQUERYTYPE Type, IDirect3DQuery9** ppQuery);
|
||||
#pragma endregion
|
||||
#pragma region IDirect3DDevice9Ex
|
||||
HRESULT STDMETHODCALLTYPE SetConvolutionMonoKernel(THIS_ UINT width, UINT height, float* rows, float* columns);
|
||||
HRESULT STDMETHODCALLTYPE ComposeRects(THIS_ IDirect3DSurface9* pSrc, IDirect3DSurface9* pDst, IDirect3DVertexBuffer9* pSrcRectDescs, UINT NumRects, IDirect3DVertexBuffer9* pDstRectDescs, D3DCOMPOSERECTSOP Operation, int Xoffset, int Yoffset);
|
||||
HRESULT STDMETHODCALLTYPE PresentEx(THIS_ CONST RECT* pSourceRect, CONST RECT* pDestRect, HWND hDestWindowOverride, CONST RGNDATA* pDirtyRegion, DWORD dwFlags);
|
||||
HRESULT STDMETHODCALLTYPE GetGPUThreadPriority(THIS_ INT* pPriority);
|
||||
HRESULT STDMETHODCALLTYPE SetGPUThreadPriority(THIS_ INT Priority);
|
||||
HRESULT STDMETHODCALLTYPE WaitForVBlank(THIS_ UINT iSwapChain);
|
||||
HRESULT STDMETHODCALLTYPE CheckResourceResidency(THIS_ IDirect3DResource9** pResourceArray, UINT32 NumResources);
|
||||
HRESULT STDMETHODCALLTYPE SetMaximumFrameLatency(THIS_ UINT MaxLatency);
|
||||
HRESULT STDMETHODCALLTYPE GetMaximumFrameLatency(THIS_ UINT* pMaxLatency);
|
||||
HRESULT STDMETHODCALLTYPE CheckDeviceState(THIS_ HWND hDestinationWindow);
|
||||
HRESULT STDMETHODCALLTYPE CreateRenderTargetEx(THIS_ UINT Width, UINT Height, D3DFORMAT Format, D3DMULTISAMPLE_TYPE MultiSample, DWORD MultisampleQuality, BOOL Lockable, IDirect3DSurface9** ppSurface, HANDLE* pSharedHandle, DWORD Usage);
|
||||
HRESULT STDMETHODCALLTYPE CreateOffscreenPlainSurfaceEx(THIS_ UINT Width, UINT Height, D3DFORMAT Format, D3DPOOL Pool, IDirect3DSurface9** ppSurface, HANDLE* pSharedHandle, DWORD Usage);
|
||||
HRESULT STDMETHODCALLTYPE CreateDepthStencilSurfaceEx(THIS_ UINT Width, UINT Height, D3DFORMAT Format, D3DMULTISAMPLE_TYPE MultiSample, DWORD MultisampleQuality, BOOL Discard, IDirect3DSurface9** ppSurface, HANDLE* pSharedHandle, DWORD Usage);
|
||||
HRESULT STDMETHODCALLTYPE ResetEx(THIS_ D3DPRESENT_PARAMETERS* pPresentationParameters, D3DDISPLAYMODEEX* pFullscreenDisplayMode);
|
||||
HRESULT STDMETHODCALLTYPE GetDisplayModeEx(THIS_ UINT iSwapChain, D3DDISPLAYMODEEX* pMode, D3DDISPLAYROTATION* pRotation);
|
||||
#pragma endregion
|
||||
|
||||
public:
|
||||
hkIDirect3DDevice9(IDirect3DDevice9 *pIDirect3DDevice9)
|
||||
: m_pWrapped(pIDirect3DDevice9)
|
||||
{
|
||||
}
|
||||
|
||||
private:
|
||||
~hkIDirect3DDevice9()
|
||||
hkIDirect3DDevice9(IDirect3DDevice9Ex* pIDirect3DDevice9, bool is_ex)
|
||||
: m_pWrapped(pIDirect3DDevice9), m_is_ex(is_ex)
|
||||
{
|
||||
m_pWrapped->Release();
|
||||
}
|
||||
|
||||
LONG m_refCount = 1;
|
||||
IDirect3DDevice9* m_pWrapped;
|
||||
virtual ~hkIDirect3DDevice9() { }
|
||||
|
||||
private:
|
||||
IDirect3DDevice9Ex* m_pWrapped;
|
||||
ULONG m_ref = 1;
|
||||
bool m_is_ex = false;
|
||||
};
|
||||
|
||||
|
|
|
@ -1,104 +0,0 @@
|
|||
// wrapper for IDirect3DVertexBuffer9 in d3d9.h
|
||||
// generated using wrapper_gen.rb
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "Context.h"
|
||||
|
||||
#include "IDirect3D9.h"
|
||||
#include "IDirect3DDevice9.h"
|
||||
#include "IDirect3DVertexBuffer9.h"
|
||||
|
||||
#define IDirect3DVertexBuffer9_PrintLog(format, ...) PrintLog(format, __VA_ARGS__);
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DVertexBuffer9::QueryInterface(REFIID riid, void** ppvObj) {
|
||||
IDirect3DVertexBuffer9_PrintLog(__FUNCTION__);
|
||||
if (ppvObj == nullptr) return E_POINTER;
|
||||
|
||||
if (riid == __uuidof(IUnknown) ||
|
||||
riid == __uuidof(IDirect3DResource9) ||
|
||||
riid == __uuidof(IDirect3DVertexBuffer9))
|
||||
{
|
||||
*ppvObj = static_cast<IDirect3DVertexBuffer9*>(this);
|
||||
AddRef();
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
*ppvObj = nullptr;
|
||||
return E_NOINTERFACE;
|
||||
}
|
||||
|
||||
ULONG APIENTRY hkIDirect3DVertexBuffer9::AddRef() {
|
||||
IDirect3DVertexBuffer9_PrintLog(__FUNCTION__);
|
||||
return _InterlockedIncrement(&m_refCount);
|
||||
}
|
||||
|
||||
ULONG APIENTRY hkIDirect3DVertexBuffer9::Release() {
|
||||
IDirect3DVertexBuffer9_PrintLog(__FUNCTION__);
|
||||
const LONG ref = _InterlockedDecrement(&m_refCount);
|
||||
if (ref == 0)
|
||||
{
|
||||
delete this;
|
||||
}
|
||||
return ref;
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DVertexBuffer9::GetDevice(IDirect3DDevice9** ppDevice) {
|
||||
IDirect3DVertexBuffer9_PrintLog(__FUNCTION__);
|
||||
|
||||
if (ppDevice == nullptr)
|
||||
return D3DERR_INVALIDCALL;
|
||||
|
||||
m_pIDirect3DDevice9->AddRef();
|
||||
*ppDevice = m_pIDirect3DDevice9;
|
||||
return D3D_OK;
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DVertexBuffer9::SetPrivateData(REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags) {
|
||||
IDirect3DVertexBuffer9_PrintLog(__FUNCTION__ " %s", GUIDtoStringA(refguid));
|
||||
return m_pWrapped->SetPrivateData(refguid, pData, SizeOfData, Flags);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DVertexBuffer9::GetPrivateData(REFGUID refguid, void* pData, DWORD* pSizeOfData) {
|
||||
IDirect3DVertexBuffer9_PrintLog(__FUNCTION__ " %s", GUIDtoStringA(refguid));
|
||||
return m_pWrapped->GetPrivateData(refguid, pData, pSizeOfData);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DVertexBuffer9::FreePrivateData(REFGUID refguid) {
|
||||
IDirect3DVertexBuffer9_PrintLog(__FUNCTION__);
|
||||
return m_pWrapped->FreePrivateData(refguid);
|
||||
}
|
||||
|
||||
DWORD APIENTRY hkIDirect3DVertexBuffer9::SetPriority(DWORD PriorityNew) {
|
||||
IDirect3DVertexBuffer9_PrintLog(__FUNCTION__);
|
||||
return m_pWrapped->SetPriority(PriorityNew);
|
||||
}
|
||||
|
||||
DWORD APIENTRY hkIDirect3DVertexBuffer9::GetPriority() {
|
||||
IDirect3DVertexBuffer9_PrintLog(__FUNCTION__);
|
||||
return m_pWrapped->GetPriority();
|
||||
}
|
||||
|
||||
void APIENTRY hkIDirect3DVertexBuffer9::PreLoad() {
|
||||
IDirect3DVertexBuffer9_PrintLog(__FUNCTION__);
|
||||
return m_pWrapped->PreLoad();
|
||||
}
|
||||
|
||||
D3DRESOURCETYPE APIENTRY hkIDirect3DVertexBuffer9::GetType() {
|
||||
IDirect3DVertexBuffer9_PrintLog(__FUNCTION__);
|
||||
return m_pWrapped->GetType();
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DVertexBuffer9::Lock(UINT OffsetToLock, UINT SizeToLock, void** ppbData, DWORD Flags) {
|
||||
IDirect3DVertexBuffer9_PrintLog(__FUNCTION__);
|
||||
return m_pWrapped->Lock(OffsetToLock, SizeToLock, ppbData, Flags);
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DVertexBuffer9::Unlock() {
|
||||
IDirect3DVertexBuffer9_PrintLog(__FUNCTION__);
|
||||
return m_pWrapped->Unlock();
|
||||
}
|
||||
|
||||
HRESULT APIENTRY hkIDirect3DVertexBuffer9::GetDesc(D3DVERTEXBUFFER_DESC *pDesc) {
|
||||
IDirect3DVertexBuffer9_PrintLog(__FUNCTION__);
|
||||
return m_pWrapped->GetDesc(pDesc);
|
||||
}
|
|
@ -1,42 +0,0 @@
|
|||
// wrapper for IDirect3DVertexBuffer9 in d3d9.h
|
||||
// generated using wrapper_gen.rb
|
||||
|
||||
#pragma once
|
||||
#include "d3d9.h"
|
||||
|
||||
interface hkIDirect3DVertexBuffer9 final : public IDirect3DVertexBuffer9 {
|
||||
public:
|
||||
/*** IUnknown methods ***/
|
||||
STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj);
|
||||
STDMETHOD_(ULONG, AddRef)(THIS);
|
||||
STDMETHOD_(ULONG, Release)(THIS);
|
||||
|
||||
/*** IDirect3DResource9 methods ***/
|
||||
STDMETHOD(GetDevice)(THIS_ IDirect3DDevice9** ppDevice);
|
||||
STDMETHOD(SetPrivateData)(THIS_ REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags);
|
||||
STDMETHOD(GetPrivateData)(THIS_ REFGUID refguid, void* pData, DWORD* pSizeOfData);
|
||||
STDMETHOD(FreePrivateData)(THIS_ REFGUID refguid);
|
||||
STDMETHOD_(DWORD, SetPriority)(THIS_ DWORD PriorityNew);
|
||||
STDMETHOD_(DWORD, GetPriority)(THIS);
|
||||
STDMETHOD_(void, PreLoad)(THIS);
|
||||
STDMETHOD_(D3DRESOURCETYPE, GetType)(THIS);
|
||||
STDMETHOD(Lock)(THIS_ UINT OffsetToLock, UINT SizeToLock, void** ppbData, DWORD Flags);
|
||||
STDMETHOD(Unlock)(THIS);
|
||||
STDMETHOD(GetDesc)(THIS_ D3DVERTEXBUFFER_DESC* pDesc);
|
||||
|
||||
public:
|
||||
hkIDirect3DVertexBuffer9(IDirect3DDevice9* pIDirect3DDevice9, IDirect3DVertexBuffer9* pIDirect3DVertexBuffer9)
|
||||
: m_pWrapped(pIDirect3DVertexBuffer9), m_pIDirect3DDevice9(pIDirect3DDevice9)
|
||||
{}
|
||||
|
||||
private:
|
||||
~hkIDirect3DVertexBuffer9()
|
||||
{
|
||||
m_pWrapped->Release();
|
||||
}
|
||||
|
||||
LONG m_refCount = 1;
|
||||
IDirect3DVertexBuffer9 *m_pWrapped;
|
||||
IDirect3DDevice9* m_pIDirect3DDevice9;
|
||||
};
|
||||
|
|
@ -1,28 +1,109 @@
|
|||
#ifdef SETTING
|
||||
|
||||
SETTING(u32, LongValue, PresentationInterval, Options, 1);
|
||||
SETTING(bool, BoolValue, TripleBuffering, Options, true);
|
||||
SETTING(u32, LongValue, FullScreenRefreshRate, Options, 0);
|
||||
SETTING(u32, LongValue, SwapEffect, Options, -1);
|
||||
SETTING(bool, BoolValue, AlwaysActive, Options, false);
|
||||
SETTING(bool, BoolValue, AutoFix, Options, true);
|
||||
SETTING(u32, LongValue, Multisample, Options, 0);
|
||||
SETTING(bool, BoolValue, HideCursor, Options, false);
|
||||
SETTING(bool, BoolValue, ForceHideCursor, Options, false);
|
||||
SETTING(u32, LongValue, BehaviorFlags, Options, 0);
|
||||
SETTING(s32, LongValue, PresentationInterval, Options, 0,
|
||||
L"# PresentationInterval (V-Sync)\n"
|
||||
L"#\n"
|
||||
L"# -1 = V-Sync forced off\n"
|
||||
L"# 0 = V-Sync not changed (default)\n"
|
||||
L"# 1 = V-Sync forced on"
|
||||
);
|
||||
|
||||
SETTING(double, DoubleValue, FFXIIIIngameFrameRateLimit, Options, 0.0);
|
||||
SETTING(bool, BoolValue, FFXIIIDisableIngameControllerHotSwapping, Options, true);
|
||||
SETTING(bool, BoolValue, FFXIIIEnableControllerVibration, Options, true);
|
||||
SETTING(s32, LongValue, TripleBuffering, Options, -1,
|
||||
L"# TripleBuffering\n"
|
||||
L"#\n"
|
||||
L"# -1 = Auto (Disabled for dxvk.dll; else, enabled) (default)\n"
|
||||
L"# 0 = Off\n"
|
||||
L"# 1 = On"
|
||||
);
|
||||
|
||||
SETTING(s32, LongValue, FullScreenRefreshRate, Options, 0,
|
||||
L"# FullScreenRefreshRate\n"
|
||||
L"#\n"
|
||||
L"# If you are not using any adaptive sync technology (e.g. FreeSync/Gsync) you may want to set this to the highest\n"
|
||||
L"# multiple of your frame rate that your monitor can handle to improve frame pacing.\n"
|
||||
L"# i.e. if you are using a 60FPS cap, you can possibly improve the frame pacing when you are reaching the cap\n"
|
||||
L"# by using refresh rates 60, 120, 180, 240...\n"
|
||||
L"#\n"
|
||||
L"# 0 = Same as configured in the operating system\n"
|
||||
L"# other = Use the number provided as the display refresh rate (in Hz)"
|
||||
);
|
||||
|
||||
SETTING(s32, LongValue, SwapEffect, Options, -1, 0);
|
||||
SETTING(bool, BoolValue, AlwaysActive, Options, false, 0);
|
||||
SETTING(bool, BoolValue, AutoFix, Options, true, 0);
|
||||
SETTING(s32, LongValue, Multisample, Options, 0, 0);
|
||||
SETTING(bool, BoolValue, HideCursor, Options, false, 0);
|
||||
SETTING(bool, BoolValue, ForceHideCursor, Options, false, 0);
|
||||
SETTING(u32, LongValue, BehaviorFlags, Options, 0, 0);
|
||||
|
||||
SETTING(s32, LongValue, IngameFrameRateLimit, FFXIII, 0,
|
||||
L"# IngameFrameRateLimit\n"
|
||||
L"#\n"
|
||||
L"# Using higher numbers may cause noticiable facial animation jankness during cutscenes.\n"
|
||||
L"# See https://github.com/rebtd7/FF13Fix/issues/3\n"
|
||||
L"#\n"
|
||||
L"# Note that the frame pacer is always disabled by this mod, regardless of the value this option is set.\n"
|
||||
L"#\n"
|
||||
L"# -1 = Use the maximum FPS cap possible\n"
|
||||
L"# 0 = Use the game's default FPS limit (59.94005966 FPS)\n"
|
||||
L"# other = Use the number provided as the FPS limit (e.g. set 30 to limit to 30 FPS)"
|
||||
);
|
||||
SETTING(bool, BoolValue, DiscardUIVertexBuffer, FFXIII, false,
|
||||
L"# DiscardUIVertexBuffer (EXPERIMENTAL!)\n"
|
||||
L"#\n"
|
||||
L"# Discards UI vertex buffer to improve performance\n"
|
||||
L"#\n"
|
||||
L"# false = default, do not hook and discard vertex buffer\n"
|
||||
L"# true = hook and discard vertex buffer"
|
||||
);
|
||||
SETTING(bool, BoolValue, DisableIngameControllerHotSwapping, FFXIII, true,
|
||||
L"# DisableIngameControllerHotSwapping\n"
|
||||
L"#\n"
|
||||
L"# By default FF13Fix disables the game's continuous controller scanning that causes stuttering (especially if you do not have any controller connected)\n"
|
||||
L"# If you with you can enable it again (by setting the config to 'false', so you can re-connect your controller while playing.\n"
|
||||
L"# Note that EnableControllerVibration is incompatible with the controller hotswapping, \n"
|
||||
L"# so it is automatically disabled if DisableIngameControllerHotSwapping is set to 'false'"
|
||||
);
|
||||
SETTING(bool, BoolValue, EnableControllerVibration, FFXIII, true,
|
||||
L"# EnableControllerVibration\n"
|
||||
L"#\n"
|
||||
L"# Enables controller vibration on the first connected XInput device."
|
||||
);
|
||||
SETTING(bool, DoubleValue, VibrationStrengthFactor, FFXIII, 2.0,
|
||||
L"# VibrationStrengthFactor\n"
|
||||
L"#\n"
|
||||
L"# Higher numbers = stronger vibration"
|
||||
);
|
||||
|
||||
SETTING(bool, BoolValue, Adapter, Adapter, false, 0);
|
||||
SETTING(u32, LongValue, VendorId, Adapter, 0, 0);
|
||||
SETTING(u32, LongValue, DeviceId, Adapter, 0, 0);
|
||||
|
||||
SETTING(bool, BoolValue, TopMost, Window, false, 0);
|
||||
SETTING(std::wstring, StringValue, WindowClass, Window, L"", 0);
|
||||
SETTING(std::wstring, StringValue, WindowName, Window, L"", 0);
|
||||
|
||||
SETTING(bool, BoolValue, Borderless, Borderless, false, 0);
|
||||
SETTING(bool, BoolValue, ForceWindowedMode, Borderless, false, 0);
|
||||
SETTING(bool, BoolValue, AllWindows, Borderless, false, 0);
|
||||
|
||||
SETTING(s32, LongValue, LogLevel, Log, 2,
|
||||
L"# LogLevel\n"
|
||||
L"#\n"
|
||||
L"# 0 = trace\n"
|
||||
L"# 1 = debug\n"
|
||||
L"# 2 = info (default)\n"
|
||||
L"# 3 = warning\n"
|
||||
L"# 4 = error\n"
|
||||
L"# 5 = critical"
|
||||
);
|
||||
|
||||
SETTING(bool, BoolValue, LogFlush, Log, false,
|
||||
L"# LogFlush\n"
|
||||
L"#\n"
|
||||
L"# true = flush log file every line (very slow!)\n"
|
||||
L"# false = flush log file only when error level message is logged (default)"
|
||||
);
|
||||
|
||||
|
||||
SETTING(bool, BoolValue, Adapter, Adapter, false);
|
||||
SETTING(u32, LongValue, VendorId, Adapter, 0);
|
||||
SETTING(u32, LongValue, DeviceId, Adapter, 0);
|
||||
|
||||
SETTING(bool, BoolValue, Borderless, Borderless, false);
|
||||
SETTING(bool, BoolValue, ForceWindowedMode, Borderless, false);
|
||||
SETTING(bool, BoolValue, AllWindows, Borderless, false);
|
||||
SETTING(bool, BoolValue, TopMost, Borderless, false);
|
||||
SETTING(std::wstring, StringValue, WindowClass, Borderless, L"");
|
||||
SETTING(std::wstring, StringValue, WindowName, Borderless, L"");
|
||||
|
||||
#endif
|
||||
|
|
32
d3d9ex/VertexFix.cpp
Normal file
32
d3d9ex/VertexFix.cpp
Normal file
|
@ -0,0 +1,32 @@
|
|||
#define CINTERFACE
|
||||
#include <d3d9.h>
|
||||
|
||||
#include "spdlog/spdlog.h"
|
||||
#include "MinHook.h"
|
||||
|
||||
namespace cinterface
|
||||
{
|
||||
HRESULT(STDMETHODCALLTYPE* TrueLock)(IDirect3DVertexBuffer9* This, UINT OffsetToLock, UINT SizeToLock, void** ppbData, DWORD Flags) = nullptr;
|
||||
|
||||
HRESULT STDMETHODCALLTYPE HookLock(IDirect3DVertexBuffer9* This, UINT OffsetToLock, UINT SizeToLock, void** ppbData, DWORD Flags)
|
||||
{
|
||||
spdlog::trace(__FUNCTION__" {}", SizeToLock);
|
||||
if (SizeToLock == 358400)
|
||||
Flags = D3DLOCK_DISCARD;
|
||||
return TrueLock(This, OffsetToLock, SizeToLock, ppbData, Flags);
|
||||
}
|
||||
|
||||
void VertexBufferFix(IDirect3DVertexBuffer9* pVertexBuffer)
|
||||
{
|
||||
if (pVertexBuffer->lpVtbl->Lock && TrueLock == nullptr)
|
||||
{
|
||||
spdlog::warn("Experimental DiscardUIVertexBuffer enabled!");
|
||||
const MH_STATUS createHookLock = MH_CreateHook(pVertexBuffer->lpVtbl->Lock, HookLock, reinterpret_cast<void**>(&TrueLock));
|
||||
spdlog::info("CreateHookLock = {}", createHookLock);
|
||||
const MH_STATUS enableHookLock = MH_EnableHook(pVertexBuffer->lpVtbl->Lock);
|
||||
spdlog::info("EnableHookLock = {}", enableHookLock);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
160
d3d9ex/Wrapper.h
160
d3d9ex/Wrapper.h
|
@ -1,10 +1,9 @@
|
|||
#pragma once
|
||||
|
||||
#include "comdef.h"
|
||||
#include <comdef.h>
|
||||
#include <d3d9.h>
|
||||
|
||||
#include "d3d9.h"
|
||||
#include "dinput.h"
|
||||
#include "xinput.h"
|
||||
#include "StringUtil.h"
|
||||
|
||||
template <class T>
|
||||
class WrapperBase
|
||||
|
@ -20,7 +19,7 @@ public:
|
|||
if (m_module)
|
||||
{
|
||||
FreeLibrary(m_module);
|
||||
PrintLog("Unloaded %s", module_path.c_str());
|
||||
spdlog::info("Unloaded {}", module_path);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -31,24 +30,26 @@ public:
|
|||
}
|
||||
|
||||
protected:
|
||||
void WrapperLoad(const char* module_name)
|
||||
bool WrapperLoad(const char* module_name, bool use_system_dir = true, bool fail_is_critical = true)
|
||||
{
|
||||
module_path = CreateSystemModulePath(module_name);
|
||||
use_system_dir ? module_path = CreateSystemModulePath(module_name) : module_path = module_name;
|
||||
m_module = LoadLibraryA(module_path.c_str());
|
||||
|
||||
if (!m_module)
|
||||
{
|
||||
if (m_module) {
|
||||
spdlog::info("Loaded {}", module_path);
|
||||
return true;
|
||||
}
|
||||
else if(fail_is_critical) {
|
||||
HRESULT hr = HRESULT_FROM_WIN32(GetLastError());
|
||||
_com_error err(hr);
|
||||
|
||||
std::string msg = StringFromFormat("Cannot load %s\nHRESULT 0x%08X: \"%s\"", module_path.c_str(), err.Error(), err.ErrorMessage());
|
||||
std::string msg = StringFromFormat("Cannot load %s\nHRESULT 0x{:X} \"{}\"", module_path.c_str(), err.Error(), err.ErrorMessage());
|
||||
|
||||
PrintLog(msg.c_str());
|
||||
spdlog::critical(msg);
|
||||
MessageBoxA(NULL, msg.c_str(), "Error", MB_ICONERROR);
|
||||
ExitProcess(hr);
|
||||
}
|
||||
|
||||
PrintLog("Loaded %s", module_path.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
|
@ -77,9 +78,18 @@ public:
|
|||
void (WINAPI* D3DPERF_SetOptions)(DWORD dwOptions);
|
||||
void (WINAPI* D3DPERF_SetRegion)(D3DCOLOR col, LPCWSTR wszName);
|
||||
|
||||
bool IsDXVK() { return m_isdxvk; }
|
||||
|
||||
D3D9DLL()
|
||||
{
|
||||
WrapperLoad("d3d9.dll");
|
||||
m_isdxvk = WrapperLoad("dxvk.dll", false, false);
|
||||
|
||||
if (!m_isdxvk) {
|
||||
const bool isreshade = WrapperLoad("ReShade32.dll", false, false);
|
||||
if (!isreshade) {
|
||||
WrapperLoad("d3d9.dll");
|
||||
}
|
||||
}
|
||||
|
||||
StoreAddress(&Direct3DCreate9, "Direct3DCreate9");
|
||||
StoreAddress(&Direct3DCreate9Ex, "Direct3DCreate9Ex");
|
||||
|
@ -93,17 +103,20 @@ public:
|
|||
StoreAddress(&D3DPERF_SetOptions, "D3DPERF_SetOptions");
|
||||
StoreAddress(&D3DPERF_SetRegion, "D3DPERF_SetRegion");
|
||||
}
|
||||
|
||||
private:
|
||||
bool m_isdxvk = false;
|
||||
};
|
||||
|
||||
extern "C"
|
||||
{
|
||||
|
||||
IDirect3D9 * WINAPI _Direct3DCreate9(UINT SDKVersion)
|
||||
IDirect3D9* WINAPI _Direct3DCreate9(UINT SDKVersion)
|
||||
{
|
||||
return D3D9DLL::Get().Direct3DCreate9(SDKVersion);
|
||||
}
|
||||
|
||||
HRESULT WINAPI _Direct3DCreate9Ex(UINT SDKVersion, IDirect3D9Ex **ppD3D)
|
||||
HRESULT WINAPI _Direct3DCreate9Ex(UINT SDKVersion, IDirect3D9Ex** ppD3D)
|
||||
{
|
||||
return D3D9DLL::Get().Direct3DCreate9Ex(SDKVersion, ppD3D);
|
||||
}
|
||||
|
@ -143,118 +156,3 @@ extern "C"
|
|||
return D3D9DLL::Get().D3DPERF_SetRegion(col, wszName);
|
||||
}
|
||||
}
|
||||
|
||||
class DINPUT8DLL : public WrapperBase<DINPUT8DLL>
|
||||
{
|
||||
public:
|
||||
|
||||
HRESULT (WINAPI* DirectInput8Create)(HINSTANCE hinst, DWORD dwVersion, REFIID riidltf, LPVOID *ppvOut, LPUNKNOWN punkOuter);
|
||||
|
||||
DINPUT8DLL()
|
||||
{
|
||||
WrapperLoad("dinput8.dll");
|
||||
|
||||
StoreAddress(&DirectInput8Create, "DirectInput8Create");
|
||||
}
|
||||
};
|
||||
|
||||
extern "C"
|
||||
{
|
||||
HRESULT WINAPI _DirectInput8Create(HINSTANCE hinst, DWORD dwVersion, REFIID riidltf, LPVOID *ppvOut, LPUNKNOWN punkOuter)
|
||||
{
|
||||
return DINPUT8DLL::Get().DirectInput8Create(hinst, dwVersion, riidltf, ppvOut, punkOuter);
|
||||
}
|
||||
}
|
||||
|
||||
class XINPUTDLL : public WrapperBase<XINPUTDLL>
|
||||
{
|
||||
public:
|
||||
|
||||
// XInput 1.3 and older functions
|
||||
DWORD(WINAPI* XInputGetState)(DWORD dwUserIndex, XINPUT_STATE* pState);
|
||||
DWORD(WINAPI* XInputSetState)(DWORD dwUserIndex, XINPUT_VIBRATION* pVibration);
|
||||
DWORD(WINAPI* XInputGetCapabilities)(DWORD dwUserIndex, DWORD dwFlags, XINPUT_CAPABILITIES* pCapabilities);
|
||||
VOID(WINAPI* XInputEnable)(BOOL enable);
|
||||
DWORD(WINAPI* XInputGetDSoundAudioDeviceGuids)(DWORD dwUserIndex, GUID* pDSoundRenderGuid, GUID* pDSoundCaptureGuid);
|
||||
DWORD(WINAPI* XInputGetBatteryInformation)(DWORD dwUserIndex, uint8_t devType, XINPUT_BATTERY_INFORMATION* pBatteryInformation);
|
||||
DWORD(WINAPI* XInputGetKeystroke)(DWORD dwUserIndex, DWORD dwReserved, PXINPUT_KEYSTROKE pKeystroke);
|
||||
|
||||
// XInput 1.3 undocumented functions
|
||||
DWORD(WINAPI* XInputGetStateEx)(DWORD dwUserIndex, XINPUT_STATE *pState); // 100
|
||||
DWORD(WINAPI* XInputWaitForGuideButton)(DWORD dwUserIndex, DWORD dwFlag, LPVOID pVoid); // 101
|
||||
DWORD(WINAPI* XInputCancelGuideButtonWait)(DWORD dwUserIndex); // 102
|
||||
DWORD(WINAPI* XInputPowerOffController)(DWORD dwUserIndex); // 103
|
||||
|
||||
// XInput 1.4 functions
|
||||
DWORD(WINAPI* XInputGetAudioDeviceIds)(DWORD dwUserIndex, LPWSTR pRenderDeviceId, UINT* pRenderCount, LPWSTR pCaptureDeviceId, UINT* pCaptureCount);
|
||||
|
||||
// XInput 1.4 undocumented functionss
|
||||
DWORD(WINAPI* XInputGetBaseBusInformation)(DWORD dwUserIndex, struct XINPUT_BUSINFO* pBusinfo); // 104
|
||||
DWORD(WINAPI* XInputGetCapabilitiesEx)(DWORD unk1, DWORD dwUserIndex, DWORD dwFlags, struct XINPUT_CAPABILITIESEX* pCapabilitiesEx); // 108
|
||||
|
||||
XINPUTDLL()
|
||||
{
|
||||
WrapperLoad("xinput1_3.dll");
|
||||
|
||||
// XInput 1.3 and older functions
|
||||
StoreAddress(&XInputGetState, "XInputGetState");
|
||||
StoreAddress(&XInputSetState, "XInputSetState");
|
||||
StoreAddress(&XInputGetCapabilities, "XInputGetCapabilities");
|
||||
StoreAddress(&XInputEnable, "XInputEnable");
|
||||
StoreAddress(&XInputGetDSoundAudioDeviceGuids, "XInputGetDSoundAudioDeviceGuids");
|
||||
StoreAddress(&XInputGetBatteryInformation, "XInputGetBatteryInformation");
|
||||
StoreAddress(&XInputGetKeystroke, "XInputGetKeystroke");
|
||||
|
||||
// XInput 1.3 undocumented functions
|
||||
StoreAddress(&XInputGetStateEx, (const char*)100);
|
||||
StoreAddress(&XInputWaitForGuideButton, (const char*)101);
|
||||
StoreAddress(&XInputCancelGuideButtonWait, (const char*)102);
|
||||
StoreAddress(&XInputPowerOffController, (const char*)103);
|
||||
|
||||
// XInput 1.4 functions
|
||||
StoreAddress(&XInputGetAudioDeviceIds, "XInputGetAudioDeviceIds");
|
||||
|
||||
// XInput 1.4 undocumented functionss
|
||||
StoreAddress(&XInputGetBaseBusInformation, (const char*)104);
|
||||
StoreAddress(&XInputGetCapabilitiesEx, (const char*)108);
|
||||
}
|
||||
};
|
||||
|
||||
extern "C"
|
||||
{
|
||||
// XInput 1.3 and older functions
|
||||
DWORD WINAPI _XInputGetState(DWORD dwUserIndex, XINPUT_STATE* pState)
|
||||
{
|
||||
return XINPUTDLL::Get().XInputGetState(dwUserIndex, pState);
|
||||
}
|
||||
|
||||
DWORD WINAPI _XInputSetState(DWORD dwUserIndex, XINPUT_VIBRATION* pVibration)
|
||||
{
|
||||
return XINPUTDLL::Get().XInputSetState(dwUserIndex, pVibration);
|
||||
}
|
||||
|
||||
DWORD WINAPI _XInputGetCapabilities(DWORD dwUserIndex, DWORD dwFlags, XINPUT_CAPABILITIES* pCapabilities)
|
||||
{
|
||||
return XINPUTDLL::Get().XInputGetCapabilities(dwUserIndex, dwFlags, pCapabilities);
|
||||
}
|
||||
|
||||
VOID WINAPI _XInputEnable(BOOL enable)
|
||||
{
|
||||
return XINPUTDLL::Get().XInputEnable(enable);
|
||||
}
|
||||
|
||||
DWORD WINAPI _XInputGetDSoundAudioDeviceGuids(DWORD dwUserIndex, GUID* pDSoundRenderGuid, GUID* pDSoundCaptureGuid)
|
||||
{
|
||||
return XINPUTDLL::Get().XInputGetDSoundAudioDeviceGuids(dwUserIndex, pDSoundRenderGuid, pDSoundCaptureGuid);
|
||||
}
|
||||
|
||||
DWORD WINAPI _XInputGetBatteryInformation(DWORD dwUserIndex, uint8_t devType, XINPUT_BATTERY_INFORMATION* pBatteryInformation)
|
||||
{
|
||||
return XINPUTDLL::Get().XInputGetBatteryInformation(dwUserIndex, devType, pBatteryInformation);
|
||||
}
|
||||
|
||||
DWORD WINAPI _XInputGetKeystroke(DWORD dwUserIndex, DWORD dwReserved, PXINPUT_KEYSTROKE pKeystroke)
|
||||
{
|
||||
return XINPUTDLL::Get().XInputGetKeystroke(dwUserIndex, dwReserved, pKeystroke);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,8 +2,9 @@
|
|||
#include "XInputManager.h"
|
||||
#include <XInput.h>
|
||||
|
||||
XInputManager::XInputManager(uint8_t** base_controller_input_address_ptr)
|
||||
XInputManager::XInputManager(uint8_t** base_controller_input_address_ptr, const float vibrationStrengthFactor)
|
||||
{
|
||||
this->vibrationStrengthFactor = vibrationStrengthFactor;
|
||||
xinputThread = std::thread(&XInputManager::Run, this, base_controller_input_address_ptr);
|
||||
}
|
||||
|
||||
|
@ -46,11 +47,13 @@ void XInputManager::VibrationLoop()
|
|||
while (true) {
|
||||
const float vibrationStrengthLowFrequency = *vibration_address_low_frequency;
|
||||
const float vibrationStrengthHighFrequency = *vibration_address_high_frequency;
|
||||
if (vibrationStrengthLowFrequency > 0.0f || vibrationStrengthHighFrequency > 0.0f) {
|
||||
SetControllerVibration((WORD)(vibrationStrengthLowFrequency * maxVibrationStrength), (WORD)(vibrationStrengthHighFrequency * maxVibrationStrength));
|
||||
if (vibrationStrengthLowFrequency > 0.01f || vibrationStrengthHighFrequency > 0.01f) {
|
||||
const WORD leftMotorVibration = (WORD) (std::min(vibrationStrengthFactor * vibrationStrengthLowFrequency, 1.0f) * maxVibrationStrength);
|
||||
const WORD rightMotorVibration = (WORD) (std::min(vibrationStrengthFactor * vibrationStrengthHighFrequency, 1.0f) * maxVibrationStrength);
|
||||
SetControllerVibration(leftMotorVibration, rightMotorVibration);
|
||||
wasVibrating = true;
|
||||
}
|
||||
else if(wasVibrating) {
|
||||
else if (wasVibrating) {
|
||||
SetControllerVibration(0, 0);
|
||||
wasVibrating = false;
|
||||
}
|
||||
|
|
|
@ -2,11 +2,12 @@
|
|||
class XInputManager
|
||||
{
|
||||
float* vibration_address_high_frequency = NULL;
|
||||
float vibrationStrengthFactor;
|
||||
float* vibration_address_low_frequency = NULL;
|
||||
DWORD controllerId = -1;
|
||||
std::thread xinputThread;
|
||||
public:
|
||||
XInputManager(uint8_t** base_controller_input_address_ptr);
|
||||
XInputManager(uint8_t** base_controller_input_address_ptr, const float vibrationStrengthFactor);
|
||||
void Run(uint8_t** base_controller_input_address_ptr);
|
||||
void WaitAndSetVibrationAddress(uint8_t** base_controller_input_address_ptr);
|
||||
void VibrationLoop();
|
||||
|
|
|
@ -73,8 +73,8 @@
|
|||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<TargetName>dinput8</TargetName>
|
||||
<IncludePath>$(SolutionDir)\Common;$(SolutionDir)\MinHook\include;$(DXSDK_DIR)\Include;$(IncludePath)</IncludePath>
|
||||
<TargetName>d3d9</TargetName>
|
||||
<IncludePath>$(SolutionDir)\Common;$(SolutionDir)\Deps\MinHook\include;$(SolutionDir)\Deps\spdlog\include;$(IncludePath)</IncludePath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
|
@ -83,8 +83,8 @@
|
|||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<TargetName>dinput8</TargetName>
|
||||
<IncludePath>$(SolutionDir)\Common;$(SolutionDir)\MinHook\include;$(DXSDK_DIR)\Include;$(IncludePath)</IncludePath>
|
||||
<TargetName>d3d9</TargetName>
|
||||
<IncludePath>$(SolutionDir)\Common;$(SolutionDir)\Deps\MinHook\include;$(SolutionDir)\Deps\spdlog\include;$(IncludePath)</IncludePath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
|
@ -96,14 +96,17 @@
|
|||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;D3D9EX_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>WIN32;SPDLOG_DISABLE_DEFAULT_LOGGER;SPDLOG_WCHAR_TO_UTF8_SUPPORT;_DEBUG;_WINDOWS;_USRDLL;D3D9EX_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
<LanguageStandard>stdcpplatest</LanguageStandard>
|
||||
<AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ModuleDefinitionFile>exports.def</ModuleDefinitionFile>
|
||||
<AdditionalDependencies>d3d9.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>d3d9.lib;XINPUT9_1_0.LIB;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
|
@ -126,19 +129,22 @@
|
|||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;D3D9EX_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>WIN32;SPDLOG_DISABLE_DEFAULT_LOGGER;SPDLOG_WCHAR_TO_UTF8_SUPPORT;NDEBUG;_WINDOWS;_USRDLL;D3D9EX_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<LanguageStandard>stdcpplatest</LanguageStandard>
|
||||
<CreateHotpatchableImage>true</CreateHotpatchableImage>
|
||||
<AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<AdditionalDependencies>XINPUT9_1_0.LIB;d3d9.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<ModuleDefinitionFile>exports.def</ModuleDefinitionFile>
|
||||
<AdditionalDependencies>d3d9.lib;XINPUT9_1_0.LIB;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
|
@ -165,7 +171,6 @@
|
|||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="Context.h" />
|
||||
<ClInclude Include="IDirect3DVertexBuffer9.h" />
|
||||
<ClInclude Include="Wrapper.h" />
|
||||
<ClInclude Include="IDirect3D9.h" />
|
||||
<ClInclude Include="IDirect3DDevice9.h" />
|
||||
|
@ -193,20 +198,23 @@
|
|||
</ClCompile>
|
||||
<ClCompile Include="IDirect3D9.cpp" />
|
||||
<ClCompile Include="IDirect3DDevice9.cpp" />
|
||||
<ClCompile Include="IDirect3DVertexBuffer9.cpp" />
|
||||
<ClCompile Include="stdafx.cpp">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="VertexFix.cpp">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="XInputManager.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="exports.def" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\MinHook\build\VC15\libMinHook.vcxproj">
|
||||
<ProjectReference Include="..\Deps\MinHook\build\VC16\libMinHook.vcxproj">
|
||||
<Project>{f142a341-5ee0-442d-a15f-98ae9b48dbae}</Project>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
|
|
|
@ -33,16 +33,13 @@
|
|||
<ClInclude Include="Context.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Settings.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Wrapper.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="IDirect3DVertexBuffer9.h">
|
||||
<ClInclude Include="XInputManager.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="XInputManager.h">
|
||||
<ClInclude Include="Settings.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
|
@ -65,10 +62,10 @@
|
|||
<ClCompile Include="Context.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="IDirect3DVertexBuffer9.cpp">
|
||||
<ClCompile Include="XInputManager.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="XInputManager.cpp">
|
||||
<ClCompile Include="VertexFix.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
|
|
|
@ -11,12 +11,4 @@ D3DPERF_SetMarker=_D3DPERF_SetMarker @24
|
|||
D3DPERF_SetOptions=_D3DPERF_SetOptions @25
|
||||
D3DPERF_SetRegion=_D3DPERF_SetRegion @26
|
||||
|
||||
DirectInput8Create=_DirectInput8Create
|
||||
|
||||
XInputGetState=_XInputGetState @2
|
||||
XInputSetState=_XInputSetState @3
|
||||
XInputGetCapabilities=_XInputGetCapabilities @4
|
||||
XInputEnable=_XInputEnable @5
|
||||
XInputGetDSoundAudioDeviceGuids=_XInputGetDSoundAudioDeviceGuids @6
|
||||
XInputGetBatteryInformation=_XInputGetBatteryInformation @7
|
||||
XInputGetKeystroke=_XInputGetKeystroke @8
|
||||
|
|
|
@ -26,7 +26,4 @@
|
|||
#include <map>
|
||||
#include <unordered_map>
|
||||
|
||||
#include <d3d9.h>
|
||||
|
||||
#include "WinUtil.h"
|
||||
#include "Logger.h"
|
||||
#include "Context.h"
|
Loading…
Reference in a new issue