Skip to content

Repository files navigation

RE5Patch

A DLL-proxy patch for the Steam version of Resident Evil 5 (re5dx9.exe). Drops in next to the game executable as xinput1_3.dll (renameable to dinput8.dll / dxgi.dll) and fixes a handful of long-standing issues:

  • Ultrawide / super-wide display support (UI, cutscenes, pre-rendered movies).
  • Configurable FPS cap (above the stock 120).
  • Adjustable FOV.
  • Higher shadow quality.
  • Removal of the yellow/green colour-grading filter.
  • Removal of the 4096×4096 resolution cap.

RE5Patch is a fork of Lyall/RE5Fix — full credit to the original author for the patches themselves. See Credits and Changes vs. RE5Fix for what this fork adds on top.


Features

General

  • FOV adjustment — adds a user-configurable amount (in degrees) to the horizontal FOV at all five camera code sites (aiming, looking up, looking down, centred, and an extra aim site).
  • Uncap FPS — replace the stock 120 FPS cap with any value (0 = treated as "uncapped", i.e. 999).
  • Remove colour filter — disables the green/yellow colour-grading pass for a more neutral image.
  • Shadow quality — bump shadowmap resolution (in-game caps at 1024; 4096 is recommended).
  • Remove resolution limit — raises the 4096×4096 cap to 131072×131072 so any custom resolution works.

Ultrawide fixes

  • Fix UI scaling — fixes stretched / clipped UI on aspect ratios wider than 16:9 by forcing the game's "21:9" UI layout mode.
  • Fix ultrawide crash — fixes the ERROR 09: Unsupported Function cutscene crash by overwriting the cached 16:9 aspect ratio with the actual display aspect ratio.
  • Fix movies — fixes stretched pre-rendered Bink video by insetting symmetrically so the 16:9 source keeps its aspect ratio.

Installation

  1. Download the latest release zip from Releases.
  2. Unzip into your RE5 game directory (e.g. steamapps/common/Resident Evil 5).
  3. Edit RE5Patch.ini to enable / adjust features.
  4. Launch the game.

The release zip ships xinput1_3.dll. If another mod already ships an xinput1_3.dll, rename RE5Patch to one of:

  • dinput8.dll
  • dxgi.dll
  • X3DAudio1_7.dll
  • XAPOFX1_5.dll

or drop it into a DLL-loader's plugins/ folder.


Configuration

All settings live in RE5Patch.ini next to the DLL. Booleans accept true/false, yes/no, on/off, 1/0. A RE5Patch.log file is always written next to the DLL — attach it to bug reports if a patch doesn't apply.

[General]
EnableAll     = false   ; force every feature on
Console       = false   ; allocate a console for live logs (RE5Patch.log is always written)
StartupDelay  = 1000    ; ms to wait before applying patches

[Increase FOV]
Enabled = false
Value   = 25            ; degrees to add to horizontal FOV

[FPS Cap]
Enabled = false
Value   = 120           ; 0 = treat as uncapped

[Shadow Quality]
Enabled = false
Value   = 4096

[Remove Colour Filter]
Enabled = false

[Remove Resolution Limits]
Enabled = true

[Custom Resolution]
Width  = 0              ; 0/0 = use desktop resolution
Height = 0

[Fix UI Scaling]
Enabled = true

[Fix Ultrawide Crash]
Enabled = true

[Fix Movies]
Enabled = true

Building from source

RE5Patch is 32-bit onlyre5dx9.exe is 32-bit and the patch code uses MSVC-style __asm blocks (only supported on x86).

