Skip to content

Commit

Permalink
Ignore ret in GetGenericVirtualMethod only for unity 2020
Browse files Browse the repository at this point in the history
  • Loading branch information
js6pak committed Jun 15, 2023
1 parent 4ef3f4a commit c589498
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using Il2CppInterop.Common;
using Il2CppInterop.Common.XrefScans;
using Il2CppInterop.Runtime.Runtime;
using Il2CppInterop.Runtime.Startup;
using Microsoft.Extensions.Logging;

namespace Il2CppInterop.Runtime.Injection.Hooks
Expand Down Expand Up @@ -84,7 +85,7 @@ public override IntPtr FindTargetMethod()
var shimXrefs = XrefScannerLowLevel.JumpTargets(shim).ToArray();

// If the xref count is 1, it probably means the target is after ret
if (shimXrefs.Length == 1)
if (Il2CppInteropRuntime.Instance.UnityVersion.Major == 2020 && shimXrefs.Length == 1)
{
shimXrefs = XrefScannerLowLevel.JumpTargets(shim, true).ToArray();
}
Expand Down

0 comments on commit c589498

Please sign in to comment.