Skip to content

Commit

Permalink
Perform hashing in one read pass
Browse files Browse the repository at this point in the history
  • Loading branch information
Deterous committed Feb 20, 2024
1 parent c7b49d0 commit 9d03dbb
Show file tree
Hide file tree
Showing 5 changed files with 196 additions and 197 deletions.
2 changes: 1 addition & 1 deletion IRDKit/IRDKit.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<RuntimeIdentifiers>win-x86;win-x64;win-arm64;linux-x64;linux-arm64;osx-x64;osx-arm64</RuntimeIdentifiers>
<LangVersion>latest</LangVersion>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<Version>0.5.0</Version>
<Version>0.6.0</Version>

<!-- Package Properties -->
<Authors>Deterous</Authors>
Expand Down
42 changes: 6 additions & 36 deletions IRDKit/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -704,16 +704,11 @@ public static string ISO2IRD(string isoPath, string irdPath = null, string hexKe
return irdPath;
}
}
catch (ArgumentException e)
catch (Exception e)
{
Console.Error.WriteLine(e.Message + ", failed to create IRD");
return null;
}
catch (FileNotFoundException)
{
Console.Error.WriteLine("File not found, failed to create IRD");
return null;
}
}

// Create new reproducible redump-style IRD with a given key file
Expand All @@ -740,16 +735,11 @@ public static string ISO2IRD(string isoPath, string irdPath = null, string hexKe
return irdPath;
}
}
catch (ArgumentException e)
catch (Exception e)
{
Console.Error.WriteLine(e.Message + ", failed to create IRD");
return null;
}
catch (FileNotFoundException)
{
Console.Error.WriteLine("File not found, failed to create IRD");
return null;
}
}

// Create new reproducible redump-style IRD with a given GetKey log
Expand All @@ -764,16 +754,11 @@ public static string ISO2IRD(string isoPath, string irdPath = null, string hexKe
ird1.Print();
return irdPath;
}
catch (ArgumentException e)
catch (Exception e)
{
Console.Error.WriteLine(e.Message + ", failed to create IRD");
return null;
}
catch (FileNotFoundException)
{
Console.Error.WriteLine("File not found, failed to create IRD");
return null;
}
}

// No key provided, try search for .key file
Expand All @@ -798,16 +783,11 @@ public static string ISO2IRD(string isoPath, string irdPath = null, string hexKe
return irdPath;
}
}
catch (ArgumentException e)
catch (Exception e)
{
Console.Error.WriteLine(e.Message + ", failed to create IRD");
return null;
}
catch (FileNotFoundException)
{
Console.Error.WriteLine("File not found, failed to create IRD");
return null;
}
}

// No key provided, try search for .getkey.log file
Expand All @@ -825,16 +805,11 @@ public static string ISO2IRD(string isoPath, string irdPath = null, string hexKe
ird1.Print();
return irdPath;
}
catch (ArgumentException e)
catch (Exception e)
{
Console.Error.WriteLine(e.Message + ", failed to create IRD");
return null;
}
catch (FileNotFoundException)
{
Console.Error.WriteLine("File not found, failed to create IRD");
return null;
}
}

// No key provided, try get key from redump.org
Expand Down Expand Up @@ -913,16 +888,11 @@ public static string ISO2IRD(string isoPath, string irdPath = null, string hexKe
ird.Print();
return irdPath;
}
catch (ArgumentException e)
catch (Exception e)
{
Console.Error.WriteLine(e.Message + ", failed to create IRD");
return null;
}
catch (FileNotFoundException)
{
Console.Error.WriteLine("File not found, failed to create IRD");
return null;
}
}

#endregion
Expand Down
Loading

0 comments on commit 9d03dbb

Please sign in to comment.