Esempio n. 1
0
        private uint CalculateEncryptionSeed()
        {
            if (this.Filename == null)
            {
                return(0);
            }
            uint num = MpqArchive.HashString(Path.GetFileName(this.Filename), 0x300);

            if ((this.Flags & MpqFileFlags.BlockOffsetAdjustedKey) == MpqFileFlags.BlockOffsetAdjustedKey)
            {
                num = (num + this._fileOffset) ^ this.FileSize;
            }
            return(num);
        }
Esempio n. 2
0
        private uint CalculateEncryptionSeed()
        {
            if (Filename == null)
            {
                return(0);
            }

            uint seed = MpqArchive.HashString(Path.GetFileName(Filename), 0x300);

            if ((Flags & MpqFileFlags.BlockOffsetAdjustedKey) == MpqFileFlags.BlockOffsetAdjustedKey)
            {
                seed = (seed + _fileOffset) ^ FileSize;
            }
            return(seed);
        }