From 19e696bf15d18d44f7af040e21124759add38918 Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Mon, 29 Sep 2025 08:33:33 -0400 Subject: [PATCH] Use an assumption to help trim for now --- BinaryObjectScanner/Protection/SecuROM.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/BinaryObjectScanner/Protection/SecuROM.cs b/BinaryObjectScanner/Protection/SecuROM.cs index ec609ea3..3ab3d337 100644 --- a/BinaryObjectScanner/Protection/SecuROM.cs +++ b/BinaryObjectScanner/Protection/SecuROM.cs @@ -2,11 +2,11 @@ using System; using System.Collections.Generic; using System.Text; using BinaryObjectScanner.Interfaces; -using SabreTools.Data.Models.PKZIP; using SabreTools.IO; using SabreTools.IO.Extensions; using SabreTools.IO.Matching; using SabreTools.Serialization.Wrappers; +using static SabreTools.Data.Models.SecuROM.Constants; namespace BinaryObjectScanner.Protection { @@ -267,7 +267,7 @@ namespace BinaryObjectScanner.Protection { int temp = index; byte[] overlaySample = overlayData.ReadBytes(ref temp, 0x04); - if (overlaySample.EqualsExactly(SabreTools.Data.Models.SecuROM.Constants.AddDMagicBytes)) + if (overlaySample.EqualsExactly(AddDMagicBytes)) { found = true; break; @@ -284,8 +284,12 @@ namespace BinaryObjectScanner.Protection if (addD == null) return null; + // All samples have had 3 entries -- Revisit if needed + if (addD.EntryCount != 3) + return null; + // Format the version - string version = $"{addD.Version}.{addD.Build}"; + string version = $"{addD.Version}.{addD.Build}"; if (!char.IsNumber(version[0])) return "(very old, v3 or less)";