MonoWeaver¶
MonoWeaver is a matching and rewriting tool for C# mod developers. You describe the game logic you are looking for — "two arguments added together", "a field read", "a method call", an if condition — and then choose what should happen before, after, or instead of it.
You normally do not need to count IL instructions. A hook stays stable even when the compiler introduces an extra temporary local or picks a different branch layout.
Typical uses:
- changing a calculated value such as damage, price, or cooldown;
- logging a value without changing the game result;
- replacing or removing a game action;
- rewriting a condition built from
&&and||; - using one API for both offline DLL patching and MonoMod
ILContext; - checking the edited method before it is written or executed.
Where to start¶
-
Get it running
Pick a package, add it, and land your first offline patch.
-
Look up a pattern
Find the pattern that matches what your decompiler shows, or read the full DSL and rewrite tables.
-
Fix a problem
Nothing matched, too much matched, or the verifier rejected your edit.
Scope¶
MonoWeaver works on managed .NET/Mono assemblies that Mono.Cecil can read. It does not work on IL2CPP or native code.