This update can be installed via NuGet.
Relicense
From 4.1.0 and onwards, ReflectionTools will fall under the GNU Lesser General Public License v3.0 or later (LGPL-3.0-or-later).
Other Changes
EmitterExtensions
- Argument index 65535 is now allowed, as this was mistakenly thrown as an error in the past.
- Local indices can now be directly emitted in special cases where a LocalBuilder isn't available, like when
PatchUtility.ToLocalReferenceis used on an instruction with a numeric operand.
LocalReference
Int32 -> LocalReferencecast is now implicit.
Other
Microsoft.Extensions.Logging.Abstractions and Microsoft.Extensions.DependencyInjection.Abstractions dependencies are now properly marked as private.
ReflectionTools.Harmony additions
PatchUtility
A few helper methods were added to PatchUtility.
- LoadLocalValue
- SetLocalValue
- LoadLocalAddress
- LoadArgument
- SetArgument
- LoadArgumentAddress
- ToLocalReference
TranspileContext
A MoveBack() function was added to TranspileContext that prevents infinite loops when stepping backwards if a prefix is encountered.