From a63456338dcea922e33b99f467d75f367d230f7e Mon Sep 17 00:00:00 2001 From: morkt Date: Sun, 20 May 2018 08:11:53 +0400 Subject: [PATCH] (EME): tweaked scripts decompression. --- ArcFormats/EmonEngine/ArcEME.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ArcFormats/EmonEngine/ArcEME.cs b/ArcFormats/EmonEngine/ArcEME.cs index 7ac79026..5c4f5ed8 100644 --- a/ArcFormats/EmonEngine/ArcEME.cs +++ b/ArcFormats/EmonEngine/ArcEME.cs @@ -41,6 +41,11 @@ namespace GameRes.Formats.EmonEngine public override bool IsHierarchic { get { return false; } } public override bool CanWrite { get { return false; } } + public EmeOpener () + { + Extensions = new string[] { "eme", "rre" }; + } + public override ArcFile TryOpen (ArcView file) { if (!file.View.AsciiEqual (4, "ATA ")) @@ -106,7 +111,7 @@ namespace GameRes.Formats.EmonEngine return new PrefixStream (header, input); } int unpacked_size = LittleEndian.ToInt32 (header, 4); - if (0 != unpacked_size) + if (0 != unpacked_size && unpacked_size < entry.UnpackedSize) { uint packed_size = LittleEndian.ToUInt32 (header, 0); int part1_size = (int)entry.UnpackedSize - unpacked_size;