From b6f34bf486bd7dbb7847288146ca9b495bada04f Mon Sep 17 00:00:00 2001 From: Katy Coe Date: Thu, 9 Nov 2017 12:46:44 +0100 Subject: [PATCH] Update constants from Unity 2017.2 headers --- Il2CppInspector/DefineConstants.cs | 98 -------- Il2CppInspector/Il2CppConstants.cs | 238 ++++++++++++++++++++ Il2CppInspector/Il2CppInspector.cs | 4 +- Il2CppInspector/Il2CppReflector.cs | 4 +- Il2CppInspector/Reflection/FieldInfo.cs | 10 +- Il2CppInspector/Reflection/MethodInfo.cs | 8 +- Il2CppInspector/Reflection/ParameterInfo.cs | 4 +- Il2CppInspector/Reflection/TypeInfo.cs | 14 +- 8 files changed, 260 insertions(+), 120 deletions(-) delete mode 100644 Il2CppInspector/DefineConstants.cs create mode 100644 Il2CppInspector/Il2CppConstants.cs diff --git a/Il2CppInspector/DefineConstants.cs b/Il2CppInspector/DefineConstants.cs deleted file mode 100644 index 1ef015d..0000000 --- a/Il2CppInspector/DefineConstants.cs +++ /dev/null @@ -1,98 +0,0 @@ -using System.Collections.Generic; - -public static class DefineConstants -{ - public const int FIELD_ATTRIBUTE_PRIVATE = 0x0001; - public const int FIELD_ATTRIBUTE_PUBLIC = 0x0006; - public const int FIELD_ATTRIBUTE_STATIC = 0x0010; - public const int FIELD_ATTRIBUTE_INIT_ONLY = 0x0020; - public const int METHOD_ATTRIBUTE_MEMBER_ACCESS_MASK = 0x0007; - public const int METHOD_ATTRIBUTE_PRIVATE = 0x0001; - public const int METHOD_ATTRIBUTE_PUBLIC = 0x0006; - public const int METHOD_ATTRIBUTE_STATIC = 0x0010; - public const int METHOD_ATTRIBUTE_VIRTUAL = 0x0040; - public const int TYPE_ATTRIBUTE_VISIBILITY_MASK = 0x00000007; - public const int TYPE_ATTRIBUTE_PUBLIC = 0x00000001; - public const int TYPE_ATTRIBUTE_INTERFACE = 0x00000020; - public const int TYPE_ATTRIBUTE_ABSTRACT = 0x00000080; - public const int TYPE_ATTRIBUTE_SEALED = 0x00000100; - public const int TYPE_ATTRIBUTE_SERIALIZABLE = 0x00002000; - public const int PARAM_ATTRIBUTE_OUT = 0x0002; - public const int PARAM_ATTRIBUTE_OPTIONAL = 0x0010; - - public static List CSharpTypeString = new List - { - "END", - "void", - "bool", - "char", - "sbyte", - "byte", - "short", - "ushort", - "int", - "uint", - "long", - "ulong", - "float", - "double", - "string", - "PTR", // Processed separately - "BYREF", - "ValueType", // Processed separately - "CLASS", // Processed separately - "T", - "Array", // Processed separately - "GENERICINST", // Processed separately - "TYPEDBYREF", - "None", - "IntPtr", - "UIntPtr", - "None", - "delegate", - "object", - "SZARRAY", // Processed separately - "T", - "CMOD_REQD", - "CMOD_OPT", - "INTERNAL", - }; - - public static List FullNameTypeString = new List - { - "END", - "System.Void", - "System.Boolean", - "System.Char", - "System.SByte", - "System.Byte", - "System.Int16", - "System.UInt16", - "System.Int32", - "System.UInt32", - "System.Int64", - "System.UInt64", - "System.Single", - "System.Double", - "System.String", - "PTR", // Processed separately - "BYREF", - "System.ValueType", // Processed separately - "CLASS", // Processed separately - "T", - "System.Array", // Processed separately - "GENERICINST", // Processed separately - "TYPEDBYREF", - "None", - "System.IntPtr", - "System.UIntPtr", - "None", - "System.Delegate", - "System.Object", - "SZARRAY", // Processed separately - "T", - "CMOD_REQD", - "CMOD_OPT", - "INTERNAL", - }; -} \ No newline at end of file diff --git a/Il2CppInspector/Il2CppConstants.cs b/Il2CppInspector/Il2CppConstants.cs new file mode 100644 index 0000000..ce89178 --- /dev/null +++ b/Il2CppInspector/Il2CppConstants.cs @@ -0,0 +1,238 @@ +using System.Collections.Generic; + +// Constants from il2cpp/tabledefs.h + +namespace Il2CppInspector +{ + public static class Il2CppConstants + { + /* + * Field Attributes (21.1.5). + */ + + public const int FIELD_ATTRIBUTE_FIELD_ACCESS_MASK = 0x0007; + public const int FIELD_ATTRIBUTE_COMPILER_CONTROLLED = 0x0000; + public const int FIELD_ATTRIBUTE_PRIVATE = 0x0001; + public const int FIELD_ATTRIBUTE_FAM_AND_ASSEM = 0x0002; + public const int FIELD_ATTRIBUTE_ASSEMBLY = 0x0003; + public const int FIELD_ATTRIBUTE_FAMILY = 0x0004; + public const int FIELD_ATTRIBUTE_FAM_OR_ASSEM = 0x0005; + public const int FIELD_ATTRIBUTE_PUBLIC = 0x0006; + + public const int FIELD_ATTRIBUTE_STATIC = 0x0010; + public const int FIELD_ATTRIBUTE_INIT_ONLY = 0x0020; + public const int FIELD_ATTRIBUTE_LITERAL = 0x0040; + public const int FIELD_ATTRIBUTE_NOT_SERIALIZED = 0x0080; + public const int FIELD_ATTRIBUTE_SPECIAL_NAME = 0x0200; + public const int FIELD_ATTRIBUTE_PINVOKE_IMPL = 0x2000; + + /* For runtime use only */ + public const int FIELD_ATTRIBUTE_RESERVED_MASK = 0x9500; + + public const int FIELD_ATTRIBUTE_RT_SPECIAL_NAME = 0x0400; + public const int FIELD_ATTRIBUTE_HAS_FIELD_MARSHAL = 0x1000; + public const int FIELD_ATTRIBUTE_HAS_DEFAULT = 0x8000; + public const int FIELD_ATTRIBUTE_HAS_FIELD_RVA = 0x0100; + + /* + * Method Attributes (22.1.9) + */ + + public const int METHOD_IMPL_ATTRIBUTE_CODE_TYPE_MASK = 0x0003; + public const int METHOD_IMPL_ATTRIBUTE_IL = 0x0000; + public const int METHOD_IMPL_ATTRIBUTE_NATIVE = 0x0001; + public const int METHOD_IMPL_ATTRIBUTE_OPTIL = 0x0002; + public const int METHOD_IMPL_ATTRIBUTE_RUNTIME = 0x0003; + + public const int METHOD_IMPL_ATTRIBUTE_MANAGED_MASK = 0x0004; + public const int METHOD_IMPL_ATTRIBUTE_UNMANAGED = 0x0004; + public const int METHOD_IMPL_ATTRIBUTE_MANAGED = 0x0000; + + public const int METHOD_IMPL_ATTRIBUTE_FORWARD_REF = 0x0010; + public const int METHOD_IMPL_ATTRIBUTE_PRESERVE_SIG = 0x0080; + public const int METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL = 0x1000; + public const int METHOD_IMPL_ATTRIBUTE_SYNCHRONIZED = 0x0020; + public const int METHOD_IMPL_ATTRIBUTE_NOINLINING = 0x0008; + public const int METHOD_IMPL_ATTRIBUTE_MAX_METHOD_IMPL_VAL = 0xffff; + + public const int METHOD_ATTRIBUTE_MEMBER_ACCESS_MASK = 0x0007; + public const int METHOD_ATTRIBUTE_COMPILER_CONTROLLED = 0x0000; + public const int METHOD_ATTRIBUTE_PRIVATE = 0x0001; + public const int METHOD_ATTRIBUTE_FAM_AND_ASSEM = 0x0002; + public const int METHOD_ATTRIBUTE_ASSEM = 0x0003; + public const int METHOD_ATTRIBUTE_FAMILY = 0x0004; + public const int METHOD_ATTRIBUTE_FAM_OR_ASSEM = 0x0005; + public const int METHOD_ATTRIBUTE_PUBLIC = 0x0006; + + public const int METHOD_ATTRIBUTE_STATIC = 0x0010; + public const int METHOD_ATTRIBUTE_FINAL = 0x0020; + public const int METHOD_ATTRIBUTE_VIRTUAL = 0x0040; + public const int METHOD_ATTRIBUTE_HIDE_BY_SIG = 0x0080; + + public const int METHOD_ATTRIBUTE_VTABLE_LAYOUT_MASK = 0x0100; + public const int METHOD_ATTRIBUTE_REUSE_SLOT = 0x0000; + public const int METHOD_ATTRIBUTE_NEW_SLOT = 0x0100; + + public const int METHOD_ATTRIBUTE_STRICT = 0x0200; + public const int METHOD_ATTRIBUTE_ABSTRACT = 0x0400; + public const int METHOD_ATTRIBUTE_SPECIAL_NAME = 0x0800; + + public const int METHOD_ATTRIBUTE_PINVOKE_IMPL = 0x2000; + public const int METHOD_ATTRIBUTE_UNMANAGED_EXPORT = 0x0008; + + /* + * For runtime use only + */ + public const int METHOD_ATTRIBUTE_RESERVED_MASK = 0xd000; + public const int METHOD_ATTRIBUTE_RT_SPECIAL_NAME = 0x1000; + public const int METHOD_ATTRIBUTE_HAS_SECURITY = 0x4000; + public const int METHOD_ATTRIBUTE_REQUIRE_SEC_OBJECT = 0x8000; + + /* + * Type Attributes (21.1.13). + */ + public const int TYPE_ATTRIBUTE_VISIBILITY_MASK = 0x00000007; + public const int TYPE_ATTRIBUTE_NOT_PUBLIC = 0x00000000; + public const int TYPE_ATTRIBUTE_PUBLIC = 0x00000001; + public const int TYPE_ATTRIBUTE_NESTED_PUBLIC = 0x00000002; + public const int TYPE_ATTRIBUTE_NESTED_PRIVATE = 0x00000003; + public const int TYPE_ATTRIBUTE_NESTED_FAMILY = 0x00000004; + public const int TYPE_ATTRIBUTE_NESTED_ASSEMBLY = 0x00000005; + public const int TYPE_ATTRIBUTE_NESTED_FAM_AND_ASSEM = 0x00000006; + public const int TYPE_ATTRIBUTE_NESTED_FAM_OR_ASSEM = 0x00000007; + + public const int TYPE_ATTRIBUTE_LAYOUT_MASK = 0x00000018; + public const int TYPE_ATTRIBUTE_AUTO_LAYOUT = 0x00000000; + public const int TYPE_ATTRIBUTE_SEQUENTIAL_LAYOUT = 0x00000008; + public const int TYPE_ATTRIBUTE_EXPLICIT_LAYOUT = 0x00000010; + + public const int TYPE_ATTRIBUTE_CLASS_SEMANTIC_MASK = 0x00000020; + public const int TYPE_ATTRIBUTE_CLASS = 0x00000000; + public const int TYPE_ATTRIBUTE_INTERFACE = 0x00000020; + + public const int TYPE_ATTRIBUTE_ABSTRACT = 0x00000080; + public const int TYPE_ATTRIBUTE_SEALED = 0x00000100; + public const int TYPE_ATTRIBUTE_SPECIAL_NAME = 0x00000400; + + public const int TYPE_ATTRIBUTE_IMPORT = 0x00001000; + public const int TYPE_ATTRIBUTE_SERIALIZABLE = 0x00002000; + + public const int TYPE_ATTRIBUTE_STRING_FORMAT_MASK = 0x00030000; + public const int TYPE_ATTRIBUTE_ANSI_CLASS = 0x00000000; + public const int TYPE_ATTRIBUTE_UNICODE_CLASS = 0x00010000; + public const int TYPE_ATTRIBUTE_AUTO_CLASS = 0x00020000; + + public const int TYPE_ATTRIBUTE_BEFORE_FIELD_INIT = 0x00100000; + public const int TYPE_ATTRIBUTE_FORWARDER = 0x00200000; + + public const int TYPE_ATTRIBUTE_RESERVED_MASK = 0x00040800; + public const int TYPE_ATTRIBUTE_RT_SPECIAL_NAME = 0x00000800; + public const int TYPE_ATTRIBUTE_HAS_SECURITY = 0x00040000; + + /* + * Flags for Params (22.1.12) + */ + public const int PARAM_ATTRIBUTE_IN = 0x0001; + public const int PARAM_ATTRIBUTE_OUT = 0x0002; + public const int PARAM_ATTRIBUTE_OPTIONAL = 0x0010; + public const int PARAM_ATTRIBUTE_RESERVED_MASK = 0xf000; + public const int PARAM_ATTRIBUTE_HAS_DEFAULT = 0x1000; + public const int PARAM_ATTRIBUTE_HAS_FIELD_MARSHAL = 0x2000; + public const int PARAM_ATTRIBUTE_UNUSED = 0xcfe0; + + // Flags for Generic Parameters (II.23.1.7) + public const int GENERIC_PARAMETER_ATTRIBUTE_NON_VARIANT = 0x00; + public const int GENERIC_PARAMETER_ATTRIBUTE_COVARIANT = 0x01; + public const int GENERIC_PARAMETER_ATTRIBUTE_CONTRAVARIANT = 0x02; + public const int GENERIC_PARAMETER_ATTRIBUTE_VARIANCE_MASK = 0x03; + public const int GENERIC_PARAMETER_ATTRIBUTE_REFERENCE_TYPE_CONSTRAINT = 0x04; + public const int GENERIC_PARAMETER_ATTRIBUTE_NOT_NULLABLE_VALUE_TYPE_CONSTRAINT = 0x08; + public const int GENERIC_PARAMETER_ATTRIBUTE_DEFAULT_CONSTRUCTOR_CONSTRAINT = 0x10; + public const int GENERIC_PARAMETER_ATTRIBUTE_SPECIAL_CONSTRAINT_MASK = 0x1C; + + /** + * 21.5 AssemblyRefs + */ + public const int ASSEMBLYREF_FULL_PUBLIC_KEY_FLAG = 0x00000001; + public const int ASSEMBLYREF_RETARGETABLE_FLAG = 0x00000100; + public const int ASSEMBLYREF_ENABLEJITCOMPILE_TRACKING_FLAG = 0x00008000; + public const int ASSEMBLYREF_DISABLEJITCOMPILE_OPTIMIZER_FLAG = 0x00004000; + + // Naming conventions (follows order of Il2CppTypeEnum) + public static List CSharpTypeString = new List + { + "END", + "void", + "bool", + "char", + "sbyte", + "byte", + "short", + "ushort", + "int", + "uint", + "long", + "ulong", + "float", + "double", + "string", + "PTR", // Processed separately + "BYREF", + "ValueType", // Processed separately + "CLASS", // Processed separately + "T", + "Array", // Processed separately + "GENERICINST", // Processed separately + "TYPEDBYREF", + "None", + "IntPtr", + "UIntPtr", + "None", + "delegate", + "object", + "SZARRAY", // Processed separately + "T", + "CMOD_REQD", + "CMOD_OPT", + "INTERNAL", + }; + + public static List FullNameTypeString = new List + { + "END", + "System.Void", + "System.Boolean", + "System.Char", + "System.SByte", + "System.Byte", + "System.Int16", + "System.UInt16", + "System.Int32", + "System.UInt32", + "System.Int64", + "System.UInt64", + "System.Single", + "System.Double", + "System.String", + "PTR", // Processed separately + "BYREF", + "System.ValueType", // Processed separately + "CLASS", // Processed separately + "T", + "System.Array", // Processed separately + "GENERICINST", // Processed separately + "TYPEDBYREF", + "None", + "System.IntPtr", + "System.UIntPtr", + "None", + "System.Delegate", + "System.Object", + "SZARRAY", // Processed separately + "T", + "CMOD_REQD", + "CMOD_OPT", + "INTERNAL", + }; + } +} \ No newline at end of file diff --git a/Il2CppInspector/Il2CppInspector.cs b/Il2CppInspector/Il2CppInspector.cs index d13c8c1..3b03d0e 100644 --- a/Il2CppInspector/Il2CppInspector.cs +++ b/Il2CppInspector/Il2CppInspector.cs @@ -208,10 +208,10 @@ namespace Il2CppInspector ret = $"{GetTypeName(type)}[]"; } else { - if ((int) pType.type >= DefineConstants.CSharpTypeString.Count) + if ((int) pType.type >= Il2CppConstants.CSharpTypeString.Count) ret = "unknow"; else - ret = DefineConstants.CSharpTypeString[(int) pType.type]; + ret = Il2CppConstants.CSharpTypeString[(int) pType.type]; } return ret; } diff --git a/Il2CppInspector/Il2CppReflector.cs b/Il2CppInspector/Il2CppReflector.cs index f5b9b72..bef5d35 100644 --- a/Il2CppInspector/Il2CppReflector.cs +++ b/Il2CppInspector/Il2CppReflector.cs @@ -49,10 +49,10 @@ namespace Il2CppInspector.Reflection default: // Basic primitive types - if ((int) pType.type >= DefineConstants.FullNameTypeString.Count) + if ((int) pType.type >= Il2CppConstants.FullNameTypeString.Count) return null; - return Assemblies.SelectMany(x => x.DefinedTypes).First(x => x.FullName == DefineConstants.FullNameTypeString[(int)pType.type]); + return Assemblies.SelectMany(x => x.DefinedTypes).First(x => x.FullName == Il2CppConstants.FullNameTypeString[(int)pType.type]); } } } diff --git a/Il2CppInspector/Reflection/FieldInfo.cs b/Il2CppInspector/Reflection/FieldInfo.cs index 75e863f..e8621df 100644 --- a/Il2CppInspector/Reflection/FieldInfo.cs +++ b/Il2CppInspector/Reflection/FieldInfo.cs @@ -63,14 +63,14 @@ namespace Il2CppInspector.Reflection { Name = pkg.Strings[Definition.nameIndex]; fieldType = pkg.TypeUsages[Definition.typeIndex]; - if ((fieldType.attrs & DefineConstants.FIELD_ATTRIBUTE_PRIVATE) == DefineConstants.FIELD_ATTRIBUTE_PRIVATE) + if ((fieldType.attrs & Il2CppConstants.FIELD_ATTRIBUTE_PRIVATE) == Il2CppConstants.FIELD_ATTRIBUTE_PRIVATE) Attributes |= FieldAttributes.Private; - if ((fieldType.attrs & DefineConstants.FIELD_ATTRIBUTE_PUBLIC) == DefineConstants.FIELD_ATTRIBUTE_PUBLIC) + if ((fieldType.attrs & Il2CppConstants.FIELD_ATTRIBUTE_PUBLIC) == Il2CppConstants.FIELD_ATTRIBUTE_PUBLIC) Attributes |= FieldAttributes.Public; - if ((fieldType.attrs & DefineConstants.FIELD_ATTRIBUTE_STATIC) == DefineConstants.FIELD_ATTRIBUTE_STATIC) + if ((fieldType.attrs & Il2CppConstants.FIELD_ATTRIBUTE_STATIC) == Il2CppConstants.FIELD_ATTRIBUTE_STATIC) Attributes |= FieldAttributes.Static; - if ((fieldType.attrs & DefineConstants.FIELD_ATTRIBUTE_INIT_ONLY) == - DefineConstants.FIELD_ATTRIBUTE_INIT_ONLY) + if ((fieldType.attrs & Il2CppConstants.FIELD_ATTRIBUTE_INIT_ONLY) == + Il2CppConstants.FIELD_ATTRIBUTE_INIT_ONLY) Attributes |= FieldAttributes.InitOnly; // Default initialization value if present diff --git a/Il2CppInspector/Reflection/MethodInfo.cs b/Il2CppInspector/Reflection/MethodInfo.cs index c9a4322..e298439 100644 --- a/Il2CppInspector/Reflection/MethodInfo.cs +++ b/Il2CppInspector/Reflection/MethodInfo.cs @@ -39,13 +39,13 @@ namespace Il2CppInspector.Reflection } Name = pkg.Strings[Definition.nameIndex]; - if ((Definition.flags & DefineConstants.METHOD_ATTRIBUTE_MEMBER_ACCESS_MASK) == DefineConstants.METHOD_ATTRIBUTE_PRIVATE) + if ((Definition.flags & Il2CppConstants.METHOD_ATTRIBUTE_MEMBER_ACCESS_MASK) == Il2CppConstants.METHOD_ATTRIBUTE_PRIVATE) Attributes |= MethodAttributes.Private; - if ((Definition.flags & DefineConstants.METHOD_ATTRIBUTE_MEMBER_ACCESS_MASK) == DefineConstants.METHOD_ATTRIBUTE_PUBLIC) + if ((Definition.flags & Il2CppConstants.METHOD_ATTRIBUTE_MEMBER_ACCESS_MASK) == Il2CppConstants.METHOD_ATTRIBUTE_PUBLIC) Attributes |= MethodAttributes.Public; - if ((Definition.flags & DefineConstants.METHOD_ATTRIBUTE_VIRTUAL) != 0) + if ((Definition.flags & Il2CppConstants.METHOD_ATTRIBUTE_VIRTUAL) != 0) Attributes |= MethodAttributes.Virtual; - if ((Definition.flags & DefineConstants.METHOD_ATTRIBUTE_STATIC) != 0) + if ((Definition.flags & Il2CppConstants.METHOD_ATTRIBUTE_STATIC) != 0) Attributes |= MethodAttributes.Static; // Add return parameter diff --git a/Il2CppInspector/Reflection/ParameterInfo.cs b/Il2CppInspector/Reflection/ParameterInfo.cs index 8dee046..bab31fa 100644 --- a/Il2CppInspector/Reflection/ParameterInfo.cs +++ b/Il2CppInspector/Reflection/ParameterInfo.cs @@ -56,9 +56,9 @@ namespace Il2CppInspector.Reflection Position = paramIndex - declaringMethod.Definition.parameterStart; paramType = pkg.TypeUsages[param.typeIndex]; - if ((paramType.attrs & DefineConstants.PARAM_ATTRIBUTE_OPTIONAL) != 0) + if ((paramType.attrs & Il2CppConstants.PARAM_ATTRIBUTE_OPTIONAL) != 0) Attributes |= ParameterAttributes.Optional; - if ((paramType.attrs & DefineConstants.PARAM_ATTRIBUTE_OUT) != 0) + if ((paramType.attrs & Il2CppConstants.PARAM_ATTRIBUTE_OUT) != 0) Attributes |= ParameterAttributes.Out; if (Position == -1) diff --git a/Il2CppInspector/Reflection/TypeInfo.cs b/Il2CppInspector/Reflection/TypeInfo.cs index 1577cc7..ce0f1ba 100644 --- a/Il2CppInspector/Reflection/TypeInfo.cs +++ b/Il2CppInspector/Reflection/TypeInfo.cs @@ -30,8 +30,8 @@ namespace Il2CppInspector.Reflection { public string CSharpName { get { var s = Namespace + "." + base.Name; - var i = DefineConstants.FullNameTypeString.IndexOf(s); - var n = (i != -1 ? DefineConstants.CSharpTypeString[i] : base.Name); + var i = Il2CppConstants.FullNameTypeString.IndexOf(s); + var n = (i != -1 ? Il2CppConstants.CSharpTypeString[i] : base.Name); if (IsArray) n = ElementType.CSharpName; var g = (GenericTypeParameters != null ? "<" + string.Join(", ", GenericTypeParameters.Select(x => x.CSharpName)) + ">" : ""); @@ -121,15 +121,15 @@ namespace Il2CppInspector.Reflection { Namespace = pkg.Strings[Definition.namespaceIndex]; Name = pkg.Strings[pkg.TypeDefinitions[typeIndex].nameIndex]; - if ((Definition.flags & DefineConstants.TYPE_ATTRIBUTE_SERIALIZABLE) != 0) + if ((Definition.flags & Il2CppConstants.TYPE_ATTRIBUTE_SERIALIZABLE) != 0) Attributes |= TypeAttributes.Serializable; - if ((Definition.flags & DefineConstants.TYPE_ATTRIBUTE_VISIBILITY_MASK) == DefineConstants.TYPE_ATTRIBUTE_PUBLIC) + if ((Definition.flags & Il2CppConstants.TYPE_ATTRIBUTE_VISIBILITY_MASK) == Il2CppConstants.TYPE_ATTRIBUTE_PUBLIC) Attributes |= TypeAttributes.Public; - if ((Definition.flags & DefineConstants.TYPE_ATTRIBUTE_ABSTRACT) != 0) + if ((Definition.flags & Il2CppConstants.TYPE_ATTRIBUTE_ABSTRACT) != 0) Attributes |= TypeAttributes.Abstract; - if ((Definition.flags & DefineConstants.TYPE_ATTRIBUTE_SEALED) != 0) + if ((Definition.flags & Il2CppConstants.TYPE_ATTRIBUTE_SEALED) != 0) Attributes |= TypeAttributes.Sealed; - if ((Definition.flags & DefineConstants.TYPE_ATTRIBUTE_INTERFACE) != 0) + if ((Definition.flags & Il2CppConstants.TYPE_ATTRIBUTE_INTERFACE) != 0) Attributes |= TypeAttributes.Interface; // Not sure about this, works for now