From f0632f7a1ece98e0bab18a52e17b77926602027a Mon Sep 17 00:00:00 2001 From: Michael Becker Date: Thu, 19 Mar 2020 09:56:35 -0400 Subject: [PATCH] handle the case where our PEF begins with PJ95 --- .../Apple/PreferredExecutable/PEFDataFormat.cs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/CSharp/Plugins/UniversalEditor.Plugins.Executable/DataFormats/Executable/Apple/PreferredExecutable/PEFDataFormat.cs b/CSharp/Plugins/UniversalEditor.Plugins.Executable/DataFormats/Executable/Apple/PreferredExecutable/PEFDataFormat.cs index ed87486b..6152aca0 100644 --- a/CSharp/Plugins/UniversalEditor.Plugins.Executable/DataFormats/Executable/Apple/PreferredExecutable/PEFDataFormat.cs +++ b/CSharp/Plugins/UniversalEditor.Plugins.Executable/DataFormats/Executable/Apple/PreferredExecutable/PEFDataFormat.cs @@ -13,7 +13,21 @@ namespace UniversalEditor.DataFormats.Executable.Apple.PreferredExecutable { Internal.PEFContainerHeader item = new Internal.PEFContainerHeader(); item.tag1 = reader.ReadFixedLengthString(4); - if (item.tag1 != "Joy!") throw new InvalidDataFormatException("PEF container header does not have 'Joy!' in 'tag1' field"); + if (item.tag1 != "Joy!") + { + // PJ95 + if (item.tag1 == "PJ95") + { + uint offsetToResourceSegment = reader.ReadUInt32(); + uint zero1 = reader.ReadUInt32(); + uint zero2 = reader.ReadUInt32(); + item.tag1 = reader.ReadFixedLengthString(4); + } + else + { + throw new InvalidDataFormatException("PEF container header does not have 'Joy!' in 'tag1' field"); + } + } item.tag2 = reader.ReadFixedLengthString(4); if (item.tag2 != "peff") throw new InvalidDataFormatException("PEF container header does not have 'peff' in 'tag2' field");