-
Notifications
You must be signed in to change notification settings - Fork 174
Fix FSR 4 in GTA 5 and remove the need for DLL rename #492
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
LGTM |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for handling NVNGX replacement DLLs without requiring manual renames, fixes the FSR4 loader in GTA V, and refactors several hook registrations and menu text.
- Introduce
nvngxReplacement,GetFileAttributesW/CreateFileWhooks, and drop the DLL rename step - Add signature-bypass hooks for Wintrust, Crypt32, and Advapi32 to support FSR and NVNGX spoofing
- Refactor menu UI text generation, update
Util::FindFilePath, and fix globalfsr4Moduleusage
Reviewed Changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| proxies/Kernel32_Proxy.h | Added typedefs and hooks for GetFileAttributesW/CreateFileW |
| menu/menu_common.cpp | Streamlined upscaler list join logic and status text |
| hooks/Wintrust_Hooks.h | New hook to bypass WinVerifyTrust for FSR DLLs |
| hooks/Crypt32_Hooks.h | Hook to redirect CryptQueryObject for FSR and NVNGX DLLs |
| hooks/Advapi32_Hooks.h | Registry hook for NVIDIA signature spoofing |
| hooks/Kernel_Hooks.h | Integrated file-API hooks into core hook registration |
| dllmain.cpp | Register/unregister new hooks and adjust spoofing logic |
| Util.cpp | Changed FindFilePath to return file path instead of parent |
| Config.cpp | Detect and store nvngxReplacement path |
| FSR4Upgrade.h | Promote local FSR4 module handle to global |
| pch.h | Added <ranges> include for C++ views |
| OptiScaler Setup.bat | Removed manual DLL rename logic |
Comments suppressed due to low confidence (4)
OptiScaler/Config.cpp:1048
- [nitpick] The local variable nvngxReplacement shadows State::Instance().nvngxReplacement, which can be confusing. Consider renaming the local variable (e.g., foundPath) to clarify its scope.
if (auto nvngxReplacement = Util::FindFilePath(Util::DllPath().remove_filename(), "nvngx_dlss.dll");
OptiScaler/hooks/Kernel_Hooks.h:1592
- [nitpick] The variable signedDll stores an optional containing a path but its name suggests a concrete file. Consider renaming to signedDllPathOpt or signedDllPath to reflect its actual type and purpose.
static auto signedDll = Util::FindFilePath(Util::DllPath().remove_filename(), "nvngx_dlss.dll");
OptiScaler/Util.cpp:365
- Changing the return from parent_path() to path() alters the semantic meaning of Util::FindFilePath, which may break callers expecting the directory path. Consider restoring parent_path() or updating all callers to handle the full file path.
return entry.path();
OptiScaler/hooks/Advapi32_Hooks.h:72
- In hkRegEnumValueW, for keys other than signatureMark you return ERROR_NO_MORE_ITEMS instead of delegating to the original RegEnumValueW. This will suppress legitimate registry enumerations. Consider calling o_RegEnumValueW for non-signatureMark cases.
return ERROR_NO_MORE_ITEMS;
fix reg hook and improve windows directory check
No description provided.