Exemple #1
0
        private void DeserializeFileSystemBody()
        {
            _reader.BaseStream.Position = _directoryTableDataOffset;
            _directoryDescriptors       = new ReleaseManifestDirectoryDescriptor[_directoryTableCount];
            _directoryTable             = new ReleaseManifestDirectoryEntry[_directoryTableCount];
            _fileParentTable            = new ReleaseManifestDirectoryEntry[_fileTableCount];

            for (int i = 0; i < _directoryTableCount; i++)
            {
                _directoryDescriptors[i] = ReadDirectoryDescriptor();
            }

            DeserializeTreeifyDirectoryDescriptor(0);
            _manifest.Root        = _directoryTable[0];
            _manifest.Directories = _directoryTable;

            _reader.BaseStream.Position = _fileTableDataOffset;
            _files = new ReleaseManifestFileEntry[_fileTableCount];
            for (uint fileId = 0; fileId < _fileTableCount; fileId++)
            {
                ReleaseManifestFileEntryDescriptor fileDescriptor = ReadFileEntryDescriptor();
                _files[fileId] = new ReleaseManifestFileEntry(fileId, _manifest, fileDescriptor, _fileParentTable[fileId]);
            }

            _manifest.Files = _files;
        }
 public void SerializeFile(ReleaseManifestFileEntry file)
 {
     _writer.Write(file.NameStringTableIndex);
     _writer.Write(file.ArchiveId);
     _writer.Write(file.ChecksumLow);
     _writer.Write(file.ChecksumHigh);
     _writer.Write(file.EntityType);
     _writer.Write(file.DecompressedSize);
     _writer.Write(file.CompressedSize);
     _writer.Write(file.Checksum2);
     _writer.Write(file.PatcherEntityType);
     _writer.Write(file.UnknownConstant1);
     _writer.Write(file.UnknownConstan2);
 }