diff --git a/ArcFormats/KiriKiri/ArcXP3.cs b/ArcFormats/KiriKiri/ArcXP3.cs index 36cca0bd..1f5874a9 100644 --- a/ArcFormats/KiriKiri/ArcXP3.cs +++ b/ArcFormats/KiriKiri/ArcXP3.cs @@ -198,7 +198,7 @@ namespace GameRes.Formats.KiriKiri entry.IsEncrypted = entry.Cipher != NoCryptAlgorithm; var name = new string (header.ReadChars (name_size)); - if (entry.Cipher is ZecchouCrypt && ObfuscatedPathRe.IsMatch (name)) + if (entry.Cipher.ObfuscatedIndex && ObfuscatedPathRe.IsMatch (name)) { goto NextEntry; } @@ -245,7 +245,7 @@ namespace GameRes.Formats.KiriKiri } if (!string.IsNullOrEmpty (entry.Name) && entry.Segments.Any()) { - if (entry.Cipher is ZecchouCrypt) + if (entry.Cipher.ObfuscatedIndex) { DeobfuscateEntry (entry); } @@ -764,6 +764,13 @@ NextEntry: /// public virtual bool HashAfterCrypt { get { return false; } } + /// + /// whether XP3 index is obfuscated: + /// - duplicate entries + /// - entries have additional dummy segments + /// + public virtual bool ObfuscatedIndex { get { return false; } } + public virtual byte Decrypt (Xp3Entry entry, long offset, byte value) { byte[] buffer = new byte[1] { value }; diff --git a/ArcFormats/KiriKiri/KiriKiriCx.cs b/ArcFormats/KiriKiri/KiriKiriCx.cs index 01a33002..aae78e44 100644 --- a/ArcFormats/KiriKiri/KiriKiriCx.cs +++ b/ArcFormats/KiriKiri/KiriKiriCx.cs @@ -520,6 +520,8 @@ namespace GameRes.Formats.KiriKiri public ZecchouCrypt (CxScheme scheme) : base (scheme) { } + + public override bool ObfuscatedIndex { get { return true; } } } /* CxEncryption base branch order