Update to DIC 20230309

This commit is contained in:
Matt Nadareski
2023-03-09 10:07:06 -05:00
parent c7efda7da8
commit bbe9c94545
3 changed files with 58 additions and 6 deletions

View File

@@ -83,6 +83,7 @@
- Remove unsupported identifiers
- Add identifiers in more places
- Move drive finding inside of the try/catch
- Update to DIC 20230309
### 2.4 (2022-10-26)

View File

@@ -224,6 +224,7 @@ namespace MPF.Modules.DiscImageCreator
- subInfo - Subchannel informational messages
- subIntention - Subchannel intentional error information
- subReadable - Human-readable version of `sub`
- toc - Binary representation of the table of contents
- volDesc - Volume descriptor information
*/
@@ -257,6 +258,8 @@ namespace MPF.Modules.DiscImageCreator
missingFiles.Add($"{basePath}.dat");
if (!File.Exists($"{basePath}.sub") && !File.Exists($"{basePath}.subtmp"))
missingFiles.Add($"{basePath}.sub");
if (!File.Exists($"{basePath}.toc"))
missingFiles.Add($"{basePath}.toc");
if (!File.Exists($"{basePath}_disc.txt"))
missingFiles.Add($"{basePath}_disc.txt");
if (!File.Exists($"{basePath}_drive.txt"))
@@ -430,6 +433,11 @@ namespace MPF.Modules.DiscImageCreator
if (!string.IsNullOrWhiteSpace(cdMultiSessionInfo))
info.CommonDiscInfo.CommentsSpecialFields[SiteCode.Multisession] = cdMultiSessionInfo;
// Attempt to get the universal hash
string universalHash = GetUniversalHash($"{basePath}_disc.txt") ?? "";
info.CommonDiscInfo.CommentsSpecialFields[SiteCode.UniversalHash] = universalHash;
break;
case MediaType.DVD:
@@ -1564,6 +1572,8 @@ namespace MPF.Modules.DiscImageCreator
logFiles.Add($"{basePath}.sub");
if (File.Exists($"{basePath}.subtmp"))
logFiles.Add($"{basePath}.subtmp");
if (File.Exists($"{basePath}.toc"))
logFiles.Add($"{basePath}.toc");
if (File.Exists($"{basePath}_disc.txt"))
logFiles.Add($"{basePath}_disc.txt");
if (File.Exists($"{basePath}_drive.txt"))
@@ -3494,6 +3504,47 @@ namespace MPF.Modules.DiscImageCreator
}
}
/// <summary>
/// Get the universal hash from the input file, if possible
/// </summary>
/// <param name="disc">_disc.txt file location</param>
/// <returns>Universal hash if possible, null on error</returns>
private static string GetUniversalHash(string disc)
{
// If the file doesn't exist, we can't get info from it
if (!File.Exists(disc))
return null;
using (StreamReader sr = File.OpenText(disc))
{
try
{
// Fast forward to the universal hash information
while (!sr.ReadLine().Trim().StartsWith("========== Hash(Universal Whole image) ==========")) ;
// If we find the universal hash line, return the SHA-1 hash only
string line;
while (!sr.EndOfStream)
{
line = sr.ReadLine().TrimStart();
if (line.StartsWith("<rom name"))
{
if (GetISOHashValues(line, out _, out _, out _, out string sha1))
return sha1;
}
}
// We couldn't detect it then
return null;
}
catch
{
// We don't care what the exception is right now
return null;
}
}
}
/// <summary>
/// Get the write offset from the input file, if possible
/// </summary>

View File

@@ -58,12 +58,12 @@ after_build:
#- 7z e dd-0.6beta3.zip -oMPF\bin\Debug\net6.0-windows\osx-x64\publish\Programs\DD *
# DiscImageCreator
- ps: appveyor DownloadFile https://github.com/saramibreak/DiscImageCreator/files/10555765/DiscImageCreator_20230201.zip
- 7z e DiscImageCreator_20230201.zip -oMPF\bin\Debug\net48\publish\Programs\Creator Release_ANSI\*
- 7z e DiscImageCreator_20230201.zip -oMPF\bin\Debug\net6.0-windows\win-x64\publish\Programs\Creator Release_ANSI\*
- 7z e DiscImageCreator_20230201.zip -oMPF\bin\Debug\net6.0-windows\win-x86\publish\Programs\Creator Release_ANSI\*
#- 7z e DiscImageCreator_20230201.zip -oMPF\bin\Debug\net6.0-windows\linux-x64\publish\Programs\Creator Release_ANSI\*
#- 7z e DiscImageCreator_20230201.zip -oMPF\bin\Debug\net6.0-windows\osx-x64\publish\Programs\Creator Release_ANSI\*
- ps: appveyor DownloadFile https://github.com/saramibreak/DiscImageCreator/files/10931241/DiscImageCreator_20230309.zip
- 7z e /DiscImageCreator_20230309.zip -oMPF\bin\Debug\net48\publish\Programs\Creator Release_ANSI\*
- 7z e /DiscImageCreator_20230309.zip -oMPF\bin\Debug\net6.0-windows\win-x64\publish\Programs\Creator Release_ANSI\*
- 7z e /DiscImageCreator_20230309.zip -oMPF\bin\Debug\net6.0-windows\win-x86\publish\Programs\Creator Release_ANSI\*
#- 7z e /DiscImageCreator_20230309.zip -oMPF\bin\Debug\net6.0-windows\linux-x64\publish\Programs\Creator Release_ANSI\*
#- 7z e /DiscImageCreator_20230309.zip -oMPF\bin\Debug\net6.0-windows\osx-x64\publish\Programs\Creator Release_ANSI\*
# Redumper
- ps: appveyor DownloadFile https://github.com/superg/redumper/releases/download/build_106/redumper-2023.02.19_build106-win64.zip