Model: Handle generic type definition fetch for metadata v27
This commit is contained in:
@@ -202,7 +202,7 @@ namespace Il2CppInspector
|
|||||||
[Version(Max = 24.3)]
|
[Version(Max = 24.3)]
|
||||||
public long typeDefinitionIndex; /* the generic type definition */
|
public long typeDefinitionIndex; /* the generic type definition */
|
||||||
[Version(Min = 27)]
|
[Version(Min = 27)]
|
||||||
public long type; // Il2CppType* /* the generic type definition */
|
public ulong type; // Il2CppType* /* the generic type definition */
|
||||||
|
|
||||||
public Il2CppGenericContext context; /* a context that contains the type instantiation doesn't contain any method instantiation */
|
public Il2CppGenericContext context; /* a context that contains the type instantiation doesn't contain any method instantiation */
|
||||||
public ulong cached_class; /* if present, the Il2CppClass corresponding to the instantiation. */
|
public ulong cached_class; /* if present, the Il2CppClass corresponding to the instantiation. */
|
||||||
|
|||||||
@@ -195,15 +195,19 @@ namespace Il2CppInspector.Reflection
|
|||||||
// TODO: Replace with array load from Il2CppMetadataRegistration.genericClasses
|
// TODO: Replace with array load from Il2CppMetadataRegistration.genericClasses
|
||||||
var generic = image.ReadMappedObject<Il2CppGenericClass>(typeRef.datapoint); // Il2CppGenericClass *
|
var generic = image.ReadMappedObject<Il2CppGenericClass>(typeRef.datapoint); // Il2CppGenericClass *
|
||||||
|
|
||||||
// It appears that TypeRef can be -1 if the generic depth recursion limit
|
// Get generic type definition
|
||||||
// (--maximum-recursive-generic-depth=) is reached in Il2Cpp. In this case,
|
TypeInfo genericTypeDef;
|
||||||
// no generic instance type is generated, so we just produce a null TypeInfo here.
|
if (Package.Version < 27) {
|
||||||
|
// It appears that TypeRef can be -1 if the generic depth recursion limit
|
||||||
|
// (--maximum-recursive-generic-depth=) is reached in Il2Cpp. In this case,
|
||||||
|
// no generic instance type is generated, so we just produce a null TypeInfo here.
|
||||||
|
if ((generic.typeDefinitionIndex & 0xffff_ffff) == 0x0000_0000_ffff_ffff)
|
||||||
|
return null;
|
||||||
|
|
||||||
// TODO: Generic type definition index resolution is broken in metadata v27 (replaced with Il2CppType *type)
|
genericTypeDef = TypesByDefinitionIndex[generic.typeDefinitionIndex];
|
||||||
if ((generic.typeDefinitionIndex & 0xffff_ffff) == 0x0000_0000_ffff_ffff)
|
} else {
|
||||||
return null;
|
genericTypeDef = GetTypeFromVirtualAddress(generic.type);
|
||||||
|
}
|
||||||
var genericTypeDef = TypesByDefinitionIndex[generic.typeDefinitionIndex];
|
|
||||||
|
|
||||||
// Get the instantiation
|
// Get the instantiation
|
||||||
// TODO: Replace with array load from Il2CppMetadataRegistration.genericInsts
|
// TODO: Replace with array load from Il2CppMetadataRegistration.genericInsts
|
||||||
|
|||||||
Reference in New Issue
Block a user