Minor tidying up
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user