Esempio n. 1
0
        public static SctItemHeader CreateFromStream(DataStream dsr)
        {
            SctItemHeader itemHeader = new SctItemHeader();

            itemHeader.Offset           = dsr.ReadUint();
            itemHeader.Name             = dsr.ReadString(NameSize);
            itemHeader.FileNamePointers = new List <long>();
            return(itemHeader);
        }
Esempio n. 2
0
        private void ReadItemHeaders(DataStream ds)
        {
            for (uint i = 0; i < SctItemCount; i++)
            {
                uint          offset     = SctItemStartOffset + i * SctItemHeader.HeaderSize;
                SctItemHeader itemHeader = ds.ReadSctItemHeader(offset);
                if (i > 0)
                {
                    // Note: this assumes sequential ordering. If that proves false, we'd need to sort by offset first.
                    uint prevItemSize = itemHeader.Offset - ItemHeaders[(int)i - 1].Offset;
                    ItemHeaders[(int)i - 1].DataSize = prevItemSize;
                }

                itemHeader.DataOffset = SctItemStartOffset + ItemHeaderSectionSize + itemHeader.Offset;
                AddItemHeader(itemHeader);
            }
        }
Esempio n. 3
0
 public void AddItemHeader(SctItemHeader itemHeader)
 {
     ItemHeaders.Add(itemHeader);
 }