Releases: MonoMod/MonoMod
v19.08.02.03
Notes
This is a maintenance release built from the maintenance/19.08
branch.
- It's a feature-frozen branch separate from the
master
branch. - If you want to test new features and the ongoing refactor, feel free to grab the latest build artifacts for the
master
branch or build MonoMod yourself. - Feel free to view the list of cherry-picked and backported commits yourself.
General
- Drop support for .NET Standard 1.3.
- Switch
DebugType
toportable
by default, fixing the NuGet symbol source link.
RuntimeDetour
- Fix transitions between AArch32 (ARM) and Thumb native code (Thanks, Coppélia!).
- Fix FlushICache for ARM but disable it by default, as it's still unreliable on some 32-bit devices.
- Make
Hook
pass theManualApply
configuration to its innerDetour
, no longer ignoring its value. - Fix
cecil.Is(refl)
method parameter declaring generic type edge case.
Patcher
- Fix support for multiple
MonoModCustomAttribute
handlers (Thanks, 56!).
Utils
- Replace
GetManagedSize
's inner per-typeDynamicMethodDefinition
s with a singleUnsafe.SizeOf<T>
-equivalent method, fixing support for older Unity mono builds.
NuGet: Patcher | Utils | RuntimeDetour | HookGen
Azure DevOps Pipelines: Build | Release
v19.07.04.03
Notes
This is the last release to target .NET Standard 1.3.
- .NET Core 1.1 has reached its end of life in June 2019.
- Many dependent projects have moved on to .NET Core 2.0+ where possible.
- Mono.Cecil 0.11 will no longer support .NET Standard 1.3.
- Mono.Cecil 0.10.x will be the last version to support .NET Framework 3.5 as well.
- MonoMod will continue targeting .NET Framework 3.5 with Cecil 0.10.x for the foreseeable future, as many games built with Unity do not offer support for .NET Standard 2.0.
- Certain functions are already restricted when using MonoMod for .NET Standard 1.3.
- Working around limitations wasn't always possible / feasible.
- Maintaining support for .NET Standard 1.3 impacted support for other targets.
Support for .NET Standard 1.3 might be added back in the future if it's deemed necessary enough.
RuntimeDetour
- Fix the selftest being inlined / "optimized" at runtime in some environments.
- Take multiple
__thiscall
this
-retptr
-argument orders into account. DetourNativeLibcPlatform
, fixing support for .NET Core on Linux and macOS.- Methods can now be unpinned.
- Add basic detour / hook configuration (
ManualApply
). - Add basic detour / hook sorting (
Priority
,ID
,Before
,After
).- Detour indices are no longer directly settable.
- Add
DetourContext
to easily set the configuration of all following detours / hooks. - Make detours / hooks reusable -
Undo
no longer frees and invalidates the detour. - Improve method pinning (cached pinned handle, pin reference counting, thread safety).
- Add a new hook type:
ILHook
- IL manipulator "hook", similar to HookGenIL. +=
and replacingHookEndpointManager.Manipulate
.HookEndpointManager.Manipulate
is still exposed, butILHook
should be used in favor.
- Mark
ILContext
s as read-only outside ofILHook
manipulator execution. - Invoke
Detour.OnDetour
/Hook.OnDetour
when the detour / hook is applied, not during construction. - Track
ILHook
s inDetourModManager
. - Add
AsOriginal
(low priority) andOverride
(high priority) types toHarmonyDetourBridge
.
Utils
- Improve the
cecil.ResolveReflection()
cache (fewer misses and zombie references). - Use the runtime IL copier for
DynamicMethodDefinition
s by default. - Fix exception handler and generic method calls in DMDs.
- Forward CreateDelegate for .NET Standard.
- Prevent .NET Standard 1.X from preferring the unsupported DMD copier.
- Make
ShortToLongOp
/LongToShortOp
thread-safe. - Fix
cecil.Is(refl)
ByRef, Pointer and return type false positives.- Method parameter and return type checking has been heavily simplified in the process.
- A long-standing issue with Mono 2.x (used by Unity 5.x) has also been fixed.
Patcher
- No longer import generic parameter references during the
PrePatchType
pass.
NuGet: Patcher | Utils | RuntimeDetour | HookGen
Azure DevOps Pipelines: Build | Release
v19.06.09.01
General
- Fix legacy (Cecil 0.9.6) regressions and build configuration (Thanks, @Mirsario!).
RuntimeDetour
- Add
HarmonyDetourBridge
, currently hotpatches Harmony to use RuntimeDetour as its backend. - Breaking: Native platforms now accept the size for MakeWritable / MakeExecutable.
- Extension methods have been added for ease of use and to maintain compatibility.
- Projects making direct use of MakeWritable / MakeExecutable must be recompiled.
- Add
FlushICache
for native platforms, required for ARM. - Basic support for Mono environments without
MonoPosixHelper
.
Utils
- Don't make DynamicMethodDefinition emit useless debug symbols.
- Fix DMD exception handlers.
- DMD now falls back to copying individual methods when reading the module via cecil fails.
- Fix
mref.ResolveReflection()
for multi-dimensional array constructors (Thanks, @Jofairden!). - Add
MatchCallOrCallvirt
IL matching helper. - Refactor
DynDll
helper and allow resolving imports into instance fields.
NuGet: Patcher | Utils | RuntimeDetour | HookGen
Azure DevOps Pipelines: Build | Release
v19.05.01.01
General
- Remove the last remaining accidental SRE usages (Thanks, @opl-!).
Utils
- Refactor
ILContext
reference storage and inline delegate calls (Thanks, @Chicken-Bones!). - Fix round-tripping array types in DMD (Thanks, @Chicken-Bones!).
- Fix dynamic DMDs for methods with no return type (constructors).
- Fix
DMD.Copy
exception handler being off by two (Thanks, _a and Magnus!). - Add
FindDeep
extension methods (Thanks, @opl-!). - Fix
ILCursor.Goto
off-by-one (Thanks, _a!). - Attempt to fix DMD for Unity 5.X (Mono 2.X?).
RuntimeDetour
- Handle invalid runtime IL manipulations more gracefully.
HookGen
- Handle parameter type failures more gracefully (Thanks, covers1624!).
Patcher
- Clean up PatchRefs.
- Throw when PostRelinker returns null.
- Fix generic parameter constraints not being relinked (Thanks, @opl-!).
- Fix AssemblyNameReference being created with the full name as the partial name (Thanks, @opl-!).
NuGet: Patcher | Utils | RuntimeDetour | HookGen
Azure DevOps Pipelines: Build | Release
v19.04.10.09
Utils
- Fix ILCursor starting at the end of the method by default.
- Fix ILCursor.Prev wrapping around when at the start of the method.
Patcher
- Fix PatchField accessing the wrong field and ignoring custom attributes.
NuGet: Patcher | Utils | RuntimeDetour | HookGen
Azure DevOps Pipelines: Build | Release
v19.04.10.06
Utils
- Heavily improve ILContext (previously MMIL). Check the commit log for details. Thanks, Chicken Bones!
- Move ILContext into its own namespace.
NuGet: Patcher | Utils | RuntimeDetour | HookGen
Azure DevOps Pipelines: Build | Release
v19.04.09.05
Utils
- DynamicMethodDefinition Cecil backend, making it possible to use in environments which don't implement System.Reflection.Emit.
- Switch from DynamicMethod to DynamicMethodDefinition where applicable.
- Runtime method body IL parser to create DynamicMethodDefinitions for methods from file-less assemblies.
- Add MMIL, deprecating HookIL.
Patcher
- Fix MonoModReplace on types.
NuGet: Patcher | Utils | RuntimeDetour | HookGen
Azure DevOps Pipelines: Build | Release
v19.04.01.03
Utils
- Fix crash when determining the platform and when
uname
cannot be relied on. - Fix generic vs nongeneric conflicts in
cecil.Is(refl)
- Fix DynamicMethodDefinition -> MethodBuilder calling DynamicMethods with non-ref parameters.
- Carry over ArrayType dimensions when relinking.
- Avoid caching relink mappings too aggressively, fixing issues related to enums and custom attributes.
- Prevent Mono from inlining DynamicMethods generated from DynamicMethodDefinitions.
RuntimeDetour
- Fix module- / type-less (dynamic) methods.
- Fix dynamically loaded assemblies.
- Flag memory as RWX on Unix environments, avoiding crashes with native functions and AOTed system libraries.
- Fix MemAlloc being passed an incorrect size (Type instead of Size).
NuGet: Patcher | Utils | RuntimeDetour | HookGen
Azure DevOps Pipelines: Build | Release
v19.02.07.08
Utils
- General
cecil.Is(refl)
fixes. - More aggressive
DynamicMethodDefinition
locking and clone the underlyingMethodDefinition
to fix async patches. - Force
DMD
to use long branch opcodes due to offsets becoming inaccurate during generation. - Add the following
DMD
environment vars:MONOMOD_DMD_TYPE="Auto"
, checkDynamicMethodDefinition.GeneratorType
MONOMOD_DMD_DEBUG="1"
defaults to"0"
, overridesTYPE
MONOMOD_DMD_DUMP="dir"
defaults to""
- Fix
ldarg
off-by-one with instance methods.
RuntimeDetour:
- Fix DetourNativeARMPlatform, thanks to @leo60228!
NuGet: Patcher | Utils | RuntimeDetour | HookGen
Azure DevOps Pipelines: Build | Release
v19.01.03.01
General
- Improve names of
DynamicMethod
s in Utils and RuntimeDetour.
Utils
- Run
ConvertShortLongOps
when generating aDynamicMethodDefinition
- Add type finding fallback to
ResolveReflection
, should it ever fail (f.e. inaccurate runtime)
Core
- Fix Cecil 0.9 compatibility (only relevant when compiling with
/p:CecilLegacy=true
)
NuGet: Patcher | Utils | RuntimeDetour | HookGen
Azure DevOps Pipelines: Build | Release