diff --git a/ArcFormats/KiriKiri/CryptAlgorithms.cs b/ArcFormats/KiriKiri/CryptAlgorithms.cs index 50258b3e..6e0061dc 100644 --- a/ArcFormats/KiriKiri/CryptAlgorithms.cs +++ b/ArcFormats/KiriKiri/CryptAlgorithms.cs @@ -666,4 +666,34 @@ namespace GameRes.Formats.KiriKiri Decrypt (entry, offset, values, pos, count); } } + + [Serializable] + public class HibikiCrypt : ICrypt + { + public override byte Decrypt (Xp3Entry entry, long offset, byte value) + { + if (0 != (offset & 4) || offset <= 0x64) + return (byte)(value ^ (entry.Hash >> 5)); + else + return (byte)(value ^ (entry.Hash >> 8)); + } + + public override void Decrypt (Xp3Entry entry, long offset, byte[] buffer, int pos, int count) + { + byte key1 = (byte)(entry.Hash >> 5); + byte key2 = (byte)(entry.Hash >> 8); + for (int i = 0; i < count; ++i, ++offset) + { + if (0 != (offset & 4) || offset <= 0x64) + buffer[pos+i] ^= key1; + else + buffer[pos+i] ^= key2; + } + } + + public override void Encrypt (Xp3Entry entry, long offset, byte[] buffer, int pos, int count) + { + Decrypt (entry, offset, buffer, pos, count); + } + } } diff --git a/supported.html b/supported.html index 3adcd5cb..da404ae5 100644 --- a/supported.html +++ b/supported.html @@ -238,6 +238,7 @@ Imouto Style
Inaho no Mirai
Karakara
Kourin no Machi, Lavender no Shoujo
+LOVELY x CATION
Mayoeru Futari to Sekai no Subete
Mahoutsukai no Yoru
Nakadashi Hara Maid series