Exemplo n.º 1
0
        public void Deserialize(Stream input)
        {
            var magic = input.ReadValueU32(this.Endianness);

            if (magic != 0x54414653)
            {
                throw new NotSupportedException("Bad magic number");
            }

            this.Unknown04     = input.ReadValueU32(this.Endianness);
            this.NumberOfFiles = input.ReadValueU32(this.Endianness);

            var count = input.ReadValueU32(this.Endianness);

            this.Unknown10 = input.ReadValueU32(this.Endianness);

            this.BasePath = input.ReadString(32, true, Encoding.ASCII);

            this.Entries.Clear();
            for (uint i = 0; i < count; i++)
            {
                var entry = new Big.EntryV2();
                entry.NameHash = input.ReadValueU32(this.Endianness);
                entry.Locale   = input.ReadValueU32(this.Endianness);
                entry.Size     = input.ReadValueU32(this.Endianness);
                var offset = input.ReadValueU32(this.Endianness);
                entry.Offset = offset & 0xFFFFFF00;
                entry.File   = offset & 0xFF;
                this.Entries.Add(entry);
            }
        }
Exemplo n.º 2
0
        public void Deserialize(Stream input)
        {
            var magic = input.ReadValueU32(this.LittleEndian);

            if (magic != 0x54414653)
                throw new NotSupportedException("Bad magic number");

            this.Unknown04 = input.ReadValueU32(this.LittleEndian);
            this.NumberOfFiles = input.ReadValueU32(this.LittleEndian);

            var count = input.ReadValueU32(this.LittleEndian);

            this.Unknown10 = input.ReadValueU32(this.LittleEndian);

            this.BasePath = input.ReadString(32, true, Encoding.ASCII);

            this.Entries.Clear();
            for (uint i = 0; i < count; i++)
            {
                var entry = new Big.EntryV2();
                entry.NameHash = input.ReadValueU32(this.LittleEndian);
                entry.Locale = input.ReadValueU32(this.LittleEndian);
                entry.Size = input.ReadValueU32(this.LittleEndian);
                var offset = input.ReadValueU32(this.LittleEndian);
                entry.Offset = offset & 0xFFFFFF00;
                entry.File = offset & 0xFF;
                this.Entries.Add(entry);
            }
        }