Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to Harmonyx 2.13 #139

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="HarmonyX" Version="2.10.0"/>
<PackageReference Include="HarmonyX" Version="2.13.0"/>
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions Il2CppInterop.Runtime/Injection/DetourProvider.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Runtime.InteropServices;
using Il2CppInterop.Runtime.Startup;

namespace Il2CppInterop.Runtime.Injection;
Expand All @@ -10,7 +11,6 @@ public interface IDetour : IDisposable
nint OriginalTrampoline { get; }

void Apply();
T GenerateTrampoline<T>() where T : Delegate;
}

public interface IDetourProvider
Expand All @@ -23,8 +23,8 @@ internal static class Detour
public static IDetour Apply<T>(nint original, T target, out T trampoline) where T : Delegate
{
var detour = Il2CppInteropRuntime.Instance.DetourProvider.Create(original, target);
trampoline = detour.GenerateTrampoline<T>();
detour.Apply();
trampoline = Marshal.GetDelegateForFunctionPointer<T>(detour.OriginalTrampoline);
return detour;
}
}
Loading