Rework and port HookGen from MonoMod - #1152
Open
psyGamer wants to merge 10 commits into
Open
Conversation
When MonoMod patches a method, the vanilla IL instructions will get moved into an 'orig_' method. This ensures IL-hooks will still see the vanilla IL, instead of Everest's code. If the intention is to patch Everest itself, a manual hook is required like with all other Everest internals.
Due to now being directly integrated into HookGen, MMR isn't executed over it anymore and therefore the patches are no longer nessecary.
This primarily includes property getters and setters.
maddie480
added a commit
to maddie480/ExtendedVariantMode
that referenced
this pull request
Aug 10, 2026
maddie480
added a commit
to maddie480/ExtendedVariantMode
that referenced
this pull request
Aug 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This ports the HookGen code from MonoMod and adjusts to do avoid running MonoMod over it and instead directly integrates our patches into the generated assembly.
With this port, there are also three notable changes:
orig_method if available. This avoids breaking mods when Everest starts patching a method, since that will move the vanilla IL instructions into theorig_method. If the intention is to specifically hook Everest, manual hooks should be used, just like with all other Everest hooks.There are a handful of mods for which this is a breaking change, those would need to be updated before getting merged.