This PowerShell script is designed to apply/patch 1337 files directly into a .dll or .exe file. It includes modifications to handle permission and ownership changes to ensure successful patching, as recommended by @VorlonCD in this issue comment.
- Apply patches to .dll or .exe files.
- Handles permission and ownership changes to ensure successful patching.
- Removes digital certificates from patched files.
- Updates the checksum of patched files.
- Provides detailed logging of the patching process.
- Create backup files before patching.
- PowerShell 5.1 or higher.
- Administrative privileges to run the script.
- Patch files (Recommended to be in the same directory as the script) can be downloaded from nvidia-patch repository here based on your driver version.
-patchFile: Path to the patch file (mandatory).-targetFile: Path to the target .dll or .exe file (mandatory).-fixOffset: Optional switch to adjust the offset during patching.
.\Win_1337_Apply.ps1 -patchFile "nvencodeapi64.1337" -targetFile "C:\Windows\System32\nvencodeapi64.dll" -fixOffset.\Win_1337_Apply.ps1 -patchFile "nvencodeapi.1337" -targetFile "C:\Windows\SysWOW64\nvencodeapi.dll" -fixOffset-
Permission and Ownership Change:
- Changes the owner of the target file to "Administrators".
- Grants "Administrators" full control permissions.
-
Patch Application:
- Validates the patch instructions.
- Creates a backup of the original file.
- Applies the patch instructions to the target file.
-
Post-Patch Processing:
- Removes the digital certificate from the patched file.
- Updates the file checksum to ensure integrity.
This script is based on the work by Deltafox79 with additional modifications as per @VorlonCD's instructions.