Add support for ThreadStatic fields

This commit is contained in:
LukeFZ
2023-12-01 07:08:48 +01:00
parent 227aefedef
commit 7e7d345c30
4 changed files with 16 additions and 2 deletions

View File

@@ -29,6 +29,8 @@ namespace Il2CppInspector.Reflection {
public bool HasFieldRVA => (Attributes & FieldAttributes.HasFieldRVA) != 0;
public ulong DefaultValueMetadataAddress { get; }
public bool IsThreadStatic { get; }
// Custom attributes for this member
public override IEnumerable<CustomAttributeData> CustomAttributes => CustomAttributeData.GetCustomAttributes(rootDefinition);
@@ -96,6 +98,11 @@ namespace Il2CppInspector.Reflection {
Name = pkg.Strings[Definition.nameIndex];
rawOffset = pkg.FieldOffsets[fieldIndex];
if (0 > rawOffset)
{
IsThreadStatic = true;
rawOffset &= ~0x80000000;
}
rootDefinition = this;