Skip to content

Commit d4d2abd

Browse files
authored
Merge pull request #401 from Kasuromi/master
[Il2Cpp] Use UnityVersionHandler's Size Providers in Harmony Backend
2 parents 4a290db + ff004dc commit d4d2abd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

BepInEx.IL2CPP/Hook/IL2CPPDetourMethodPatcher.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ private void Init()
104104
// Create a modified native MethodInfo struct to point towards the trampoline
105105
modifiedNativeMethodInfo = UnityVersionHandler.NewMethod();
106106
Buffer.MemoryCopy(originalNativeMethodInfo.Pointer.ToPointer(),
107-
modifiedNativeMethodInfo.Pointer.ToPointer(), modifiedNativeMethodInfo.StructSize,
108-
originalNativeMethodInfo.StructSize);
107+
modifiedNativeMethodInfo.Pointer.ToPointer(), UnityVersionHandler.MethodSize(),
108+
UnityVersionHandler.MethodSize());
109109
modifiedNativeMethodInfo.MethodPointer = trampolinePtr;
110110
isValid = true;
111111
}

0 commit comments

Comments
 (0)