diff --git a/Il2CppDumper/Il2CppDumper.cs b/Il2CppDumper/Il2CppDumper.cs index 0d74b9a..09ee5cf 100644 --- a/Il2CppDumper/Il2CppDumper.cs +++ b/Il2CppDumper/Il2CppDumper.cs @@ -30,15 +30,17 @@ namespace Il2CppInspector writer.Write("public "); if (type.IsAbstract) writer.Write("abstract "); - if (type.IsSealed) + if (type.IsSealed && !type.IsValueType) writer.Write("sealed "); if (type.IsInterface) writer.Write("interface "); + else if (type.IsValueType) + writer.Write("struct "); else writer.Write("class "); - var baseText = type.BaseType?.CSharpName ?? "object"; - baseText = baseText == "object" ? string.Empty : " : " + baseText; + var baseText = type.BaseType?.CSharpName ?? string.Empty; + baseText = (baseText == "object" || baseText == "ValueType" || baseText == string.Empty)? string.Empty : " : " + baseText; writer.Write($"{type.Name}{baseText} // TypeDefIndex: {type.Index}\n{{\n"); diff --git a/Il2CppInspector/Reflection/TypeInfo.cs b/Il2CppInspector/Reflection/TypeInfo.cs index 755a141..799ca97 100644 --- a/Il2CppInspector/Reflection/TypeInfo.cs +++ b/Il2CppInspector/Reflection/TypeInfo.cs @@ -84,7 +84,7 @@ namespace Il2CppInspector.Reflection { public bool IsPublic => (Attributes & TypeAttributes.Public) == TypeAttributes.Public; public bool IsSealed => (Attributes & TypeAttributes.Sealed) == TypeAttributes.Sealed; public bool IsSerializable => (Attributes & TypeAttributes.Serializable) == TypeAttributes.Serializable; - public bool IsValueType => throw new NotImplementedException(); + public bool IsValueType => BaseType?.FullName == "System.ValueType"; public override MemberTypes MemberType { get; }