HarmonyX
HarmonyX copied to clipboard
Harmony built on top of MonoMod.RuntimeDetours with additional features
**This needs more testing but based on initial reports:** When patch method generation fails, it appears that the patch is still marked as applied. This is likely because patch info...
When trying to patch methods like * `Foo.Method` * `Foo.Method` patching fails with a somewhat cryptic error like ``` HarmonyLib.HarmonyException: IL Compile Error (unknown location) ---> HarmonyLib.HarmonyException: IL Compile Error...
```cs [HarmonyPatch(typeof(GhostInfo), nameof(GhostInfo.SyncValuesNetworked))] class StringFileExists { static bool Prefix(int param_1,int param_2,bool param_3,int param_4,int param_5,bool param_6, int param_7,int param_8,bool param_9,PhotonMessageInfo param_10) { Console.WriteLine(param_1.ToString(), param_2.ToString(), param_3.ToString(), param_4.ToString(), param_5.ToString(), param_6.ToString(), param_7.ToString(), param_8.ToString(), param_9.ToString(),...
This PR shows that building and running on .NET SDK 7.0.100-preview.4.22252.9 breaks HarmonyX. I found .NET 7 Preview 1 to work. I will, in subsequent commits, downgrade to preview 3,...
Add a patch attribute that marks the patch as optional - if the method is not found or patching fails, the patch process is not aborted and there's a warning...
https://github.com/BepInEx/HarmonyX/blob/master/Harmony/Public/Harmony.cs#L367 There exists a world where Guid.NewGuid() returns the same thing twice for different instances, and it creates a weird bug someone wastes time chasing. How about adding a check...
Traverse.Field and some other methods don't show any warning in log if the member doesn't actually exist (unlike AccessTools), which makes debugging harder. If the member doesn't exist then a...
.NET Sdk: .net 6.0 HarmonyX Version: 2.7.0 1. Create a .net 6.0 console application. 2. Add `appsettings.json` 3. Add PackageReference HarmonyX 2.7.0 and Microsoft.Extensions.Hosting 6.0.0 4. Add the following code...
``` System.AccessViolationException at HarmonyLib.Internal.RuntimeFixes.StackTraceFixes.GetMethodFix(System.Diagnostics.StackFrame) at System.Diagnostics.StackTrace.ToString(TraceFormat) at System.Exception.GetStackTrace(Boolean) at System.Exception.ToString(Boolean, Boolean) at System.String.Concat(System.Object, System.Object) at System.Web.HttpRuntime.ReleaseResourcesAndUnloadAppDomain(System.Object) at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem() at System.Threading.ThreadPoolWorkQueue.Dispatch()...