From 0305d03b00828934ec250282bc2e74227e5f20f8 Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Sat, 21 Mar 2026 23:20:40 -0400 Subject: [PATCH] Minor cleanup --- NDecrypt.Core/PartitionKeys.cs | 5 +++++ NDecrypt.Core/ThreeDSTool.cs | 4 ++-- NDecrypt/Features/BaseFeature.cs | 4 ++++ NDecrypt/Program.cs | 2 +- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/NDecrypt.Core/PartitionKeys.cs b/NDecrypt.Core/PartitionKeys.cs index b7b3885..929bcd3 100644 --- a/NDecrypt.Core/PartitionKeys.cs +++ b/NDecrypt.Core/PartitionKeys.cs @@ -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 diff --git a/NDecrypt.Core/ThreeDSTool.cs b/NDecrypt.Core/ThreeDSTool.cs index f9cb94f..f07c1f9 100644 --- a/NDecrypt.Core/ThreeDSTool.cs +++ b/NDecrypt.Core/ThreeDSTool.cs @@ -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 diff --git a/NDecrypt/Features/BaseFeature.cs b/NDecrypt/Features/BaseFeature.cs index d81c260..0a6d975 100644 --- a/NDecrypt/Features/BaseFeature.cs +++ b/NDecrypt/Features/BaseFeature.cs @@ -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, }; } diff --git a/NDecrypt/Program.cs b/NDecrypt/Program.cs index 348e4b7..571494e 100644 --- a/NDecrypt/Program.cs +++ b/NDecrypt/Program.cs @@ -6,7 +6,7 @@ using SabreTools.CommandLine.Features; namespace NDecrypt { - class Program + public class Program { public static void Main(string[] args) {