mirror of
https://github.com/keylase/nvidia-patch.git
synced 2024-08-30 18:32:50 +00:00
Merge pull request #209 from Snawoot/win_fbc_compat
Win: FBC: add 32bit compat library
This commit is contained in:
commit
26839ab5a3
@ -5,8 +5,12 @@ Wrapper for `NvFBC64.dll` library which injects private keys into `NvFBC_CreateE
|
|||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
1. Obtain `nvfbcwrp.dll` file. You may build it yourself with MSVS 2019 or download latest release [here](https://gist.github.com/Snawoot/1edfbda9b0e91c46b6cc3d5a0e1e55a4/raw/ee2e4647753a731ac7b333a0c9681dc07d3ee0a1/nvfbcwrp.dll).
|
1. Obtain `nvfbcwrp64.dll` and `nvfbcwrp32.dll` files. You may build them yourself with MSVS 2019 or download latest release here: [nvfbcwrp64.dll](https://gist.github.com/Snawoot/2d78c569b5ffb29080cf9bfca401adfa/raw/166c5e10f8301000c171d5f59cc2ae0b551cd1b3/nvfbcwrp64.dll), [nvfbcwrp32.dll](https://gist.github.com/Snawoot/2d78c569b5ffb29080cf9bfca401adfa/raw/166c5e10f8301000c171d5f59cc2ae0b551cd1b3/nvfbcwrp32.dll).
|
||||||
2. Backup your `%WINDIR\system32\NvFBC64.dll` file.
|
2. Backup your `%WINDIR\system32\NvFBC64.dll` and `%WINDIR\SysWOW64\NvFBC.dll` files.
|
||||||
3. Rename file `%WINDIR\system32\NvFBC64.dll` to `%WINDIR\system32\NvFBC64_.dll`
|
3. Rename file `%WINDIR\system32\NvFBC64.dll` to `%WINDIR\system32\NvFBC64_.dll`
|
||||||
4. Put `nvfbcwrp.dll` to `%WINDIR\system32\NvFBC64.dll` (on the original place of renamed `NvFBC64.dll` library).
|
4. Rename file `%WINDIR\SysWOW64\NvFBC.dll` to `%WINDIR\SysWOW64\NvFBC_.dll`
|
||||||
5. Restart any applications using this library. That's it.
|
5. Rename `nvfbcwrp64.dll` and put it to `%WINDIR\system32\NvFBC64.dll` (on the original place of renamed `NvFBC64.dll` library).
|
||||||
|
6. Rename `nvfbcwrp32.dll` and put it to `%WINDIR\SysWOW64\NvFBC.dll` (on the original place of renamed `NvFBC.dll` library).
|
||||||
|
7. Restart any applications using this library. That's it.
|
||||||
|
|
||||||
|
This procedure has to be repeated after any driver reinstall/update, so keep your copies of `nvfbcwrp64.dll` and `nvfbcwrp32.dll` files.
|
||||||
|
@ -1,37 +1,43 @@
|
|||||||
|
IFDEF RAX
|
||||||
|
ptrsz equ <qword>
|
||||||
|
ELSE
|
||||||
|
.486
|
||||||
|
.model flat, c
|
||||||
|
ptrsz equ <dword>
|
||||||
|
ENDIF
|
||||||
.data
|
.data
|
||||||
|
extern ORIG_NvFBC_Create : ptrsz, ORIG_NvFBC_Enable : ptrsz,
|
||||||
extern ORIG_NvFBC_Create : qword, ORIG_NvFBC_Enable : qword,
|
ORIG_NvFBC_GetSDKVersion : ptrsz, ORIG_NvFBC_GetStatus : ptrsz,
|
||||||
ORIG_NvFBC_GetSDKVersion : qword, ORIG_NvFBC_GetStatus : qword,
|
ORIG_NvFBC_GetStatusEx : ptrsz, ORIG_NvFBC_SetGlobalFlags : ptrsz,
|
||||||
ORIG_NvFBC_GetStatusEx : qword, ORIG_NvFBC_SetGlobalFlags : qword,
|
ORIG_NvOptimusEnablement : ptrsz
|
||||||
ORIG_NvOptimusEnablement : qword
|
|
||||||
|
|
||||||
.code
|
.code
|
||||||
PROXY_NvFBC_Create proc
|
PROXY_NvFBC_Create proc
|
||||||
jmp qword ptr [ORIG_NvFBC_Create]
|
jmp ptrsz ptr [ORIG_NvFBC_Create]
|
||||||
PROXY_NvFBC_Create endp
|
PROXY_NvFBC_Create endp
|
||||||
|
|
||||||
PROXY_NvFBC_Enable proc
|
PROXY_NvFBC_Enable proc
|
||||||
jmp qword ptr [ORIG_NvFBC_Enable]
|
jmp ptrsz ptr [ORIG_NvFBC_Enable]
|
||||||
PROXY_NvFBC_Enable endp
|
PROXY_NvFBC_Enable endp
|
||||||
|
|
||||||
PROXY_NvFBC_GetSDKVersion proc
|
PROXY_NvFBC_GetSDKVersion proc
|
||||||
jmp qword ptr [ORIG_NvFBC_GetSDKVersion]
|
jmp ptrsz ptr [ORIG_NvFBC_GetSDKVersion]
|
||||||
PROXY_NvFBC_GetSDKVersion endp
|
PROXY_NvFBC_GetSDKVersion endp
|
||||||
|
|
||||||
PROXY_NvFBC_GetStatus proc
|
PROXY_NvFBC_GetStatus proc
|
||||||
jmp qword ptr [ORIG_NvFBC_GetStatus]
|
jmp ptrsz ptr [ORIG_NvFBC_GetStatus]
|
||||||
PROXY_NvFBC_GetStatus endp
|
PROXY_NvFBC_GetStatus endp
|
||||||
|
|
||||||
PROXY_NvFBC_GetStatusEx proc
|
PROXY_NvFBC_GetStatusEx proc
|
||||||
jmp qword ptr [ORIG_NvFBC_GetStatusEx]
|
jmp ptrsz ptr [ORIG_NvFBC_GetStatusEx]
|
||||||
PROXY_NvFBC_GetStatusEx endp
|
PROXY_NvFBC_GetStatusEx endp
|
||||||
|
|
||||||
PROXY_NvFBC_SetGlobalFlags proc
|
PROXY_NvFBC_SetGlobalFlags proc
|
||||||
jmp qword ptr [ORIG_NvFBC_SetGlobalFlags]
|
jmp ptrsz ptr [ORIG_NvFBC_SetGlobalFlags]
|
||||||
PROXY_NvFBC_SetGlobalFlags endp
|
PROXY_NvFBC_SetGlobalFlags endp
|
||||||
|
|
||||||
PROXY_NvOptimusEnablement proc
|
PROXY_NvOptimusEnablement proc
|
||||||
jmp qword ptr [ORIG_NvOptimusEnablement]
|
jmp ptrsz ptr [ORIG_NvOptimusEnablement]
|
||||||
PROXY_NvOptimusEnablement endp
|
PROXY_NvOptimusEnablement endp
|
||||||
|
|
||||||
end
|
end
|
@ -30,14 +30,14 @@
|
|||||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||||
<UseDebugLibraries>true</UseDebugLibraries>
|
<UseDebugLibraries>true</UseDebugLibraries>
|
||||||
<PlatformToolset>v142</PlatformToolset>
|
<PlatformToolset>v142</PlatformToolset>
|
||||||
<CharacterSet>Unicode</CharacterSet>
|
<CharacterSet>MultiByte</CharacterSet>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||||
<UseDebugLibraries>false</UseDebugLibraries>
|
<UseDebugLibraries>false</UseDebugLibraries>
|
||||||
<PlatformToolset>v142</PlatformToolset>
|
<PlatformToolset>v142</PlatformToolset>
|
||||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||||
<CharacterSet>Unicode</CharacterSet>
|
<CharacterSet>MultiByte</CharacterSet>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||||
@ -97,6 +97,8 @@
|
|||||||
<SubSystem>Windows</SubSystem>
|
<SubSystem>Windows</SubSystem>
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
<EnableUAC>false</EnableUAC>
|
<EnableUAC>false</EnableUAC>
|
||||||
|
<ModuleDefinitionFile>nvfbcwrp.def</ModuleDefinitionFile>
|
||||||
|
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
|
||||||
</Link>
|
</Link>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
@ -137,6 +139,8 @@
|
|||||||
<OptimizeReferences>true</OptimizeReferences>
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
<EnableUAC>false</EnableUAC>
|
<EnableUAC>false</EnableUAC>
|
||||||
|
<ModuleDefinitionFile>nvfbcwrp.def</ModuleDefinitionFile>
|
||||||
|
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
|
||||||
</Link>
|
</Link>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||||
|
@ -2,6 +2,12 @@
|
|||||||
#include "nvfbcdefs.h"
|
#include "nvfbcdefs.h"
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
|
||||||
|
#ifdef _WIN64
|
||||||
|
#define LIBNAME ".\\NvFBC64_.dll"
|
||||||
|
#else
|
||||||
|
#define LIBNAME ".\\NvFBC_.dll"
|
||||||
|
#endif
|
||||||
|
|
||||||
HINSTANCE hLThis = 0;
|
HINSTANCE hLThis = 0;
|
||||||
extern "C" {
|
extern "C" {
|
||||||
FARPROC ORIG_NvFBC_Create, ORIG_NvFBC_Enable, ORIG_NvFBC_GetSDKVersion,
|
FARPROC ORIG_NvFBC_Create, ORIG_NvFBC_Enable, ORIG_NvFBC_GetSDKVersion,
|
||||||
@ -16,7 +22,7 @@ BOOL WINAPI DllMain(HINSTANCE hInst,DWORD reason,LPVOID)
|
|||||||
if (reason == DLL_PROCESS_ATTACH)
|
if (reason == DLL_PROCESS_ATTACH)
|
||||||
{
|
{
|
||||||
//hLThis = hInst;
|
//hLThis = hInst;
|
||||||
hL = LoadLibrary(".\\NvFBC64_.dll");
|
hL = LoadLibrary(LIBNAME);
|
||||||
if (!hL) return false;
|
if (!hL) return false;
|
||||||
ORIG_NvFBC_Create = GetProcAddress(hL, "NvFBC_Create");
|
ORIG_NvFBC_Create = GetProcAddress(hL, "NvFBC_Create");
|
||||||
if (!ORIG_NvFBC_Create) return false;
|
if (!ORIG_NvFBC_Create) return false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user