Example #1
0
        public void GenerateHash()
        {
            ShaContext.Initialize();

            PhxHash.UInt16(ShaContext, (ushort)Flags);
            PhxHash.UInt16(ShaContext, kVersion);

            Header.UpdateHash(ShaContext);
        }
Example #2
0
 public void UpdateHash(SHA1CryptoServiceProvider sha)
 {
     PhxHash.UInt16(sha, (uint)Year);
     PhxHash.UInt16(sha, (uint)Month);
     PhxHash.UInt16(sha, (uint)DayOfWeek);
     PhxHash.UInt16(sha, (uint)Day);
     PhxHash.UInt16(sha, (uint)Hour);
     PhxHash.UInt16(sha, (uint)Minute);
     PhxHash.UInt16(sha, (uint)Second);
     PhxHash.UInt16(sha, (uint)Milliseconds);
 }
Example #3
0
 public void UpdateHash(SHA1CryptoServiceProvider sha)
 {
     PhxHash.UInt8(sha, kVersion);
     PhxHash.UInt64(sha, Id);
     PhxHash.Unicode(sha, Name, kNameStorage.FixedLength - 1);
     PhxHash.Unicode(sha, Description, kDescStorage.FixedLength - 1);
     PhxHash.Ascii(sha, Author, kAuthorStorage.FixedLength);
     DateTime.UpdateHash(sha);
     PhxHash.UInt64(sha, AuthorXuid);
     PhxHash.UInt32(sha, Bitwise.ByteSwap.SingleToUInt32(Length));
     PhxHash.UInt16(sha, (uint)SessionId);
     PhxHash.UInt32(sha, (uint)GameType);
     PhxHash.UInt64(sha, DataCryptKey);
     sha.TransformBlock(DataHash, 0, DataHash.Length, null, 0);
     PhxHash.UInt64(sha, DataSize, isFinal: true);
 }