From a27a9d8a5cc85dcd2dc7ee586eb9304046870d68 Mon Sep 17 00:00:00 2001 From: scientificworld Date: Wed, 31 Dec 2025 02:42:48 +0800 Subject: [PATCH] feat: support unencrypted LIBP archive --- ArcFormats/Malie/ArcLIB.cs | 2 +- ArcFormats/Malie/MalieEncryption.cs | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ArcFormats/Malie/ArcLIB.cs b/ArcFormats/Malie/ArcLIB.cs index 38e4f672..2ec9d039 100644 --- a/ArcFormats/Malie/ArcLIB.cs +++ b/ArcFormats/Malie/ArcLIB.cs @@ -150,7 +150,7 @@ namespace GameRes.Formats.Malie var header = new byte[0x10]; foreach (var scheme in KnownSchemes.Values) { - var decryptor = scheme.CreateDecryptor(); + var decryptor = file.View.AsciiEqual (0, "LIB") ? new NoOpDecryptor() : scheme.CreateDecryptor(); ReadEncrypted (file.View, decryptor, 0, header, 0, 0x10); ILibIndexReader reader; if (Binary.AsciiEqual (header, 0, "LIBP")) diff --git a/ArcFormats/Malie/MalieEncryption.cs b/ArcFormats/Malie/MalieEncryption.cs index 9e8edd55..af26c471 100644 --- a/ArcFormats/Malie/MalieEncryption.cs +++ b/ArcFormats/Malie/MalieEncryption.cs @@ -35,6 +35,13 @@ namespace GameRes.Formats.Malie void DecryptBlock (long block_offset, byte[] buffer, int index); } + public class NoOpDecryptor : IMalieDecryptor + { + public void DecryptBlock (long block_offset, byte[] buffer, int index) + { + } + } + public class CamelliaDecryptor : IMalieDecryptor { Camellia m_enc;