Call psxt001z direct from DIC processor

This commit is contained in:
Matt Nadareski
2024-05-28 00:29:56 -04:00
parent 63e6ce121a
commit bdb367c2c9
5 changed files with 29 additions and 41 deletions

View File

@@ -121,6 +121,7 @@
- Create ProcessingTool and move some methods
- Remove unused byte array helper methods
- Move GetSupportStatus to DumpEnvironment
- Call psxt001z direct from DIC processor
### 3.1.9a (2024-05-21)

View File

@@ -49,7 +49,6 @@
</PackageReference>
<PackageReference Include="LibIRD" Version="0.9.1" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="psxt001z.Library" Version="0.21.0-rc1" />
<PackageReference Include="SabreTools.RedumpLib" Version="1.3.8" />
</ItemGroup>

View File

@@ -5,7 +5,6 @@ using System.Linq;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using BinaryObjectScanner;
using psxt001z;
#pragma warning disable SYSLIB1045 // Convert to 'GeneratedRegexAttribute'.
@@ -171,20 +170,6 @@ namespace MPF.Core.Utilities
#endif
}
/// <summary>
/// Get if LibCrypt data is detected in the subchannel file, if possible
/// </summary>
/// <param name="sub">.sub file location</param>
/// <returns>Status of the LibCrypt data, if possible</returns>
public static bool? GetLibCryptDetected(string sub)
{
// If the file doesn't exist, we can't get info from it
if (!File.Exists(sub))
return null;
return LibCrypt.DetectLibCrypt([sub]);
}
/// <summary>
/// Sanitize unnecessary protection duplication from output
/// </summary>

View File

@@ -5,6 +5,7 @@ using System.Linq;
using System.Text.RegularExpressions;
using MPF.Core;
using MPF.Core.Utilities;
using psxt001z;
using SabreTools.Models.Logiqx;
using SabreTools.RedumpLib;
using SabreTools.RedumpLib.Data;
@@ -1305,39 +1306,40 @@ namespace MPF.Processors
/// <returns>Status of the LibCrypt data, if possible</returns>
private static void GetLibCryptDetected(string basePath, out YesNo detected, out string? data)
{
bool? psLibCryptStatus = ProtectionTool.GetLibCryptDetected(basePath + ".sub");
if (psLibCryptStatus == true)
string subPath = basePath + ".sub";
if (!File.Exists(subPath))
{
// Guard against false positives
if (File.Exists(basePath + "_subIntention.txt"))
{
string libCryptData = ProcessingTool.GetFullFile(basePath + "_subIntention.txt") ?? "";
if (string.IsNullOrEmpty(libCryptData))
{
detected = YesNo.No;
data = null;
}
else
{
detected = YesNo.Yes;
data = libCryptData;
}
}
else
detected = YesNo.NULL;
data = "LibCrypt could not be detected because subchannel file is missing";
return;
}
if (!LibCrypt.DetectLibCrypt([subPath]))
{
detected = YesNo.No;
data = null;
return;
}
// Guard against false positives
if (File.Exists(basePath + "_subIntention.txt"))
{
string libCryptData = ProcessingTool.GetFullFile(basePath + "_subIntention.txt") ?? "";
if (string.IsNullOrEmpty(libCryptData))
{
detected = YesNo.No;
data = null;
}
}
else if (psLibCryptStatus == false)
{
detected = YesNo.No;
data = null;
else
{
detected = YesNo.Yes;
data = libCryptData;
}
}
else
{
detected = YesNo.NULL;
data = "LibCrypt could not be detected because subchannel file is missing";
detected = YesNo.No;
data = null;
}
}

View File

@@ -43,6 +43,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="psxt001z.Library" Version="0.21.0-rc1" />
<PackageReference Include="SabreTools.Hashing" Version="1.2.0" />
<PackageReference Include="SabreTools.Models" Version="1.4.8" />
<PackageReference Include="SabreTools.RedumpLib" Version="1.3.8" />