Source-checkedLibraries & compatibility

AutoHookGenPatcher by Hamunii Valheim Publish

by CATALYSTC · for Valheim

Automatically generates MonoMod.RuntimeDetour.HookGen's MMHOOK files during the BepInEx preloader phase. By Hamunii.

6.7KDownloads
22 mo agoLast updated
BepInExLoaders
ThunderstoreSource

About AutoHookGenPatcher by Hamunii Valheim Publish

From Thunderstore

Automatically generates MonoMod.RuntimeDetour.HookGen's MMHOOK files during the BepInEx preloader phase. By Hamunii.

AutoHookGenPatcher

This is a publish of AutoHookGenPatcher, made by Hamunii https://thunderstore.io/c/lethal-company/p/Hamunii/ It was made and published for the Lethal Company Comunity as a substitute to the original HookGenPatcher.

https://thunderstore.io/c/lethal-company/p/Hamunii/AutoHookGenPatcher/

I claim no ownership of any of their work. But I needed this to fix some issues with some Valheim mods, anything after this is copied textualy from the original README

Automatically generates MonoMod.RuntimeDetour.HookGen's MMHOOK files during the BepInEx preloader phase.

Manual Installation: Move the BepInEx folder from the ZIP file to the BepInEx folder of the game.

This project is not officially linked with BepInEx nor with MonoMod.

This software is based off of HookGenPatcher by HarbingerOfMe, which is also licensed under MIT.

Differences to the original HookGenPatcher

  • Instead of only having a fixed list of files to generate MMHOOK files for, AutoHookGenPatcher will get the MMHOOK file references from installed plugins, and generates those MMHOOK files if possible.
  • AutoHookGenPatcher makes use of a cache file to quickly check if everything is still up to date, without needing to check every MMHOOK file for that information.
  • Hook Generation is now multithreaded, meaning that generating multiple MMHOOK files takes less time. For example, generating an MMHOOK file for every file in the Managed directory of Lethal Company takes about 22.5 seconds instead of 40.0 seconds it would take with no multithreading, on my machine.

Usage For Developers

Note: By default, AutoHookGenPatcher already generates an MMHOOK assembly for Assembly-CSharp.dll. So if you only need MMHOOK_Assembly-CSharp.dll, you don't need to do anything.

Using AutoHookGenPatcher is really simple, and the only thing you need to do is tell it to generate the MMHOOK files you want in the first place. This can be by editing the config file AutoHookGenPatcher.cfg, and setting the [Generate MMHOOK File for All Plugins] setting's Enabled value to true:

[Generate MMHOOK File for All Plugins]

## If enabled, AutoHookGenPatcher will generate MMHOOK files for all plugins
## even if their MMHOOK files were not referenced by other plugins.
## Use this for getting the MMHOOK files you need for your plugin.
# Setting type: Boolean
# Default value: false
Enabled = true

## Automatically disable the above setting after the MMHOOK files have been generated.
# Setting type: Boolean
# Default value: true
Disable After Generating = true

When you publish your mod, make sure to add AutoHookGenPatcher as a dependency in the package you upload.

Q&A

How does AutoHookGenPatcher figure out which MMHOOK files my mod references?

  • During the BepInEx Preloader phase, AutoHookGenPatcher will open and read the metadata of every DLL file\* for referenced assemblies and looks for references that start with MMHOOK_. It will then check if any installed assemblies match the rest of the name, and will run MonoMod's HookGen on those assemblies if they exist.

\This is only done if the date modified* metadata of the assembly on disk is newer than previous known date in AutoHookGenPatcher's cache file, if a cache entry exists for the assembly. Referenced MMHOOK assemblies are also saved in the cache.

Highlights

From source data

Loaders

Runs on BepInEx.

Footprint

Rated a light load on a server.

Dependencies

Needs 1 other project installed alongside it.

AutoHookGenPatcher by Hamunii Valheim Publish on Nxeon

From our catalogue
One-click install
Supported on Nxeon Valheim servers, for BepInEx servers. We download it from Thunderstore, place it, and restart the server.
Server type needed
BepInEx
Server load
light
Smallest plan we suggest
Valheim — 4 GB (4 GB RAM). This follows our own load rating above, not a benchmark.
Latest build
1.0.4, released 2025-01-01

Game versions by loader

LoaderGame versionsNewest
BepInEx

From 1 recorded build of AutoHookGenPatcher by Hamunii Valheim Publish.

Dependencies

Declared by the newest build that lists any. Required ones are installed with it on one-click installs.

Run AutoHookGenPatcher by Hamunii Valheim Publish on a Valheim server

Pick a server or deploy a new one above; it is installed in one click.

What kind of mod it is

From the catalog
Listed on Thunderstore as “Content”

Libraries & compatibility

Foundations and fixes other mods build on. Usually installed because something else needs it.

Compatibility

Game
Valheim
Loaders
BepInEx
Requires
One-click install needs a BepInEx server. 1 other project installed alongside it.

Verified at the source

  • ✓ThunderstoreOfficial listing, checked 2026-10-02Open ↗
  • ✓AuthorCATALYSTC, as published on Thunderstore
  • ✓LicenseNot published by the sourceFree

AutoHookGenPatcher by Hamunii Valheim Publish, answered

Generated from the mod’s own source data.

Which loaders does it support?

BepInEx.

Is it free?

Yes. AutoHookGenPatcher by Hamunii Valheim Publish is free to download from Thunderstore.

How do I add it to my Nxeon server?

Use “Add to a server” on this page, or open NxLabs from your dashboard. We install it, restart your server and switch it on.

NxLabs

Run AutoHookGenPatcher by Hamunii Valheim Publish on a Valheim server.

Deploy in about a minute from $9.99 a month, then add AutoHookGenPatcher by Hamunii Valheim Publish in one click.