From ad9b16fa2f38e3df26ea431a60cb564d81a1430c Mon Sep 17 00:00:00 2001 From: sir0x <3425560+sir0x1@users.noreply.github.com> Date: Tue, 29 Aug 2023 01:22:23 +0200 Subject: [PATCH] Fix "No method found for vtable entry" for methods with void* parameter --- Il2CppInterop.Runtime/Injection/ClassInjector.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Il2CppInterop.Runtime/Injection/ClassInjector.cs b/Il2CppInterop.Runtime/Injection/ClassInjector.cs index 5d0b3254..b54ed9cb 100644 --- a/Il2CppInterop.Runtime/Injection/ClassInjector.cs +++ b/Il2CppInterop.Runtime/Injection/ClassInjector.cs @@ -534,7 +534,7 @@ private static bool IsTypeSupported(Type type) if (type.IsValueType || type == typeof(string) || type.IsGenericParameter) return true; - if (type.IsByRef) return IsTypeSupported(type.GetElementType()); + if (type.IsByRef || type.IsPointer) return IsTypeSupported(type.GetElementType()); return typeof(Il2CppObjectBase).IsAssignableFrom(type); } @@ -655,7 +655,7 @@ private static bool IsMethodEligible(MethodInfo method) var parameterType = parameterInfo.ParameterType; if (!parameterType.IsGenericParameter) { - if (parameterType.IsByRef) + if (parameterType.IsByRef || parameterType.IsPointer) { var elementType = parameterType.GetElementType(); if (!elementType.IsGenericParameter) @@ -1083,7 +1083,7 @@ private static Type RewriteType(Type type) if (type.IsValueType && !type.IsEnum) return type; - if (type == typeof(string)) + if (type == typeof(string) || type == typeof(void*)) return type; if (type.IsArray)