Option A: Visual Studio (recommended)

  1. Open RE5Patch.sln in Visual Studio 2022 (or 2019 with the v143 toolset installed).
  2. Select the Release | Win32 configuration.
  3. Build → Build Solution (Ctrl+Shift+B).
  4. The output xinput1_3.dll lands in x64/Release/ (yes, the directory is misnamed by VS — it's still a 32-bit binary; check the platform selector).

Option B: CMake

cmake -B build -S . -A Win32
cmake --build build --config Release
:: Output: build/Release/xinput1_3.dll

Option C: Command line (MSBuild)

msbuild RE5Patch.sln /p:Configuration=Release /p:Platform=Win32

Troubleshooting

"xlive.dll is missing"

The Steam version of RE5 ships with Games for Windows – LIVE, which doesn't install cleanly on Windows 10/11. Either install GFWL manually or use one of the community GFWL-removal patches.

"xinput1_3.dll conflicts with another mod"

Rename RE5Patch's DLL to dinput8.dll (or dxgi.dll). If you're using a DLL loader like Script Hook, drop it into the loader's plugins/ folder instead.

A patch doesn't apply

Check RE5Patch.log next to the DLL. Every patch logs whether its pattern scan succeeded. If you see pattern not found, you're likely running a game version that RE5Patch doesn't recognise — please open an issue with the log file attached and the game's version (right-click RE5 in Steam → Properties → Betas / build ID).

Everything else

Do a clean install of RE5 from Steam, install the QOL Fixes mod, then RE5Patch. RE5Patch was originally authored against the QOL Fixes build but may work on the stock Steam build too.


Changes vs. RE5Fix

This fork preserves every patch from the original RE5Fix (same signatures, same hook code, same INI semantics) and layers on top:

Bug fixes

  • Null-deref crashes in ResolutionLimits(): the original computed Memory::PatternScan(...) + 2 and immediately dereferenced the result, which would crash if the scan failed. RE5Patch checks for null at every step.
  • Unchecked GetProcAddress in Proxy_Attach(): a missing export previously left the function pointer null and the game would crash on first call. RE5Patch null-checks every forwarded call and returns a sensible error code (ERROR_DEVICE_NOT_CONNECTED / E_NOTIMPL).
  • Unconditional std::cout in ColourFilter() ran in release builds where there was no console. Now goes through the logging facility.
  • PAGE_EXECUTE_WRITECOPY was used for data writes in Memory::Write; RE5Patch uses PAGE_READWRITE (the correct protection for non-code data).
  • FlushInstructionCache is now called after every code patch so multi-CPU systems see the updated instructions immediately.

Build & packaging

  • Vendored inih — the original used a git submodule that wasn't initialised by git clone (no --recursive), so the project didn't build out of the box. RE5Patch vendors INIReader.h directly.
  • Removed broken x64 configurations — the .vcxproj shipped x64 build configs but the code uses __asm, which MSVC only supports on x86. The x64 configs are gone.
  • Additional include directories set so #include "stdafx.h" and #include "INIReader.h" resolve cleanly from any source file (the original had no include path setup).
  • CMake build system alongside the .vcxproj for CI / cross-toolchain.
  • GitHub Actions workflow builds every push and publishes a release zip on every v* tag.

Code organisation

  • One file per patch in src/patches/ (fov.cpp, fps.cpp, shadow.cpp, colour_filter.cpp, resolution.cpp, ui_fix.cpp, crash_fix.cpp, movie_fix.cpp) instead of one 600-line dllmain.cpp.
  • Centralised logging facility (src/logging.hpp / logging.cpp) with file + optional console output, thread-safe, timestamped.
  • Typed config struct (src/config.hpp / config.cpp) replaces ~12 scattered globals. Reads booleans as booleans (the original used GetInteger for Enabled flags).
  • Memory helper (src/helper.hpp / helper.cpp) is null-safe: PatternScan(module, sig, offset) returns null cleanly if the scan fails, even when an offset is requested.

New INI options

  • [General] EnableAll — flip one switch to turn every feature on.
  • [General] Console — opt into a live log console at runtime.
  • [General] StartupDelay — make the pre-patch sleep configurable.

See CHANGELOG.md for the full version history.


Credits

  • Lyall — original RE5Fix author. Every signature and hook in RE5Patch is a direct port of Lyall's work.
  • RERevHook — original DLL-proxy code template.
  • inih by Ben Hoyt — INI parser (BSD-licensed, vendored in src/external/inih/).
  • FlawlessWidescreen's RE5 script — original reference for the UI / resolution-limit fixes.

License

MIT — see LICENSE. The vendored inih in src/external/inih/LICENSE.txt retains its BSD license.

About

Patches for Resident Evil 5

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages