diff --git a/Il2CppInspector.Common/IL2CPP/Il2CppBinaryClasses.cs b/Il2CppInspector.Common/IL2CPP/Il2CppBinaryClasses.cs index 90ae910..c2e6e5f 100644 --- a/Il2CppInspector.Common/IL2CPP/Il2CppBinaryClasses.cs +++ b/Il2CppInspector.Common/IL2CPP/Il2CppBinaryClasses.cs @@ -192,6 +192,7 @@ namespace Il2CppInspector public uint attrs => (uint) bits & 0xffff; /* param attributes or field flags */ public Il2CppTypeEnum type => (Il2CppTypeEnum)((bits >> 16) & 0xff); + // TODO: Unity 2021.1: num_mods becomes 1 bit shorter, shifting byref and pinned right 1 bit, valuetype bit added public uint num_mods => (uint) (bits >> 24) & 0x3f; /* max 64 modifiers follow at the end */ public bool byref => ((bits >> 30) & 1) == 1; public bool pinned => (bits >> 31) == 1; /* valid when included in a local var signature */ diff --git a/Il2CppInspector.Common/Reflection/MethodInvoker.cs b/Il2CppInspector.Common/Reflection/MethodInvoker.cs index c002a01..d5b3c4f 100644 --- a/Il2CppInspector.Common/Reflection/MethodInvoker.cs +++ b/Il2CppInspector.Common/Reflection/MethodInvoker.cs @@ -63,6 +63,7 @@ namespace Il2CppInspector.Reflection public string Name => $"RuntimeInvoker_{!IsStatic}{ReturnType.BaseName.ToCIdentifier()}_" + string.Join("_", ParameterTypes.Select(p => p.BaseName.ToCIdentifier())); // Display as a C++ method signature; MethodInfo* is the same as RuntimeMethod* (see codegen/il2cpp-codegen-metadata.h) + // TODO: Unity 2021.1: the return value is now an extra argument, and the invokers always return void public string GetSignature(UnityVersion version) => version.CompareTo("2017.1.0") >= 0 ? $"void* {Name}(Il2CppMethodPointer pointer, const MethodInfo* methodMetadata, void* obj, void** args)"