Skip to content

Commit 19e696b

Browse files
committed
Use an assumption to help trim for now
1 parent ddf8c39 commit 19e696b

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

BinaryObjectScanner/Protection/SecuROM.cs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
using System.Collections.Generic;
33
using System.Text;
44
using BinaryObjectScanner.Interfaces;
5-
using SabreTools.Data.Models.PKZIP;
65
using SabreTools.IO;
76
using SabreTools.IO.Extensions;
87
using SabreTools.IO.Matching;
98
using SabreTools.Serialization.Wrappers;
9+
using static SabreTools.Data.Models.SecuROM.Constants;
1010

1111
namespace BinaryObjectScanner.Protection
1212
{
@@ -267,7 +267,7 @@ public List<string> CheckDirectoryPath(string path, List<string>? files)
267267
{
268268
int temp = index;
269269
byte[] overlaySample = overlayData.ReadBytes(ref temp, 0x04);
270-
if (overlaySample.EqualsExactly(SabreTools.Data.Models.SecuROM.Constants.AddDMagicBytes))
270+
if (overlaySample.EqualsExactly(AddDMagicBytes))
271271
{
272272
found = true;
273273
break;
@@ -284,8 +284,12 @@ public List<string> CheckDirectoryPath(string path, List<string>? files)
284284
if (addD == null)
285285
return null;
286286

287+
// All samples have had 3 entries -- Revisit if needed
288+
if (addD.EntryCount != 3)
289+
return null;
290+
287291
// Format the version
288-
string version = $"{addD.Version}.{addD.Build}";
292+
string version = $"{addD.Version}.{addD.Build}";
289293
if (!char.IsNumber(version[0]))
290294
return "(very old, v3 or less)";
291295

0 commit comments

Comments
 (0)