Skip to content

Commit 7c401ed

Browse files
Initial round of fixes
1 parent 57ba906 commit 7c401ed

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-7
lines changed

BinaryObjectScanner/FileType/ISO9660.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ public static bool NoteworthyApplicationUse(PrimaryVolumeDescriptor pvd)
107107
// character. If these are found to be causing issues they can be added.
108108
}
109109

110+
// Seems to come from "FERGUS_MCNEILL - ISOCD 1.00 by Pantaray, Inc. USA -"
110111
offset = 1;
111112
potentialAppUseString = applicationUse.ReadNullTerminatedAnsiString(ref offset);
112113
if (potentialAppUseString == "FS")

BinaryObjectScanner/Protection/AlphaROM.cs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,20 +80,25 @@ public class AlphaROM : IDiskImageCheck<ISO9660>, IExecutableCheck<PortableExecu
8080
// to only consist of capital letters and numbers, a basic byte value check can be performed to ensure
8181
// at least 5 bytes are numbers and 5 bytes are letters. Unfortunately, there doesn't seem to be quite
8282
// enough of a pattern to have a better check than this, but it works well enough.
83-
if (applicationIdentifierString.Length == 18
83+
if (applicationIdentifierString.Length == 18
8484
&& Array.FindAll(applicationIdentifierStringBytes, b => b < 60).Length >= 5
8585
&& Array.FindAll(applicationIdentifierStringBytes, b => b > 60).Length >= 5)
86+
{
8687
return "AlphaROM";
88+
}
8789

8890
// Type #2: Usually 20 characters long, but Redump ID 124334 is 18 characters long. Validate that it
8991
// starts with YYYYMMDD, followed by 6-8 more numbers, followed by letters.
9092
if (applicationIdentifierString.Length >= 18 && applicationIdentifierString.Length <= 20)
9193
{
9294
if (Int32.TryParse(applicationIdentifierString.Substring(0, 4), out int year) == false
93-
|| Int32.TryParse(applicationIdentifierString.Substring(4, 2), out int month) == false
94-
|| Int32.TryParse(applicationIdentifierString.Substring(6, 2), out int day) == false
95-
|| Int32.TryParse(applicationIdentifierString.Substring(8, 6), out int extraTime) == false)
95+
|| Int32.TryParse(applicationIdentifierString.Substring(4, 2), out int month) == false
96+
|| Int32.TryParse(applicationIdentifierString.Substring(6, 2), out int day) == false
97+
|| Int32.TryParse(applicationIdentifierString.Substring(8, 6), out int extraTime) == false)
98+
{
9699
return null;
100+
}
101+
97102
if (year >= 2009 || year < 2000 || month > 12 || day > 31)
98103
return null;
99104

BinaryObjectScanner/Protection/Tages.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,12 @@ public class TAGES : IDiskImageCheck<ISO9660>, IExecutableCheck<PortableExecutab
4343
// Early tages has a 4-byte value at the beginning of the AU data and nothing else.
4444
// Redump ID 8776, 21321, 35932
4545
offset = 0;
46-
var earlyTagesBytes = applicationUse.ReadBytes(ref offset, 4);
46+
var earlyTagesBytes = applicationUse.ReadUInt32LittleEndian(ref offset);
4747
var zeroBytes = applicationUse.ReadBytes(ref offset, 508);
48-
48+
4949
// Check on earlyTagesBytes needed because Redump ID 56899 begins with "FUN" and is then all 0x00.
5050
// 0x70 value is probably just by chance of where early TAGES checks, but it seems to be consistent.
51-
if (Array.TrueForAll(zeroBytes, b => b == 0x00) && !Array.TrueForAll(earlyTagesBytes, b => b == 0x00) && earlyTagesBytes[3] == 0x70)
51+
if (Array.TrueForAll(zeroBytes, b => b == 0x00) && (earlyTagesBytes & 0x70000000) == 0x70000000)
5252
return "TAGES (Early)";
5353

5454
// The original releases of Moto Racer 3 (31578, 34669) are so early they have seemingly nothing identifiable.

0 commit comments

Comments
 (0)