feat: support unencrypted LIBP archive

This commit is contained in:
scientificworld
2025-12-31 02:42:48 +08:00
parent db28f8abd6
commit a27a9d8a5c
2 changed files with 8 additions and 1 deletions

View File

@@ -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"))

View File

@@ -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;