mirror of
https://github.com/Perfare/Il2CppDumper.git
synced 2025-01-25 02:03:02 -03:00
将nestedtype的处理挪到外面
This commit is contained in:
parent
650ca2e67e
commit
66528fb843
1 changed files with 17 additions and 17 deletions
|
@ -67,28 +67,28 @@ namespace Il2CppDumper
|
|||
var typeDef = metadata.typeDefs[index];
|
||||
var namespaceName = metadata.GetStringFromIndex(typeDef.namespaceIndex);
|
||||
var typeName = metadata.GetStringFromIndex(typeDef.nameIndex);
|
||||
TypeDefinition typeDefinition;
|
||||
if (typeDef.declaringTypeIndex != -1)//nested types
|
||||
var typeDefinition = new TypeDefinition(namespaceName, typeName, (TypeAttributes)typeDef.flags);
|
||||
typeDefinitionDic.Add(typeDef, typeDefinition);
|
||||
if (typeDef.declaringTypeIndex == -1)
|
||||
{
|
||||
typeDefinition = typeDefinitionDic[typeDef];
|
||||
}
|
||||
else
|
||||
{
|
||||
typeDefinition = new TypeDefinition(namespaceName, typeName, (TypeAttributes)typeDef.flags);
|
||||
moduleDefinition.Types.Add(typeDefinition);
|
||||
typeDefinitionDic.Add(typeDef, typeDefinition);
|
||||
}
|
||||
//nestedtype
|
||||
for (int i = 0; i < typeDef.nested_type_count; i++)
|
||||
{
|
||||
var nestedIndex = metadata.nestedTypeIndices[typeDef.nestedTypesStart + i];
|
||||
var nestedTypeDef = metadata.typeDefs[nestedIndex];
|
||||
var nestedTypeDefinition = new TypeDefinition(metadata.GetStringFromIndex(nestedTypeDef.namespaceIndex), metadata.GetStringFromIndex(nestedTypeDef.nameIndex), (TypeAttributes)nestedTypeDef.flags);
|
||||
typeDefinition.NestedTypes.Add(nestedTypeDefinition);
|
||||
typeDefinitionDic.Add(nestedTypeDef, nestedTypeDefinition);
|
||||
}
|
||||
}
|
||||
}
|
||||
for (var index = 0; index < metadata.typeDefs.Length; ++index)
|
||||
{
|
||||
var typeDef = metadata.typeDefs[index];
|
||||
var typeDefinition = typeDefinitionDic[typeDef];
|
||||
|
||||
//nestedtype
|
||||
for (int i = 0; i < typeDef.nested_type_count; i++)
|
||||
{
|
||||
var nestedIndex = metadata.nestedTypeIndices[typeDef.nestedTypesStart + i];
|
||||
var nestedTypeDef = metadata.typeDefs[nestedIndex];
|
||||
var nestedTypeDefinition = typeDefinitionDic[nestedTypeDef];
|
||||
typeDefinition.NestedTypes.Add(nestedTypeDefinition);
|
||||
}
|
||||
}
|
||||
//提前处理
|
||||
for (var index = 0; index < metadata.typeDefs.Length; ++index)
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue