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

@@ -399,11 +399,13 @@ namespace Il2CppInspector.Cpp
var statics = types.Struct(name + "__StaticFields");
var namer = CreateNamespace().MakeNamer<FieldInfo>((field) => field.Name.ToCIdentifier());
foreach (var field in ti.DeclaredFields) {
if (field.IsLiteral || !field.IsStatic)
if (field.IsLiteral || !field.IsStatic || field.IsThreadStatic)
continue;
statics.AddField(namer.GetName(field), AsCType(field.FieldType));
}
// L-TODO: Maybe add structs for StaticThreadLocalFields? not sure how useful it would be because they are resolved at runtime
/* TODO: type the rgctx_data */
var cls = types.Struct(name + "__Class");
types.AddField(cls, "_0", "Il2CppClass_0");