From 11924fff56dc624ddc85fa88ebe03ba326ed35d6 Mon Sep 17 00:00:00 2001 From: TheRogueArchivist <24215969+TheRogueArchivist@users.noreply.github.com> Date: Mon, 17 Jun 2024 00:23:03 -0600 Subject: [PATCH] Detect Installshield compiled scripts as text files --- .../Wrappers/WrapperFactory.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/SabreTools.Serialization/Wrappers/WrapperFactory.cs b/SabreTools.Serialization/Wrappers/WrapperFactory.cs index 6f4ed2f..d6c2150 100644 --- a/SabreTools.Serialization/Wrappers/WrapperFactory.cs +++ b/SabreTools.Serialization/Wrappers/WrapperFactory.cs @@ -639,6 +639,21 @@ public static WrapperType GetFileType(byte[]? magic, string? extension) if (magic.StartsWith(new byte?[] { 0x61, 0x4C, 0x75, 0x5A })) return WrapperType.Textfile; + // InstallShield Compiled Installation Script (1993) + // http://justsolve.archiveteam.org/wiki/InstallShield_INS + if (magic.StartsWith(new byte?[] { 0xff, 0xff, 0x0c, 0x00, null, 0x00, 0x34, 0x12 })) + return WrapperType.Textfile; + + // InstallShield Compiled Installation Script (1995) + // http://justsolve.archiveteam.org/wiki/InstallShield_INS + if (magic.StartsWith(new byte?[] { 0xb8, 0xc9, 0x0c, 0x00, null, 0x00, 0x34, 0x12 })) + return WrapperType.Textfile; + + // InstallShield Compiled Installation Script (1997) + // http://justsolve.archiveteam.org/wiki/InstallShield_INS + if (magic.StartsWith(new byte?[] { 0xb8, 0xc9, 0x0c, 0x00, null, 0x00, 0x01, 0x00 })) + return WrapperType.Textfile; + // Microsoft Office File (old) if (magic.StartsWith(new byte?[] { 0xd0, 0xcf, 0x11, 0xe0, 0xa1, 0xb1, 0x1a, 0xe1 })) return WrapperType.Textfile;