From 12aa9eade5c0915640c0130192e5d6de929bb864 Mon Sep 17 00:00:00 2001 From: morkt Date: Sat, 19 Dec 2015 06:39:13 +0400 Subject: [PATCH] added another XP3 encryption scheme. --- ArcFormats/KiriKiri/ArcXP3.cs | 28 ++++++++++++++++++++++++++++ supported.html | 1 + 2 files changed, 29 insertions(+) diff --git a/ArcFormats/KiriKiri/ArcXP3.cs b/ArcFormats/KiriKiri/ArcXP3.cs index 85f40a4a..fcc11ff3 100644 --- a/ArcFormats/KiriKiri/ArcXP3.cs +++ b/ArcFormats/KiriKiri/ArcXP3.cs @@ -1173,6 +1173,34 @@ NextEntry: } } + [Serializable] + public class GakuenButouCrypt : ICrypt + { + public override byte Decrypt (Xp3Entry entry, long offset, byte value) + { + if (0 != (offset & 1)) + return (byte)(value ^ offset); + else + return (byte)(value ^ entry.Hash); + } + + public override void Decrypt (Xp3Entry entry, long offset, byte[] values, int pos, int count) + { + for (int i = 0; i < count; ++i, ++offset) + { + if (0 != (offset & 1)) + values[pos+i] ^= (byte)offset; + else + values[pos+i] ^= (byte)entry.Hash; + } + } + + public override void Encrypt (Xp3Entry entry, long offset, byte[] values, int pos, int count) + { + Decrypt (entry, offset, values, pos, count); + } + } + [Serializable] public class AlteredPinkCrypt : ICrypt { diff --git a/supported.html b/supported.html index 3218b2dc..18b6a719 100644 --- a/supported.html +++ b/supported.html @@ -170,6 +170,7 @@ Distance
Fate/stay night
Fate/hollow ataraxia
G-senjou no Maou
+Gakuen Butou no Folklore
Hanafubuki ~Sennen no Koi o Shimashita~
Haruiro ☆ Communication ♪
Hime to Majin to Koi Suru Tamashii