コード例 #1
0
ファイル: RootBlock.cs プロジェクト: tbcmangos/TactAdder
        public void Read(BinaryReader br)
        {
            int count = br.ReadInt32();

            ContentFlags = (ContentFlags)br.ReadUInt32();
            LocaleFlags  = (LocaleFlags)br.ReadUInt32();

            // load the deltas, set the block's record capacity
            var fileIdDeltas = br.ReadStructArray <uint>(count);

            Records = new Dictionary <uint, RootRecord>(fileIdDeltas.Length);

            // calculate the records
            uint       currentId = 0;
            RootRecord record;

            foreach (uint delta in fileIdDeltas)
            {
                record = new RootRecord
                {
                    FileIdDelta = delta,
                    CKey        = new MD5Hash(br.ReadBytes(16)),
                    NameHash    = br.ReadUInt64()
                };

                currentId    += delta;
                record.FileId = currentId++;

                Records[record.FileId] = record;
            }
        }
コード例 #2
0
        public void am(RootRecord A_0, UnknownB0 A_1)
        {
            UnknownA8 a   = A_1.a(VLTOtherValue.TABLE_END) as UnknownA8;
            int       num = a.genht1[A_0.position].i2;

            A_1.ms1.Seek(num, SeekOrigin.Begin);
            BinaryReader a_ = new BinaryReader(A_1.ms1);

            this.genht1 = new Dictionary <uint, aclzz>(A_0.i3);
            for (int i = 0; i < A_0.i3; ++i)
            {
                UnknownDE.aclzz a2 = new UnknownDE.aclzz();
                a2.s1  = UnknownAP.a(a_);
                a2.i1  = A_0.ia1[i];
                a2.ui1 = JenkinsHash.getHash32(a2.s1);
                this.genht1.Add(a2.ui1, a2);
                HashTracker.addHashFromVLTDB(a2.s1);
            }
            this.genht2 = new Dictionary <uint, VLTClass>();
        }
コード例 #3
0
        public void Read(BinaryReader br)
        {
            int count = br.ReadInt32();

            ContentFlags = (ContentFlags)br.ReadUInt32();
            LocaleFlags  = (LocaleFlags)br.ReadUInt32();

            // load the deltas, set the block's record capacity
            var fileIdDeltas = br.ReadStructArray <uint>(count);

            Records = new Dictionary <uint, RootRecord>(fileIdDeltas.Length);

            // Content Hashes and Name hashes are now split as they are controlled
            // by the content flags
            Span <byte>  ckeyData   = br.ReadBytes(count * 16);
            Span <ulong> namehashes = ReadNameHashes(br, count);

            // calculate the records
            uint       currentId = 0;
            RootRecord record;

            for (int i = 0; i < fileIdDeltas.Length; i++)
            {
                record = new RootRecord
                {
                    FileIdDelta = fileIdDeltas[i],
                    CKey        = new MD5Hash(ckeyData.Slice(i * 16, 16).ToArray()),
                    NameHash    = namehashes[i]
                };

                currentId    += fileIdDeltas[i];
                record.FileId = currentId++;

                Records[record.FileId] = record;
            }
        }