From 9cf0c88b59f0a77f805489712bc436aca3739bb4 Mon Sep 17 00:00:00 2001 From: morkt Date: Tue, 14 Jun 2016 18:23:27 +0400 Subject: [PATCH] (AppliqueCrypt): fixed block decryption logic. --- ArcFormats/KiriKiri/CryptAlgorithms.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ArcFormats/KiriKiri/CryptAlgorithms.cs b/ArcFormats/KiriKiri/CryptAlgorithms.cs index 973a7227..50258b3e 100644 --- a/ArcFormats/KiriKiri/CryptAlgorithms.cs +++ b/ArcFormats/KiriKiri/CryptAlgorithms.cs @@ -587,7 +587,12 @@ namespace GameRes.Formats.KiriKiri public override void Decrypt (Xp3Entry entry, long offset, byte[] values, int pos, int count) { if (offset < 5) - return; + { + int skip = Math.Min (5 - (int)offset, count); + offset += skip; + pos += skip; + count -= skip; + } byte key = (byte)(entry.Hash >> 12); for (int i = 0; i < count; ++i) {