Пример #1
0
 public void Read(bool hasTypeTree, AssetsFileReader reader, uint version)
 {
     classId = reader.ReadInt32();
     if (version >= 0x10)
     {
         unknown16_1 = reader.ReadByte();
     }
     if (version >= 0x11)
     {
         scriptIndex = reader.ReadUInt16();
     }
     else
     {
         scriptIndex = 0xffff;
     }
     if ((version < 0x11 && classId < 0) || (version >= 0x11 && classId == 0x72))
     {
         scriptHash1 = reader.ReadUInt32();
         scriptHash2 = reader.ReadUInt32();
         scriptHash3 = reader.ReadUInt32();
         scriptHash4 = reader.ReadUInt32();
     }
     typeHash1 = reader.ReadUInt32();
     typeHash2 = reader.ReadUInt32();
     typeHash3 = reader.ReadUInt32();
     typeHash4 = reader.ReadUInt32();
     if (hasTypeTree)
     {
         typeFieldsExCount = reader.ReadUInt32();
         stringTableLen    = reader.ReadUInt32();
         typeFieldsEx      = new TypeField_0D[typeFieldsExCount];
         for (int i = 0; i < typeFieldsExCount; i++)
         {
             TypeField_0D typefield0d = new TypeField_0D();
             typefield0d.Read(reader, version);
             typeFieldsEx[i] = typefield0d;
         }
         stringTable = Encoding.UTF8.GetString(reader.ReadBytes((int)stringTableLen));
         if (version >= 0x15)
         {
             dependenciesCount = reader.ReadInt32();
             dependencies      = new int[dependenciesCount];
             for (int i = 0; i < dependenciesCount; i++)
             {
                 dependencies[i] = reader.ReadInt32();
             }
         }
     }
 }
Пример #2
0
 public ulong Read(bool hasTypeTree, ulong absFilePos, AssetsFileReader reader, uint version, uint typeVersion, bool bigEndian)
 {
     classId = reader.ReadInt32();
     if (version >= 0x10)
     {
         unknown16_1 = reader.ReadByte();
     }
     if (version >= 0x11)
     {
         scriptIndex = reader.ReadUInt16();
     }
     //if ((version < 0x11 && classId < 0) || (version >= 0x11 && scriptIndex != 0xFFFF)) //original is if (classId == 114)
     //if ((version < 0x11 && classId < 0) || (version >= 0x11 && scriptIndex != 0xFFFF))
     if ((version < 0x11 && classId < 0) || (version >= 0x11 && classId == 114))
     {
         unknown1 = reader.ReadUInt32();
         unknown2 = reader.ReadUInt32();
         unknown3 = reader.ReadUInt32();
         unknown4 = reader.ReadUInt32();
     }
     unknown5 = reader.ReadUInt32();
     unknown6 = reader.ReadUInt32();
     unknown7 = reader.ReadUInt32();
     unknown8 = reader.ReadUInt32();
     if (hasTypeTree)
     {
         typeFieldsExCount = reader.ReadUInt32();
         stringTableLen    = reader.ReadUInt32();
         pTypeFieldsEx     = new TypeField_0D[typeFieldsExCount];
         for (int i = 0; i < typeFieldsExCount; i++)
         {
             TypeField_0D typefield0d = new TypeField_0D();
             typefield0d.Read(reader.Position, reader, version, bigEndian);
             pTypeFieldsEx[i] = typefield0d;
         }
         pStringTable = Encoding.UTF8.GetString(reader.ReadBytes((int)stringTableLen));
     }
     return(reader.Position);
 }