From 8bdde818c937e44157505606c51183e09aea0b10 Mon Sep 17 00:00:00 2001 From: morkt Date: Mon, 30 Nov 2015 03:55:17 +0400 Subject: [PATCH] (KiriKiri): implemented Natsupochi encryption. --- ArcFormats/KiriKiri/ArcXP3.cs | 23 +++++++++++++++++++++++ supported.html | 2 ++ 2 files changed, 25 insertions(+) diff --git a/ArcFormats/KiriKiri/ArcXP3.cs b/ArcFormats/KiriKiri/ArcXP3.cs index 2a8615ae..642cceb4 100644 --- a/ArcFormats/KiriKiri/ArcXP3.cs +++ b/ArcFormats/KiriKiri/ArcXP3.cs @@ -1171,4 +1171,27 @@ NextEntry: Decrypt (entry, offset, values, pos, count); } } + + [Serializable] + public class NatsupochiCrypt : ICrypt + { + public override byte Decrypt (Xp3Entry entry, long offset, byte value) + { + return (byte)(value ^ (entry.Hash >> 3)); + } + + public override void Decrypt (Xp3Entry entry, long offset, byte[] values, int pos, int count) + { + byte key = (byte)(entry.Hash >> 3); + for (int i = 0; i < count; ++i) + { + values[pos+i] ^= key; + } + } + + public override void Encrypt (Xp3Entry entry, long offset, byte[] values, int pos, int count) + { + Decrypt (entry, offset, values, pos, count); + } + } } diff --git a/supported.html b/supported.html index 6492b8d0..7927b699 100644 --- a/supported.html +++ b/supported.html @@ -170,6 +170,8 @@ Hanafubuki ~Sennen no Koi o Shimashita~
Haruiro ☆ Communication ♪
Hime to Majin to Koi Suru Tamashii
Imouto Style
+Natsupochi
+Nidaime wa ☆ Mahou Shoujo
Nuki Doki!
Okiba ga Nai!
Ore no Saimin Fantasia