Skip to content

Releases: pardeike/Harmony

Harmony 2.0 RC 6

10 Feb 02:53
Compare
Choose a tag to compare
Harmony 2.0 RC 6 Pre-release
Pre-release

Usually, the critical bugs wait until last to come out of the dark cracks of the software forge. So this time too.

Compatibility warning:
DO NOT MIX HARMONY 2 WITH OLDER HARMONY 1 VERSIONS

Changes since RC 5:

  • Fixed bug with methods using return buffer pointer 6c7e2b0 / cfbd9f3
  • Added convenience extension methods to CodeInstruction 3b60065
  • Traverse works with inherited fields, properties and methods again 6b7b691
  • Removed CodeMatcher for now (needs work) 25fede0

Documentation
The documentation can be found at https://harmony.pardeike.net - feel free to file Issues for anything incorrect or for places that need more clarity or improvements.

Upgrading
The API has changed from Harmony 1.x to Harmony 2 so don't expect this to go without at least some renaming/refactoring. Shouldn't be hard though.

Help wanted
Please use [HarmonyDebug] to produce the debug log on your Desktop and compare the output to the original IL code of the method. Especially code offsets in methods with exception handling. Report any abnormalities.

Feedback
For bugs or suggestions, feel free to file Issues or join the official Discord.

Harmony 2.0 RC 5

08 Feb 10:50
Compare
Choose a tag to compare
Harmony 2.0 RC 5 Pre-release
Pre-release

We are getting close! This is the last feature release. Expect maximum one more RC for bug fixes but other than that, this is the real deal. ENJOY

Compatibility warning:
DO NOT MIX HARMONY 2 WITH OLDER HARMONY 1 VERSIONS

Changes since RC 4:

  • New: Support for IL InlineSignature (patching methods with CALLI)
  • New: documentation can now be tested with dotnet tool
  • New: documentation now uses compiled code snippets for correctness
  • Update: MonoMod.Common 20.2.2.1
  • Fixed: Methods that result in dead code at the end can now be Prefixed (Mono issue only)
  • Fixed: Outdated content in documentation
  • Regression: injecting ___fields now works as before (considers base class fields again)
  • Fixed: Handling Ret in replacement method is now smarter
  • Regression: Reverse patching - transpiled code must now end with valid Ret
  • Fixed: don't use Setup to run tests
  • New: Selective debug log with [HarmonyDebug] annotation - works even with future changes of the method
  • New: Prepare/Cleanup will be called even with exceptions during patching
  • New: Cleanup can now receive and return the current Exception during patching
  • Fixed: Removed travic-ci.com and only use travis-ci.org
  • Fixed: github main page now has correct CI badges with links
  • New: If possible, an IL compile error will result in a new HarmonyException that contains the IL codes and the IL offset in a parseable format

Documentation
The documentation can be found at https://harmony.pardeike.net - feel free to file Issues for anything incorrect or for places that need more clarity or improvements.

Upgrading
The API has changed from Harmony 1.x to Harmony 2 so don't expect this to go without at least some renaming/refactoring. Shouldn't be hard though.

Help wanted
Please use [HarmonyDebug] to produce the debug log on your Desktop and compare the output to the original IL code of the method. Especially code offsets in methods with exception handling. Report any abnormalities.

Feedback
For bugs or suggestions, feel free to file Issues or join the official Discord.

Harmony 2.0 RC 4

03 Feb 21:37
3a8338a
Compare
Choose a tag to compare
Harmony 2.0 RC 4 Pre-release
Pre-release

Fixes the local variable regression in RC3. Fixes missing owner-type regression in MonoMod.Common.

-- DO NOT MIX THIS WITH OLDER HARMONY 1 VERSIONS --

The documentation can be found at https://harmony.pardeike.net and for the changes have a look at the commit history. I am working on a proper change list. Some API changes have been made so don't expect this to go without at least some renaming/refactoring. Shouldn't be hard though.

For bugs or suggestions, feel free to file Issues or join the discord.

Harmony 2.0 RC 3

02 Feb 22:18
Compare
Choose a tag to compare
Harmony 2.0 RC 3 Pre-release
Pre-release

Update with feedback from rc2.

-- DO NOT MIX THIS WITH OLDER HARMONY 1 VERSIONS --

The documentation can be found at https://harmony.pardeike.net and for the changes have a look at the commit history. I am working on a proper change list. Some API changes have been made so don't expect this to go without at least some renaming/refactoring. Shouldn't be hard though.

For bugs or suggestions, feel free to file Issues or join the discord.

Harmony 2.0 RC 2

26 Jan 11:06
Compare
Choose a tag to compare
Harmony 2.0 RC 2 Pre-release
Pre-release

