From 3df026c5cb2806495ecbb68b98badec1375b6c1b Mon Sep 17 00:00:00 2001 From: Katy Coe Date: Sat, 9 Jan 2021 02:37:45 +0100 Subject: [PATCH] DLL: Don't output offset for static fields --- Il2CppInspector.Common/Outputs/AssemblyShims.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Il2CppInspector.Common/Outputs/AssemblyShims.cs b/Il2CppInspector.Common/Outputs/AssemblyShims.cs index 7bd8bce..51fbff4 100644 --- a/Il2CppInspector.Common/Outputs/AssemblyShims.cs +++ b/Il2CppInspector.Common/Outputs/AssemblyShims.cs @@ -197,7 +197,7 @@ namespace Il2CppInspector.Outputs mField.AddAttribute(module, metadataOffsetAttribute, ("Offset", $"0x{field.DefaultValueMetadataAddress:X8}")); // Field offset - if (!field.IsLiteral && field.Offset != 0) + if (!field.IsLiteral && !field.IsStatic && field.Offset != 0) mField.AddAttribute(module, fieldOffsetAttribute, ("Offset", $"0x{field.Offset:X}")); // Add token attribute @@ -344,11 +344,11 @@ namespace Il2CppInspector.Outputs if (type == null) return null; - // Generic type parameter + // Generic type parameter (VAR) if (type.IsGenericTypeParameter) return new GenericVar(type.GenericParameterPosition); - // Generic method parameter + // Generic method parameter (MVAR) if (type.IsGenericMethodParameter) return new GenericMVar(type.GenericParameterPosition); @@ -361,11 +361,11 @@ namespace Il2CppInspector.Outputs type.DeclaringType != null? (IResolutionScope) GetTypeRef(module, type.DeclaringType).ScopeType : typeOwnerModuleRef) .ToTypeSig(); - // Non-generic type + // Non-generic type (CLASS / VALUETYPE) if (!type.GetGenericArguments().Any()) return typeSig; - // Generic type requires generic arguments + // Generic type requires generic arguments (GENERICINST) var genericInstSig = new GenericInstSig(typeSig.ToClassOrValueTypeSig(), type.GenericTypeArguments.Length); foreach (var gp in type.GetGenericArguments())