Skip to content

Releases: MonoMod/MonoMod

v19.08.02.03

02 Aug 12:21
f38e454
Compare
Choose a tag to compare

Notes

This is a maintenance release built from the maintenance/19.08 branch.

General

  • Drop support for .NET Standard 1.3.
  • Switch DebugType to portable 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 the ManualApply configuration to its inner Detour, 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-type DynamicMethodDefinitions with a single Unsafe.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

04 Jul 22:44
57ce3e1
Compare
Choose a tag to compare

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 HookGen IL. += and replacing HookEndpointManager.Manipulate.
    • HookEndpointManager.Manipulate is still exposed, but ILHook should be used in favor.
  • Mark ILContexts as read-only outside of ILHook manipulator execution.
  • Invoke Detour.OnDetour / Hook.OnDetour when the detour / hook is applied, not during construction.
  • Track ILHooks in DetourModManager.
  • Add AsOriginal (low priority) and Override (high priority) types to HarmonyDetourBridge.

Utils

  • Improve the cecil.ResolveReflection() cache (fewer misses and zombie references).
  • Use the runtime IL copier for DynamicMethodDefinitions 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

09 Jun 10:16
17657e5
Compare
Choose a tag to compare

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

05 May 18:16
934a8ae
Compare
Choose a tag to compare

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

10 Apr 21:26
8e54a9a
Compare
Choose a tag to compare

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

10 Apr 16:19
174fc8d
Compare
Choose a tag to compare

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

09 Apr 22:55
418ad0e
Compare
Choose a tag to compare

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

01 Apr 12:33
9a8eafa
Compare
Choose a tag to compare

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

07 Feb 16:52
a51223c
Compare
Choose a tag to compare

Utils

  • General cecil.Is(refl) fixes.
  • More aggressive DynamicMethodDefinition locking and clone the underlying MethodDefinition to fix async patches.
  • Force DMD to use long branch opcodes due to offsets becoming inaccurate during generation.
  • Add the following DMD environment vars:
  • 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

03 Jan 00:13
809b65e
Compare
Choose a tag to compare

General

  • Improve names of DynamicMethods in Utils and RuntimeDetour.

Utils

  • Run ConvertShortLongOps when generating a DynamicMethodDefinition
  • 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