mirror of
https://github.com/SabreTools/NDecrypt.git
synced 2026-09-21 22:35:03 +00:00
Support back to .NET Framework 2.0
This commit is contained in:
@@ -107,7 +107,7 @@ namespace NDecrypt.Core
|
||||
// Ignore comments in the file
|
||||
if (reader.RowType == IniRowType.Comment)
|
||||
continue;
|
||||
if (reader.KeyValuePair == null || string.IsNullOrWhiteSpace(reader.KeyValuePair?.Key))
|
||||
if (reader.KeyValuePair == null || string.IsNullOrEmpty(reader.KeyValuePair?.Key))
|
||||
break;
|
||||
|
||||
var kvp = reader.KeyValuePair!.Value;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<!-- Assembly Properties -->
|
||||
<TargetFrameworks>net40;net452;net462;net472;net48;netcoreapp3.1;net5.0;net6.0;net7.0;net8.0;net9.0</TargetFrameworks>
|
||||
<TargetFrameworks>net20;net35;net40;net452;net462;net472;net48;netcoreapp3.1;net5.0;net6.0;net7.0;net8.0;net9.0</TargetFrameworks>
|
||||
<CheckEolTargetFramework>false</CheckEolTargetFramework>
|
||||
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
|
||||
<LangVersion>latest</LangVersion>
|
||||
|
||||
@@ -68,7 +68,11 @@ namespace NDecrypt.Core
|
||||
NormalKey2C = RotateLeft(NormalKey2C, 87);
|
||||
|
||||
// Special case for zero-key
|
||||
#if NET20 || NET35
|
||||
if ((masks & BitMasks.FixedCryptoKey) > 0)
|
||||
#else
|
||||
if (masks.HasFlag(BitMasks.FixedCryptoKey))
|
||||
#endif
|
||||
{
|
||||
Console.WriteLine("Encryption Method: Zero Key");
|
||||
NormalKey = new byte[16];
|
||||
@@ -113,7 +117,11 @@ namespace NDecrypt.Core
|
||||
public void SetRomFSValues(BitMasks masks)
|
||||
{
|
||||
// NormalKey has a constant value for zero-key
|
||||
#if NET20 || NET35
|
||||
if ((masks & BitMasks.FixedCryptoKey) > 0)
|
||||
#else
|
||||
if (masks.HasFlag(BitMasks.FixedCryptoKey))
|
||||
#endif
|
||||
{
|
||||
NormalKey = new byte[16];
|
||||
return;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<!-- Assembly Properties -->
|
||||
<TargetFrameworks>net40;net452;net462;net472;net48;netcoreapp3.1;net5.0;net6.0;net7.0;net8.0;net9.0</TargetFrameworks>
|
||||
<TargetFrameworks>net20;net35;net40;net452;net462;net472;net48;netcoreapp3.1;net5.0;net6.0;net7.0;net8.0;net9.0</TargetFrameworks>
|
||||
<OutputType>Exe</OutputType>
|
||||
<CheckEolTargetFramework>false</CheckEolTargetFramework>
|
||||
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
|
||||
|
||||
@@ -67,7 +67,7 @@ namespace NDecrypt
|
||||
|
||||
start++;
|
||||
string tempPath = args[start];
|
||||
if (string.IsNullOrWhiteSpace(tempPath))
|
||||
if (string.IsNullOrEmpty(tempPath))
|
||||
Console.WriteLine($"Invalid keyfile path: null or empty path found!");
|
||||
|
||||
tempPath = Path.GetFullPath(tempPath);
|
||||
@@ -107,7 +107,7 @@ namespace NDecrypt
|
||||
}
|
||||
else if (Directory.Exists(args[i]))
|
||||
{
|
||||
foreach (string file in Directory.EnumerateFiles(args[i], "*", SearchOption.AllDirectories))
|
||||
foreach (string file in Directory.GetFiles(args[i], "*", SearchOption.AllDirectories))
|
||||
{
|
||||
ProcessPath(file, encrypt, force, outputHashes);
|
||||
}
|
||||
@@ -158,7 +158,7 @@ namespace NDecrypt
|
||||
/// <param name="err">Additional error text to display, can be null to ignore</param>
|
||||
private static void DisplayHelp(string? err = null)
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(err))
|
||||
if (!string.IsNullOrEmpty(err))
|
||||
Console.WriteLine($"Error: {err}");
|
||||
|
||||
Console.WriteLine(@"Usage: NDecrypt <operation> [flags] <path> ...
|
||||
|
||||
@@ -49,7 +49,7 @@ RUNTIMES=("win-x86" "win-x64" "win-arm64" "linux-x64" "linux-arm64" "osx-x64" "o
|
||||
|
||||
# Use expanded lists, if requested
|
||||
if [ $USE_ALL = true ]; then
|
||||
FRAMEWORKS=("net40" "net452" "net462" "net472" "net48" "netcoreapp3.1" "net5.0" "net6.0" "net7.0" "net8.0" "net9.0")
|
||||
FRAMEWORKS=("net20" "net35" "net40" "net452" "net462" "net472" "net48" "netcoreapp3.1" "net5.0" "net6.0" "net7.0" "net8.0" "net9.0")
|
||||
fi
|
||||
|
||||
# Create the filter arrays
|
||||
|
||||
@@ -40,7 +40,7 @@ $RUNTIMES = @('win-x86', 'win-x64', 'win-arm64', 'linux-x64', 'linux-arm64', 'os
|
||||
|
||||
# Use expanded lists, if requested
|
||||
if ($USE_ALL.IsPresent) {
|
||||
$FRAMEWORKS = @('net40', 'net452', 'net462', 'net472', 'net48', 'netcoreapp3.1', 'net5.0', 'net6.0', 'net7.0', 'net8.0', 'net9.0')
|
||||
$FRAMEWORKS = @('net20', 'net35', 'net40', 'net452', 'net462', 'net472', 'net48', 'netcoreapp3.1', 'net5.0', 'net6.0', 'net7.0', 'net8.0', 'net9.0')
|
||||
}
|
||||
|
||||
# Create the filter arrays
|
||||
|
||||
Reference in New Issue
Block a user