Minor tidying up

This commit is contained in:
Katy Coe
2020-01-28 05:57:24 +01:00
parent feed8aa378
commit a7027c886e
7 changed files with 27 additions and 24 deletions

View File

@@ -1,5 +1,5 @@
/*
Copyright 2017-2019 Katy Coe - http://www.hearthcode.org - http://www.djkaty.com
Copyright 2017-2020 Katy Coe - http://www.hearthcode.org - http://www.djkaty.com
All rights reserved.
*/
@@ -43,7 +43,7 @@ namespace Il2CppInspector.Reflection
Name = pkg.Strings[Definition.nameIndex];
eventTypeUsage = Definition.typeIndex;
var eventType = pkg.TypeUsages[eventTypeUsage];
var eventType = pkg.TypeReferences[eventTypeUsage];
if ((eventType.attrs & Il2CppConstants.FIELD_ATTRIBUTE_SPECIAL_NAME) == Il2CppConstants.FIELD_ATTRIBUTE_SPECIAL_NAME)
Attributes |= EventAttributes.SpecialName;

View File

@@ -1,5 +1,5 @@
/*
Copyright 2017-2019 Katy Coe - http://www.hearthcode.org - http://www.djkaty.com
Copyright 2017-2020 Katy Coe - http://www.hearthcode.org - http://www.djkaty.com
All rights reserved.
*/
@@ -82,7 +82,7 @@ namespace Il2CppInspector.Reflection {
Name = pkg.Strings[Definition.nameIndex];
fieldTypeUsage = Definition.typeIndex;
var fieldType = pkg.TypeUsages[fieldTypeUsage];
var fieldType = pkg.TypeReferences[fieldTypeUsage];
if ((fieldType.attrs & Il2CppConstants.FIELD_ATTRIBUTE_FIELD_ACCESS_MASK) == Il2CppConstants.FIELD_ATTRIBUTE_PRIVATE)
Attributes |= FieldAttributes.Private;

View File

@@ -1,5 +1,5 @@
/*
Copyright 2017-2019 Katy Coe - http://www.hearthcode.org - http://www.djkaty.com
Copyright 2017-2020 Katy Coe - http://www.hearthcode.org - http://www.djkaty.com
All rights reserved.
*/
@@ -70,7 +70,7 @@ namespace Il2CppInspector.Reflection
Position = paramIndex - declaringMethod.Definition.parameterStart;
paramTypeUsage = Definition.typeIndex;
var paramType = pkg.TypeUsages[paramTypeUsage];
var paramType = pkg.TypeReferences[paramTypeUsage];
if ((paramType.attrs & Il2CppConstants.PARAM_ATTRIBUTE_HAS_DEFAULT) != 0)
Attributes |= ParameterAttributes.HasDefault;

View File

@@ -440,7 +440,7 @@ namespace Il2CppInspector.Reflection {
// Nested type?
if (Definition.declaringTypeIndex >= 0) {
declaringTypeDefinitionIndex = (int) pkg.TypeUsages[Definition.declaringTypeIndex].datapoint;
declaringTypeDefinitionIndex = (int) pkg.TypeReferences[Definition.declaringTypeIndex].datapoint;
MemberType |= MemberTypes.NestedType;
}
@@ -590,7 +590,7 @@ namespace Il2CppInspector.Reflection {
// Nested type?
if (genericTypeDef.Definition.declaringTypeIndex >= 0) {
declaringTypeDefinitionIndex = (int)model.Package.TypeUsages[genericTypeDef.Definition.declaringTypeIndex].datapoint;
declaringTypeDefinitionIndex = (int)model.Package.TypeReferences[genericTypeDef.Definition.declaringTypeIndex].datapoint;
MemberType = memberType | MemberTypes.NestedType;
}
@@ -602,6 +602,9 @@ namespace Il2CppInspector.Reflection {
// Get the instantiation
var genericInstance = image.ReadMappedObject<Il2CppGenericInst>(generic.context.class_inst);
if (generic.context.method_inst != 0)
throw new InvalidOperationException("Generic method instance cannot be non-null when processing a generic class instance");
// Get list of pointers to type parameters (both unresolved and concrete)
var genericTypeArguments = image.ReadMappedWordArray(genericInstance.type_argv, (int)genericInstance.type_argc);