From e28911389c4ceeadffba55190be00f21b9974029 Mon Sep 17 00:00:00 2001 From: Killerswin2 Date: Thu, 31 Jul 2025 21:01:53 -0500 Subject: [PATCH] added: Kano2Crypt for Kiss Kano2 game --- ArcFormats/KiriKiri/CryptAlgorithms.cs | 29 ++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/ArcFormats/KiriKiri/CryptAlgorithms.cs b/ArcFormats/KiriKiri/CryptAlgorithms.cs index bf76894c..4d58c658 100644 --- a/ArcFormats/KiriKiri/CryptAlgorithms.cs +++ b/ArcFormats/KiriKiri/CryptAlgorithms.cs @@ -1594,4 +1594,33 @@ namespace GameRes.Formats.KiriKiri } } } + [Serializable] + public class Kano2Crypt : ICrypt + { + public override void Decrypt(Xp3Entry entry, long offset, byte[] buffer, int pos, int count) + { + try + { + // only apply xor every 8 bytes + for (int i = 0; i < count; ++i) + { + if ((offset + i) % 8 == 0) + { + buffer[offset + i] ^= (byte)entry.Hash; + i += 7; + } + } + } + catch (Exception e) + { + System.Console.WriteLine(e.Message); + } + + } + + public override void Encrypt(Xp3Entry entry, long offset, byte[] buffer, int pos, int count) + { + Decrypt(entry, offset, buffer, pos, count); + } + } }