From b1554445c56e4a8b6fbf354d07f8b15c0d4de375 Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Sun, 22 May 2016 17:41:52 -0700 Subject: [PATCH] Add check for file length determining if it's a SHA-1 or not --- DATFromDir/DATFromDir.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/DATFromDir/DATFromDir.cs b/DATFromDir/DATFromDir.cs index d8109620..6c4cf797 100644 --- a/DATFromDir/DATFromDir.cs +++ b/DATFromDir/DATFromDir.cs @@ -374,11 +374,18 @@ namespace SabreTools /// Filename of the item to be checked private void ProcessFile(string item) { - // Special case for if we are in Romba mode (all names are SHA-1 hashes) + // Special case for if we are in Romba mode (all names are supposed to be SHA-1 hashes) if (_datdata.Romba) { string datum = Path.GetFileNameWithoutExtension(item); + // Check if the name is the right length + if (datum.Length != 40) + { + _logger.Warning("Non SHA-1 filename found, skipping: '" + datum + "'"); + return; + } + RomData rom = new RomData { Type = "rom",