diff --git a/Il2CppInterop.Generator/Utils/UnstripTranslator.cs b/Il2CppInterop.Generator/Utils/UnstripTranslator.cs index f21cab57..6187552c 100644 --- a/Il2CppInterop.Generator/Utils/UnstripTranslator.cs +++ b/Il2CppInterop.Generator/Utils/UnstripTranslator.cs @@ -57,18 +57,6 @@ public static bool TranslateMethod(MethodDefinition original, MethodDefinition t imports.Module.DefaultImporter.ImportMethod(imports.Il2CppArrayBase_get_Length.Value)); break; - case CilCode.Ldelema: - //This is Il2CppArrayBase.Pointer + index * sizeof(T) but the T is not known because the operand is null. - return false; - - case CilCode.Ldelem: - //This is Il2CppArrayBase.set_Item but the T is not known because the operand is null. - return false; - - case CilCode.Stelem: - //This is Il2CppArrayBase.set_Item but the T is not known because the operand is null. - return false; - case CilCode.Ldelem_Ref: //This is Il2CppReferenceArray.get_Item but the T is not known because the operand is null. return false; @@ -286,7 +274,7 @@ public static bool TranslateMethod(MethodDefinition original, MethodDefinition t imports.Module.DefaultImporter.ImportMethod(imports.Il2CppObjectBase_TryCast.Value.MakeGenericInstanceMethod(targetType))); instructionMap.Add(bodyInstruction, newInstruction); } - else if (bodyInstruction.OpCode == OpCodes.Newarr && !targetType.IsValueType) + else if (bodyInstruction.OpCode == OpCodes.Newarr) { var newInstruction = targetBuilder.Add(OpCodes.Conv_I8); @@ -307,6 +295,21 @@ public static bool TranslateMethod(MethodDefinition original, MethodDefinition t ReferenceCreator.CreateInstanceMethodReference(".ctor", imports.Module.Void(), il2cppTypeArray, imports.Module.Long()))); instructionMap.Add(bodyInstruction, newInstruction); } + else if (bodyInstruction.OpCode == OpCodes.Ldelema) + { + // Not implemented + return false; + } + else if (bodyInstruction.OpCode == OpCodes.Ldelem) + { + // Not implemented + return false; + } + else if (bodyInstruction.OpCode == OpCodes.Stelem) + { + // Not implemented + return false; + } else { var newInstruction = targetBuilder.Add(bodyInstruction.OpCode, targetType.ToTypeDefOrRef());