Minor cleanup

This commit is contained in:
Matt Nadareski
2026-03-21 23:20:40 -04:00
parent 402134426e
commit 0305d03b00
4 changed files with 12 additions and 3 deletions

View File

@@ -101,6 +101,11 @@ namespace NDecrypt.Core
Console.WriteLine("Encryption Method: Key 0x1B");
KeyX = development ? args.DevKeyX0x1B : args.KeyX0x1B;
break;
// This should never happen
default:
Console.WriteLine("Encryption Method: UNSUPPORTED");
break;
}
// Set the normal key based on the new KeyX value

View File

@@ -214,7 +214,7 @@ namespace NDecrypt.Core
var cipher = AESCTR.CreateDecryptionCipher(_keysMap[index].NormalKey2C, cart.PlainIV(index));
// Process the extended header
AESCTR.PerformOperation(Constants.CXTExtendedDataHeaderLength, cipher, reader, writer, null);
AESCTR.PerformOperation(CXTExtendedDataHeaderLength, cipher, reader, writer, null);
#if NET6_0_OR_GREATER
// In .NET 6.0, this operation is not picked up by the reader, so we have to force it to reload its buffer
@@ -639,7 +639,7 @@ namespace NDecrypt.Core
var cipher = AESCTR.CreateEncryptionCipher(_keysMap[index].NormalKey2C, cart.PlainIV(index));
// Process the extended header
AESCTR.PerformOperation(Constants.CXTExtendedDataHeaderLength, cipher, reader, writer, null);
AESCTR.PerformOperation(CXTExtendedDataHeaderLength, cipher, reader, writer, null);
#if NET6_0_OR_GREATER
// In .NET 6.0, this operation is not picked up by the reader, so we have to force it to reload its buffer

View File

@@ -105,6 +105,10 @@ namespace NDecrypt.Features
FileType.NDSi => _tools[FileType.NDS],
FileType.iQueDS => _tools[FileType.NDS],
FileType.N3DS => _tools[FileType.N3DS],
FileType.iQue3DS => _tools[FileType.N3DS],
// Invalid cases
FileType.NULL => null,
_ => null,
};
}

View File

@@ -6,7 +6,7 @@ using SabreTools.CommandLine.Features;
namespace NDecrypt
{
class Program
public class Program
{
public static void Main(string[] args)
{