/// <summary> 使用外部的<see cref="WzFileStream"/>讀取資料 </summary> public bool Read(WzFileStream zs) { string identifier = zs.ReadString(4); if (!identifier.Equals("PKG1")) { return(false); } this.DataSize = zs.Read8(); this.DataOffset = zs.Read4u(); this.Description = zs.ReadString((int)(this.DataOffset - zs.Tell())); zs.BaseOffset = this.DataOffset; ushort cryptedHash = zs.Read2u(); this.RootDirectory.Offset = (uint)zs.Tell(); for (int j = 0; j < 0xFFFF; j++) { this.Hash = HashTools.GenerateArchiveVersionHash(j.ToString()); if (HashTools.EncryptArchiveVersionHash(this.Hash) == cryptedHash) { zs.StringPool.Clear(); if (this.RootDirectory.Read(zs)) { this.Version = j; return(true); } } } return(false); }
internal override void Read(WzFileStream fs) { this.Value = fs.Read8(true); }