(WARC): another key-based encryption.

This commit is contained in:
morkt
2016-09-18 05:28:54 +04:00
parent e703f6f675
commit bd08be1ffa
2 changed files with 20 additions and 0 deletions

View File

@@ -973,4 +973,21 @@ namespace GameRes.Formats.ShiinaRio
}
}
}
[Serializable]
public class AdlerCrypt : KeyDecryptBase
{
public AdlerCrypt (uint key) : base (key, null)
{
}
protected override void DecryptPre (byte[] data, int index, uint length)
{
uint key = Adler32.Compute (data, index, 0x100);
data[index + 0x204] ^= (byte)key;
data[index + 0x205] ^= (byte)(key >> 8);
data[index + 0x206] ^= (byte)(key >> 16);
data[index + 0x207] ^= (byte)(key >> 24);
}
}
}