From 15da06767692bd55dd3402ab9dc3bbcd5a46b376 Mon Sep 17 00:00:00 2001 From: morkt Date: Mon, 30 Mar 2020 17:26:15 +0400 Subject: [PATCH] (EAGLS): detect non-encrypted archives. --- ArcFormats/Eagls/ArcEAGLS.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ArcFormats/Eagls/ArcEAGLS.cs b/ArcFormats/Eagls/ArcEAGLS.cs index 1dcc5723..ee9d0d43 100644 --- a/ArcFormats/Eagls/ArcEAGLS.cs +++ b/ArcFormats/Eagls/ArcEAGLS.cs @@ -107,7 +107,8 @@ namespace GameRes.Formats.Eagls if (dir[0].Name.HasExtension ("gr")) // CG archive { var rng = DetectEncryptionScheme (file, dir[0]); - return new EaglsArchive (file, this, dir, new CgEncryption (rng)); + if (rng != null) + return new EaglsArchive (file, this, dir, new CgEncryption (rng)); } else if (has_scripts) { @@ -155,6 +156,8 @@ namespace GameRes.Formats.Eagls IRandomGenerator DetectEncryptionScheme (ArcView file, Entry first_entry) { int signature = (file.View.ReadInt32 (first_entry.Offset) >> 8) & 0xFFFF; + if (0x4D42 == signature) // 'BM' + return null; byte seed = file.View.ReadByte (first_entry.Offset+first_entry.Size-1); IRandomGenerator[] rng_list = { new LehmerRandomGenerator(),