Beispiel #1
0
        public void Deserialize(Stream input, Endian endianness)
        {
            if (input.Length < 20)
            {
                throw new FormatException("bad section header size?");
            }

            var count0 = input.ReadValueU32(endianness);
            var count1 = input.ReadValueU32(endianness);
            var count2 = input.ReadValueU32(endianness);
            var count3 = input.ReadValueU32(endianness);
            var count4 = input.ReadValueU32(endianness);

            this.LocalDataResolvers.Clear();
            for (uint i = 0; i < count0; i++)
            {
                var unknown = new LocalDataResolver();
                unknown.Deserialize(input);
                this.LocalDataResolvers.Add(unknown);
            }

            this.RemoteDataResolvers.Clear();
            for (uint i = 0; i < count1; i++)
            {
                var unknown = new RemoteDataResolver();
                unknown.Deserialize(input);
                this.RemoteDataResolvers.Add(unknown);
            }

            this.Unknown2s.Clear();
            for (uint i = 0; i < count2; i++)
            {
                var unknown = new Unknown2Resolver();
                unknown.Deserialize(input);
                this.Unknown2s.Add(unknown);
            }

            this.Unknown3s.Clear();
            if (count3 > 0)
            {
                throw new NotSupportedException();
            }

            /*
             * for (uint i = 0; i < count3; i++)
             * {
             *      var a = input.ReadValueU32();
             *      this.Unknown3s.Add(a);
             * }
             */

            this.Unknown4s.Clear();
            for (uint i = 0; i < count4; i++)
            {
                var unknown = new Unknown4Resolver();
                unknown.Deserialize(input);
                this.Unknown4s.Add(unknown);
            }
        }
Beispiel #2
0
        public void Deserialize(Stream input, Endian endianness)
        {
            if (input.Length < 20)
            {
                throw new FormatException("bad section header size?");
            }

            var count0 = input.ReadValueU32(endianness);
            var count1 = input.ReadValueU32(endianness);
            var count2 = input.ReadValueU32(endianness);
            var count3 = input.ReadValueU32(endianness);
            var count4 = input.ReadValueU32(endianness);

            this.LocalDataResolvers.Clear();
            for (uint i = 0; i < count0; i++)
            {
                var unknown = new LocalDataResolver();
                unknown.Deserialize(input);
                this.LocalDataResolvers.Add(unknown);
            }

            this.RemoteDataResolvers.Clear();
            for (uint i = 0; i < count1; i++)
            {
                var unknown = new RemoteDataResolver();
                unknown.Deserialize(input);
                this.RemoteDataResolvers.Add(unknown);
            }

            this.Unknown2s.Clear();
            for (uint i = 0; i < count2; i++)
            {
                var unknown = new Unknown2Resolver();
                unknown.Deserialize(input);
                this.Unknown2s.Add(unknown);
            }

            this.Unknown3s.Clear();
            if (count3 > 0)
                throw new NotSupportedException();
            //for (uint i = 0; i < count3; i++)
            //{
            //    var a = input.ReadValueU32();
            //    this.Unknown3s.Add(a);
            //}

            this.Unknown4s.Clear();
            for (uint i = 0; i < count4; i++)
            {
                var unknown = new Unknown4Resolver();
                unknown.Deserialize(input);
                this.Unknown4s.Add(unknown);
            }
        }