Example #1
0
 public void ReadEntries(Stream s)
 {
     s.Seek((long)((ulong)this.Entries.Offset), SeekOrigin.Begin);
     for (uint num = 0U; num < this.Entries.Size; num += 1U)
     {
         PkgEntry pkgEntry = default(PkgEntry);
         pkgEntry.EntryNumber      = num;
         pkgEntry.EntryA           = Helpers.ReadUInt(s);
         pkgEntry.TypeA            = Helpers.ReadUInt(s);
         pkgEntry.EntryB           = Helpers.ReadULong(s);
         pkgEntry.StartBlock       = (uint)(pkgEntry.EntryB & 0x3FFFUL);
         pkgEntry.StartBlockOffset = this.Blocks.Offset + pkgEntry.StartBlock * 0x30U;
         int          index        = this._pkgListEntries.FindIndex(new Predicate <PkgListEntry>(this.ReadEntries19));
         PkgListEntry pkgListEntry = this._pkgListEntries[index];
         BlockEntry   blockEntry   = this.BlockEntryList[(int)pkgEntry.StartBlock];
         pkgEntry.StartBlockPkg = string.Concat(new object[]
         {
             pkgListEntry.Basename,
             "_",
             blockEntry.PatchId,
             ".pkg"
         });
         pkgEntry.InBlockOffset = (uint)((pkgEntry.EntryB >> 0xE & 0x3FFFUL) * 0x10UL);
         pkgEntry.EntrySize     = (uint)(pkgEntry.EntryB >> 0x1C & 0x3FFFFFFFUL);
         pkgEntry.BlockCount    = this.CalcBlockCount(pkgEntry.InBlockOffset, pkgEntry.EntrySize);
         pkgEntry.UnkEntryInfo  = (uint)(pkgEntry.EntryB >> 0x3A & 0x3FUL);
         pkgEntry.Filename      = string.Concat(new string[]
         {
             this.Header.PackageId.ToString("X4"),
             "_",
             pkgEntry.EntryNumber.ToString("X4"),
             "_",
             this.Header.LangId.ToString("X2")
         });
         pkgEntry.FileType = FileClassification.FileClassify(pkgEntry.EntryA, pkgEntry.TypeA);
         this.PkgEntryList.Add(pkgEntry);
     }
 }