From d520c98d84fe6c6091c3b5070e9042302e3e0f6b Mon Sep 17 00:00:00 2001 From: morkt Date: Wed, 7 Feb 2018 03:41:14 +0400 Subject: [PATCH] (SenrenCxCrypt): override ReadName instead of Init. --- ArcFormats/KiriKiri/CryptAlgorithms.cs | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/ArcFormats/KiriKiri/CryptAlgorithms.cs b/ArcFormats/KiriKiri/CryptAlgorithms.cs index 5305ac83..d6f4fc2a 100644 --- a/ArcFormats/KiriKiri/CryptAlgorithms.cs +++ b/ArcFormats/KiriKiri/CryptAlgorithms.cs @@ -1023,26 +1023,24 @@ namespace GameRes.Formats.KiriKiri { } - public override void Init (ArcFile arc) + public override string ReadName (BinaryReader header) { 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); - } - } + var hash = base.ReadName (header); + string name; + if (null == hash || !KnownNames.TryGetValue (hash, out name)) + return hash; + if (string.IsNullOrEmpty (name)) + return null; + return name; } void ReadNames () { var dir = FormatCatalog.Instance.DataDirectory; var names_file = Path.Combine (dir, FileMapName); - var names = new Dictionary(); + var names = new Dictionary { { "$", "startup.tjs" } }; try { var hash_buf = new char[32];