Exemple #1
0
        public Archive(string filename)
        {
            ArchivePath = filename;

            using var stream = File.OpenRead(ArchivePath);
            using var reader = new EndianAwareBinaryReader(stream);

            reader.AssertTag(BlockType.HEL, BlockType.HEB);
            reader.IsBigEndian = reader.PeekChar() == 0;

            // contains file offsets and a string block containing
            // archive details. probably includes page size and offset
            // to MAST block
            Data = reader.ReadBytes(0x800 - 4);

            reader.AssertTag(BlockType.MAST);
            MAST = new MAST(reader);

            // this is reversed to signify this is the section header
            // for multi-sectioned files (which don't exist)
            reader.AssertTag(BlockType.TCES, BlockType.SECT);
            TCES = new TCES(reader);

            // can't find references to this?
            StringTable = reader.ReadString(MAST.StringTableSize);

            reader.Seek(TCES.PageOffset << 11, SeekOrigin.Begin);

            Section = new Section(reader);
        }