mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Add check for file length determining if it's a SHA-1 or not
This commit is contained in:
@@ -374,11 +374,18 @@ namespace SabreTools
|
|||||||
/// <param name="item">Filename of the item to be checked</param>
|
/// <param name="item">Filename of the item to be checked</param>
|
||||||
private void ProcessFile(string item)
|
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)
|
if (_datdata.Romba)
|
||||||
{
|
{
|
||||||
string datum = Path.GetFileNameWithoutExtension(item);
|
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
|
RomData rom = new RomData
|
||||||
{
|
{
|
||||||
Type = "rom",
|
Type = "rom",
|
||||||
|
|||||||
Reference in New Issue
Block a user