MonoModReorg.Core 23.1.2-prerelease.1

.NET 5.0 .NET Standard 2.0 .NET Framework 3.5
This is a prerelease version of MonoModReorg.Core.
There is a newer version of this package available.
See the version list below for details.
dotnet add package MonoModReorg.Core --version 23.1.2-prerelease.1
NuGet\Install-Package MonoModReorg.Core -Version 23.1.2-prerelease.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="MonoModReorg.Core" Version="23.1.2-prerelease.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add MonoModReorg.Core --version 23.1.2-prerelease.1
#r "nuget: MonoModReorg.Core, 23.1.2-prerelease.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install MonoModReorg.Core as a Cake Addin
#addin nuget:?package=MonoModReorg.Core&version=23.1.2-prerelease.1&prerelease

// Install MonoModReorg.Core as a Cake Tool
#tool nuget:?package=MonoModReorg.Core&version=23.1.2-prerelease.1&prerelease

THIS IS PROBABLY NOT THE LIBRARY YOU WANT TO BE USING. You probably want RuntimeDetour instead.

You have been warned.


Notable APIs

  • MonoMod.Core.DetourFactory.Current
  • MonoMod.Core.ICoreDetour

Usage

Use DetourFactory.Current.CreateDetour to create a single detour from one method to another. The detour will be automatically undone when the returnedc object is disposed or garbage collected. Only one such detour may be made per method. If multiple are made, they will not be cleaned up properly. MonoMod.Core does not track which methods have already been detoured, and will not throw.

It is therefore highly recommended to use a higher-level detouring API (like that provided by MonoMod.RuntimeDetour or Harmony) to perform detours. Those higher level APIs also provide solutions to many of the limitations to Core's detour abstraction, such as the ability to call the original, unmodified method, or modify the IL of the method. (See their documentation for how this is actually done.)

Other potentially useful APIs

The default IDetourFactory utilizes MonoMod.Core.Platforms.PlatformTriple.Current to implement detours. Notably, that factory handles re-creating the underlying ISimpleNativeDetour objects when methods are recompiled by the runtime.

PlatformTriple does provide a few other utilities which may be useful for a higher-level library, however:

  • PlatformTriple.Prepare JIT compiles a method, sully supporting generic instantiations
  • PlatformTriple.GetIdentifiable translates the provided MethodBase into an instance which can be used as, for instance, the key to a ConditionalWeakTable

The other methods of PlatformTriple are means of implementing the detour factory, and likely should not be touched.

Product Versions
.NET net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows net7.0 net7.0-android net7.0-ios net7.0-maccatalyst net7.0-macos net7.0-tvos net7.0-windows
.NET Core netcoreapp2.0 netcoreapp2.1 netcoreapp2.2 netcoreapp3.0 netcoreapp3.1
.NET Standard netstandard2.0 netstandard2.1
.NET Framework net35 net40 net403 net45 net451 net452 net46 net461 net462 net463 net47 net471 net472 net48 net481
MonoAndroid monoandroid
MonoMac monomac
MonoTouch monotouch
Tizen tizen40 tizen60
Xamarin.iOS xamarinios
Xamarin.Mac xamarinmac
Xamarin.TVOS xamarintvos
Xamarin.WatchOS xamarinwatchos
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on MonoModReorg.Core:

Package Downloads
MonoModReorg.RuntimeDetour

Flexible and easily extensible runtime detouring library. Wrap, replace and manipulate (Mono.Cecil) methods at runtime.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
23.3.22.1 44 3/23/2023
23.3.2.1 399 3/2/2023
23.1.2-prerelease.1 756 1/3/2023
22.11.21-prerelease.2 933 11/22/2022
22.11.21-prerelease.1 56 11/21/2022
22.11.17-prerelease.1 76 11/17/2022
22.11.9-prerelease.1 482 11/9/2022
22.11.8-prerelease.1 64 11/8/2022
22.11.8-prerelease 58 11/8/2022
22.11.4-prerelease 56 11/5/2022
22.10.25-prerelease 68 10/25/2022
22.10.21-prerelease 74 10/21/2022
22.10.11-prerelease 67 10/11/2022
22.10.6-prerelease 47 10/6/2022
22.9.29-prerelease 92 9/29/2022
22.9.23-prerelease 146 9/23/2022
22.9.14-prerelease 102 9/14/2022
22.9.7-prerelease 67 9/7/2022
22.8.29-prerelease 65 8/29/2022