Update with feedback from rc1.

-- DO NOT MIX THIS WITH OLDER HARMONY 1 VERSIONS --

The documentation can be found at https://harmony.pardeike.net and for the changes have a look at the commit history. I am working on a proper change list. Some API changes have been made so don't expect this to go without at least some renaming/refactoring. Shouldn't be hard though.

For bugs or suggestions, feel free to file Issues or join the discord.

Harmony 2.0 RC 1

25 Jan 00:12
Compare
Choose a tag to compare
Harmony 2.0 RC 1 Pre-release
Pre-release

This is Release Candidate 1 of Harmony 2.0

-- DO NOT MIX THIS WITH OLDER HARMONY 1 VERSIONS --

The documentation can be found at https://harmony.pardeike.net and for the changes have a look at the commit history. I am working on a proper change list. Some API changes have been made so don't expect this to go without at least some renaming/refactoring. Shouldn't be hard though.

For bugs or suggestions, feel free to file Issues or join the discord.

Harmony v1.2.0.1

08 Aug 19:35
Compare
Choose a tag to compare

This new release of Harmony combines all the small changes and improvements made and found while testing v1.1:

logging ldstr with format strings no longer corrupts the output
Traverse has direct value manipulation with .Value property
fixed a casting error in inlineswitch
make MethodInvoker call restricted methods
the project got updated to the new package format
fix for RuntimeMethodHandle/IRuntimeMethodInfo error
better error reporting for exceptions during patching
AccessTools can now return declared methods, properties and constructors
improvements in removal of patches
creation of a nuget package for several .NET frameworks
make Type[].Description null reference safe
Transpilers.MethodReplacer now adapts to call types dynamically
patch attributes got a better API while keeping backwards compatibility
fixed access control on getters and setters
new super cool read-write access to private instance fields
specify arguments and injected fields by naming them with index
much improved self patching
Enjoy!

Harmony v1.2

30 Jul 13:29
Compare
Choose a tag to compare

IMPORTANT: A bug has been discovered that results in the following exception being thrown: System.Collections.Generic.List1[Harmony.ILCopying.ExceptionBlock] cannot be converted to target type: System.Collections.Generic.List1[Harmony.ILCopying.ExceptionBlock]

To reproduce, use Harmony v1.1 and v1.2+ alternating in patching the same method (one that contains try/catch logic). That triggers the conversion and this release should fail. Commit c28362a tries to fix the problem but is completely untested. A new version will be released as soon as everything works as expected.

Harmony v1.1.1b (updated)

24 Jul 19:45
Compare
Choose a tag to compare
Pre-release

UPDATED 25 July - backwards compatible fixes

We are getting close to the final release of Harmony v1.1.1

So please try it out, some minor details have changed or have been renamed. Noticeable, the property annotation was merged with a more general enum that contains constructors, getter and setters. Just change your annotations to use MethodType.Normal / Getter etc...

This beta is already in use in most of my Rimworld mods so its pretty stable. Please report all problem asap.

Thanks,
Andreas Pardeike aka Brrainz

Harmony v1.1.0

20 May 18:29
Compare
Choose a tag to compare

Hello Modders!

This is the 2nd major release for Harmony. The API has become more mature and this release contains a few important bug fixes. There are a lot of changes:

# Harmony now supports methods with try/catch logic

This is a big one. CodeInstructions for transpilers now carry a new field 'blocks' that is a list over different enum values that reflect start and end points for exception blocks. If you copy existing instructions around you should use the new Clone() method or empty that field manually.

A mixture of old and new Harmony versions can co-exist because the new Harmony has a self-patching feature that updates selected parts of itself (in this case the transpiler pipeline). There is also a preserving function that makes sure that old CodeInstructions don't lead to information loss.

# Improved AccessTools

There are now more ways to get your MethodInfo's - for declared methods and for private types. Have a look and don't use ordinary reflections.

# Patching improvements

You can now unpatch and there are new ways to mass patch a whole class. Also, Prepare and TargetMethod have been improved.

Postfixes now support a pipe-through function so you can change results that cannot be changed by ref (IEnumerable i.e.). Error reporting has been improved and is faster.

Private fields of the current instance/class can now be injected in your prefixes/postfixes by using their name prefixed with three underscores. It is also possible to annotate argument name translations for obfuscated methods.

# Misc

Tons of other stuff has changed and the documentation will be updated soon. Compatibility with .NET has been improved and you can extract IL code from other methods for usage in your transpilers. AccessCache had a bug fixed where it would cache types wrongly. And lots more...

Please consult the Wiki to learn more about how to use Harmony.

Thanks again to all the friendly people from the different gaming and modding communities. Without you, we would not have come this far.

Andreas Pardeike