using System.IO; using Newtonsoft.Json; namespace NDecrypt.Core { internal class Configuration { #region DS-Specific Fields /// /// Encryption data taken from woodsec /// public string? NitroEncryptionData { get; set; } #endregion #region 3DS-Specific Fields /// /// AES Hardware Constant /// /// generator public string? AESHardwareConstant { get; set; } /// /// KeyX 0x18 (New 3DS 9.3) /// /// slot0x18KeyX public string? KeyX0x18 { get; set; } /// /// Dev KeyX 0x18 (New 3DS 9.3) /// public string? DevKeyX0x18 { get; set; } /// /// KeyX 0x1B (New 3DS 9.6) /// /// slot0x1BKeyX public string? KeyX0x1B { get; set; } /// /// Dev KeyX 0x1B New 3DS 9.6) /// public string? DevKeyX0x1B { get; set; } /// /// KeyX 0x25 (> 7.x) /// /// slot0x25KeyX public string? KeyX0x25 { get; set; } /// /// Dev KeyX 0x25 (> 7.x) /// public string? DevKeyX0x25 { get; set; } /// /// KeyX 0x2C (< 6.x) /// /// slot0x2CKeyX public string? KeyX0x2C { get; set; } /// /// Dev KeyX 0x2C (< 6.x) /// public string? DevKeyX0x2C { get; set; } #endregion public static Configuration? Create(string path) { // Ensure the file exists if (!File.Exists(path)) return null; // Parse the configuration directly try { string contents = File.ReadAllText(path); return JsonConvert.DeserializeObject(contents); } catch { return null; } } } }