Skip to content

Conversation

@FakeMichau
Copy link
Collaborator

No description provided.

@FakeMichau FakeMichau marked this pull request as draft June 2, 2025 08:03
@FakeMichau FakeMichau marked this pull request as ready for review June 2, 2025 11:01
@PotatoOfDoom
Copy link
Collaborator

LGTM

@PotatoOfDoom PotatoOfDoom requested a review from Copilot June 2, 2025 11:25
Copy link

Copilot AI left a 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/CreateFileW hooks, 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 global fsr4Module usage

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
@FakeMichau FakeMichau merged commit c64f274 into optiscaler:master Jun 2, 2025
1 check passed
@FakeMichau FakeMichau deleted the ffx-check branch June 2, 2025 14:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants