(XP3): adjusted reading filenames from archive index.

some modified Kirikiri builds don't store filenames within archives at
all, only filename hashes.
This commit is contained in:
morkt
2017-06-27 14:42:27 +04:00
parent 37a038b090
commit 5bd63c01cb
2 changed files with 109 additions and 6 deletions

View File

@@ -184,17 +184,16 @@ namespace GameRes.Formats.KiriKiri
entry.Size = (uint)packed_size;
entry.UnpackedSize = (uint)file_size;
int name_size = header.ReadInt16();
if (name_size > 0x100 || name_size <= 0)
{
goto NextEntry;
}
if (entry.IsEncrypted || ForceEncryptionQuery)
entry.Cipher = crypt_algorithm.Value;
else
entry.Cipher = NoCryptAlgorithm;
var name = new string (header.ReadChars (name_size));
var name = entry.Cipher.ReadName (header);
if (null == name)
{
goto NextEntry;
}
if (entry.Cipher.ObfuscatedIndex && ObfuscatedPathRe.IsMatch (name))
{
goto NextEntry;