AutoHookGenPatcher

AutoHookGenPatcher repo

AutoHookGenPatcher for REPO mods. When BepInEx is loaded, it automatically generates MonoMod.RuntimeDetour.HookGen’s MMHOOK files. It means 2 things:

  1. Some mods require this patcher to work properly
  2. If you are a REPO modder, you may find this tool useful

To install this patch, extract the archive content in REPO\BepInEx folder.

FOR REPO MODDERS

  • AutoHookGenPatcher automatically creates an MMHOOK assembly for Assembly-CSharp.dll.
  • If you only need MMHOOK_Assembly-CSharp.dll, you don’t need to change anything.
  • If you need MMHOOK files for other assemblies (besides Assembly-CSharp.dll), you must modify its configuration.
  • Editing the configuration File:
    1. Locate the file AutoHookGenPatcher.cfg in your mod project.
    2. Open it using a text editor (e.g., Notepad, VS Code).
    3. Find the setting:
      • [Generate MMHOOK File for All Plugins] Enabled = false
    4. Change it to:
      • Enabled = true
    5. This tells AutoHookGenPatcher to generate MMHOOK files for all plugins.

Requirements

DetourContext Dispose Fix

Created by Hamunii

See Changelog

Version 1.0.7 (June 19, 2025) marked the upload of AutoHookGenPatcher to the PEAK Mod Database, expanding its availability across more modding platforms.

Version 1.0.6 (March 9, 2025) extended distribution, further supporting the modding communities of games.

Version 1.0.5 (May 25, 2024) improved compatibility by making AutoHookGenPatcher work with .NET Standard 2.0, whereas it was previously limited to 2.1. This change makes it more accessible across projects using older frameworks.

Version 1.0.4 (May 2, 2024) included a minor fix to the description.

Version 1.0.3 (April 12, 2024) addressed stability by adding error handling for BadImageFormatException when reading assemblies, preventing crashes in certain cases.

Version 1.0.2 (April 5, 2024) fixed an issue where two non-plugin assemblies with the same name could cause errors during processing.

Version 1.0.1 (April 4, 2024) introduced several updates:

  • Now uses Thunderstore CLI to build the mod package.
  • Fixed a bug where MMHOOK files wouldn’t regenerate if a previous version already existed.

Version 1.0.0 (April 2, 2024) was the initial release, introducing key differences from the original HookGenPatcher:

  • Instead of relying on a fixed file list, it dynamically generates MMHOOK files based on references in installed plugins.
  • Introduced a cache system for faster validation of MMHOOK file freshness.
  • Enabled multithreaded hook generation, significantly reducing generation time – for example, cutting the process from 40 seconds to around 22.5 seconds for REPO’s Managed directory on the developer’s machine.

Download

How to Install

To install AutoHookGenPatcher you need to have BepInEx. If you have any trouble installing mods for REPO, follow this guide:

R.E.P.O. Mods Installation

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top