(AppliqueCrypt): fixed block decryption logic.

This commit is contained in:
morkt 2016-06-14 18:23:27 +04:00
parent 46b7346c8d
commit 9cf0c88b59

View File

@ -587,7 +587,12 @@ namespace GameRes.Formats.KiriKiri
public override void Decrypt (Xp3Entry entry, long offset, byte[] values, int pos, int count) public override void Decrypt (Xp3Entry entry, long offset, byte[] values, int pos, int count)
{ {
if (offset < 5) if (offset < 5)
return; {
int skip = Math.Min (5 - (int)offset, count);
offset += skip;
pos += skip;
count -= skip;
}
byte key = (byte)(entry.Hash >> 12); byte key = (byte)(entry.Hash >> 12);
for (int i = 0; i < count; ++i) for (int i = 0; i < count; ++i)
{ {