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;
        }
Example #2
0
 public ReleaseManifestFileEntry(uint fileId, ReleaseManifest releaseManifest, ReleaseManifestFileEntryDescriptor fileDescriptor, ReleaseManifestDirectoryEntry parent)
 {
     Id = fileId;
     ReleaseManifest = releaseManifest;
     Descriptor      = fileDescriptor;
     Parent          = parent;
     Parent.Files.Add(this);
 }
        private ReleaseManifestFileEntryDescriptor ReadFileEntryDescriptor()
        {
            ReleaseManifestFileEntryDescriptor result = new ReleaseManifestFileEntryDescriptor();

            result.NameIndex         = _reader.ReadUInt32();
            result.ArchiveId         = _reader.ReadUInt32();
            result.ChecksumLow       = _reader.ReadUInt64();
            result.ChecksumHigh      = _reader.ReadUInt64();
            result.EntityType        = _reader.ReadUInt32();
            result.DecompressedSize  = _reader.ReadUInt32();
            result.CompressedSize    = _reader.ReadUInt32();
            result.Checksum2         = _reader.ReadUInt32();
            result.PatcherEntityType = _reader.ReadUInt16();
            result.UnknownConstant1  = _reader.ReadByte();
            result.UnknownConstant2  = _reader.ReadByte();
            return(result);
        }