Beispiel #1
0
        protected override ChunkList InternalGetChildren()
        {
            // TODO: This should probably be moved to be handled by TellTaleFile
            file.Position = Offset;
            var reader = file; //.GetChunkReader(this);

            var fileInfo = TTArchFile.PrepareFileInfo(reader);

            var result = new ChunkList();

            reader.Position = fileInfo.InfoOffset;
            uint folderCount = reader.ReadU32LE();

            for (uint i = 0; i < folderCount; i++)
            {
                uint   nameSize = reader.ReadU32LE();
                string name     = reader.ReadString(nameSize);
                result.Add(new TellTaleFileChunk(this.File, this, name, 0, 0));
            }

            uint fileCount = reader.ReadU32LE();

            for (uint i = 0; i < fileCount; i++)
            {
                uint   nameSize = reader.ReadU32LE();
                string name     = reader.ReadString(nameSize);

                uint  zero   = reader.ReadU32LE();
                ulong offset = reader.ReadU32LE() + fileInfo.VirtualBlocksOffset;
                uint  size   = reader.ReadU32LE();

                result.Add(new TellTaleFileChunk(this.File, this, name, offset, size));
            }

            return(result);
        }
Beispiel #2
0
 private TellTaleFileStructureInfo PrepareFileInfo(BinReader reader)
 {
     return(TTArchFile.PrepareFileInfo(reader));
 }