From 1c8f64f5e6051484d8d1460fd45af66dbb4e7eb1 Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Tue, 2 Sep 2025 07:52:29 -0400 Subject: [PATCH] Search for MS-CAB in resources and overlay --- SabreTools.Serialization/Wrappers/NewExecutable.cs | 5 +++++ .../Wrappers/PortableExecutable.cs | 10 ++++++++++ 2 files changed, 15 insertions(+) diff --git a/SabreTools.Serialization/Wrappers/NewExecutable.cs b/SabreTools.Serialization/Wrappers/NewExecutable.cs index 38e89499..5400b257 100644 --- a/SabreTools.Serialization/Wrappers/NewExecutable.cs +++ b/SabreTools.Serialization/Wrappers/NewExecutable.cs @@ -449,6 +449,11 @@ namespace SabreTools.Serialization.Wrappers extension = "7z"; break; } + else if (overlaySample.StartsWith(Models.MicrosoftCabinet.Constants.SignatureBytes)) + { + extension = "cab"; + break; + } else if (overlaySample.StartsWith(Models.PKZIP.Constants.LocalFileHeaderSignatureBytes)) { extension = "zip"; diff --git a/SabreTools.Serialization/Wrappers/PortableExecutable.cs b/SabreTools.Serialization/Wrappers/PortableExecutable.cs index 9d990afb..227b35ea 100644 --- a/SabreTools.Serialization/Wrappers/PortableExecutable.cs +++ b/SabreTools.Serialization/Wrappers/PortableExecutable.cs @@ -1194,6 +1194,11 @@ namespace SabreTools.Serialization.Wrappers extension = "7z"; break; } + else if (overlaySample.StartsWith(Models.MicrosoftCabinet.Constants.SignatureBytes)) + { + extension = "cab"; + break; + } else if (overlaySample.StartsWith(Models.PKZIP.Constants.LocalFileHeaderSignatureBytes)) { extension = "zip"; @@ -1295,6 +1300,11 @@ namespace SabreTools.Serialization.Wrappers extension = "7z"; break; } + else if (resourceSample.StartsWith(Models.MicrosoftCabinet.Constants.SignatureBytes)) + { + extension = "cab"; + break; + } else if (resourceSample.StartsWith(Models.PKZIP.Constants.LocalFileHeaderSignatureBytes)) { extension = "zip";