Exemplo n.º 1
0
        private Il2CppTypeDefinitionInfo AddStruct(Il2CppTypeDefinition typeDef, TypeDefinitionMetadata metadata, Il2CppGenericClass genericClass = null)
        {
            var typeInfo = executor.GetTypeDefInfo(typeDef, genericClass);

            typeInfo.ImageName = metadata.ImageName;
            if (typeDefToAddress.ContainsKey(typeDef))
            {
                typeInfo.Type.Address = typeDefToAddress[typeDef];
            }
            TypeInfoList.Add(typeInfo);
            return(typeInfo);
        }
Exemplo n.º 2
0
 // requires TypeMetadata
 private void IndexGenerics()
 {
     // build type -> generic instance lookup
     foreach (var il2CppType in il2Cpp.types.Where(x => x.type == Il2CppTypeEnum.IL2CPP_TYPE_GENERICINST))
     {
         var genericClass = il2Cpp.MapVATR <Il2CppGenericClass>(il2CppType.data.generic_class);
         var baseTypeDef  = executor.GetGenericClassTypeDefinition(genericClass);
         if (baseTypeDef == null)
         {
             continue;
         }
         TypeDefinitionMetadata baseTypeMetadata = TypeMetadata[baseTypeDef];
         var typeBaseName      = TypeMetadata[baseTypeDef].UniqueName;
         var typeToReplaceName = executor.GetTypeDefName(baseTypeDef, true, true);
         var typeReplaceName   = executor.GetTypeName(il2CppType, true, false);
         var typeStructName    = typeBaseName.Replace(typeToReplaceName, typeReplaceName);
         genericClassList.Add(il2CppType.data.generic_class);
         lookupGenericType[typeStructName] = il2CppType;
         lookupGenericClassName[il2CppType.data.generic_class] = typeStructName;
     }
 }