Skip to content

Python hook for ReShade processing

License

Notifications You must be signed in to change notification settings

clayne/reshade-PyHook

Repository files navigation

PyHook - Python hook for ReShade processing

PyHook is an MIT licensed software, written in Python and C++, for access and modification of ReShade back buffer.

PyHook consists of two elements:

  • Python code that finds program with ReShade loaded, inject addon into it and allows to process frames in code.
  • C++ addon DLL written using ReShade API that exposes back buffer via shared memory.
  • Automatic ReShade detection and DLL validation
  • Automatic addon DLL injection
  • Shared memory as storage
  • Dynamic pipelines ordering and settings in ReShade UI via addon
  • Pipeline lifecycle support (load/process/unload)
  • Pipeline settings callbacks (before and after change)
  • Frame processing in Python via numpy array
  • Local Python environment usage in pipeline code
  • ReShade >= 5.0.0
  • Python == 3.10.6 for 64-bit | 3.10.4 for 32-bit (for pipelines only)
  • Only for specific pipelines: Any libraries that are required by pipeline code
  • Same as runtime, but for ReShade addon only included headers are needed
  • Boost == 1.80.0 (used for Boost.Interprocess shared memory)
  • Dear ImGui == 1.86
  • NumPy == 1.23.2
  • psutil == 5.9.2
  • Pyinjector == 1.1.0

You can download selected binary files from Releases.

  1. Download executable and *.addon files. Place both in same directory.
  2. Start game with ReShade installed.
  3. Start PyHook.exe.

If antyvirus detects PyHook as dangerous software add exception for it because it is due to DLL injection capabilities.

To build PyHook simply run build.bat in Anaconda Prompt.

If any Python package is missing try to update your conda environment and add conda-forge channel:

$ conda config --add channels conda-forge

To build PyHook addon download Boost and place header files in Addon/include. Then open *.sln project and build given release.

  • Added dynamic modules load from local Python environment.
  • Added fallback to manual PID supply.
  • Updated pipeline template.
  • Added new callbacks for settings changes (before and after change).
  • Added ReShade UI for pipeline settings in ImGui.
  • Added pipeline utils to faster pipeline creation.
  • Added dynamic pipeline variables parsing.
  • Added shared memory segment for pipeline settings.
  • Added AI pipeline example using https://github.com/mmalotin/pytorch-fast-neural-style-mobilenetV2
  • Added pipeline lifecycle support (load/process/unload).
  • Added pipeline ordering and selection GUI in ReShade addon UI.
  • Added shared memory for configuration.
  • Added multisampling error in PyHook.
  • Added pipeline processing for dynamic effects loading.
  • Added shared data refresh on in-game settings changes.
  • Disabled multisampling on swapchain creation.
  • Fixed error display on app exit.
  • Initial version.

About

Python hook for ReShade processing

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C++ 69.4%
  • Python 26.3%
  • C 4.3%