diff --git a/ArcFormats/KiriKiri/CryptAlgorithms.cs b/ArcFormats/KiriKiri/CryptAlgorithms.cs index beb1846e..83ee80bd 100644 --- a/ArcFormats/KiriKiri/CryptAlgorithms.cs +++ b/ArcFormats/KiriKiri/CryptAlgorithms.cs @@ -25,6 +25,7 @@ using System; using System.Collections.Generic; +using System.IO; using System.Linq; using GameRes.Utility; @@ -897,4 +898,60 @@ namespace GameRes.Formats.KiriKiri Decrypt (entry, offset, data, pos, count); } } + + [Serializable] + public class SenrenCxCrypt : CxEncryption + { + public string FileMapName { get; set; } + + public SenrenCxCrypt (CxScheme scheme) : base (scheme) + { + } + + public override void Init (ArcFile arc) + { + if (null == KnownNames) + ReadNames(); + foreach (var entry in arc.Dir) + { + string name; + if (KnownNames.TryGetValue (entry.Name, out name)) + { + entry.Name = name; + entry.Type = FormatCatalog.Instance.GetTypeFromName (name); + } + } + } + + void ReadNames () + { + var dir = FormatCatalog.Instance.DataDirectory; + var names_file = Path.Combine (dir, FileMapName); + var names = new Dictionary(); + try + { + var hash_buf = new char[32]; + using (var reader = new StreamReader (names_file)) + { + while (32 == reader.Read (hash_buf, 0, 32)) + { + if (',' != reader.Read()) + break; + var name = reader.ReadLine(); + if (null == name) + break; + names[new string (hash_buf)] = name; + } + } + } + catch (Exception X) + { + System.Diagnostics.Trace.WriteLine (X.Message, "[SenrenCxCrypt]"); + } + KnownNames = names; + } + + [NonSerialized] + Dictionary KnownNames = null; + } } diff --git a/ArcFormats/Resources/Formats.dat b/ArcFormats/Resources/Formats.dat index be256fd5..e323644a 100644 Binary files a/ArcFormats/Resources/Formats.dat and b/ArcFormats/Resources/Formats.dat differ diff --git a/supported.html b/supported.html index 440997af..9b597fba 100644 --- a/supported.html +++ b/supported.html @@ -301,7 +301,9 @@ Rakugaki Overheart
RGH ~Koi to Hero to Gakuen to~
Riding Incubus
Rui wa Tomo o Yobu
+Sanoba Witch
Seirei Tenshou
+Senren*Banka
Se-kirara
Sharin no Kuni, Himawari no Shoujo
Shokusai no Miyako