/// <summary>Checks to see if the data belongs to a Gen7 save</summary> /// <param name="data">Save data of which to determine the type</param> /// <returns>Version Identifier or Invalid if type cannot be determined.</returns> private static GameVersion GetIsG8SAV(byte[] data) { if (data.Length != SIZE_G8SWSH) return Invalid; return SwishCrypto.GetIsHashValid(data) ? SWSH : Invalid; }
public SAV8SWSH(byte[] data) : base(data) { Data = Array.Empty <byte>(); AllBlocks = SwishCrypto.Decrypt(data); Blocks = new SaveBlockAccessor8SWSH(this); SaveRevision = Zukan.GetRevision(); Initialize(); }
/// <summary>Checks to see if the data belongs to a Gen7 save</summary> /// <param name="data">Save data of which to determine the type</param> /// <returns>Version Identifier or Invalid if type cannot be determined.</returns> private static GameVersion GetIsG8SAV(byte[] data) { if (!SizesSWSH.Contains(data.Length)) { return(Invalid); } return(SwishCrypto.GetIsHashValid(data) ? SWSH : Invalid); }
/// <summary>Checks to see if the data belongs to a Gen7 save</summary> /// <param name="data">Save data of which to determine the type</param> /// <returns>Version Identifier or Invalid if type cannot be determined.</returns> private static GameVersion GetIsG8SAV(byte[] data) { if (data.Length != SIZE_G8SWSH && data.Length != SIZE_G8SWSH_1) { return(Invalid); } return(SwishCrypto.GetIsHashValid(data) ? SWSH : Invalid); }
public static byte[] ExportAllBlocks(IReadOnlyList <SCBlock> blocks, SCBlockExportOption option = SCBlockExportOption.None) { if (option == SCBlockExportOption.None) { return(SwishCrypto.GetDecryptedRawData(blocks)); } using var stream = new MemoryStream(); using var bw = new BinaryWriter(stream); for (var i = 0; i < blocks.Count; i++) { ExportBlock(blocks[i], bw, i, option); } return(stream.ToArray()); }
} // None! protected override byte[] GetFinalData() => SwishCrypto.Encrypt(AllBlocks);
public SAV8SWSH(byte[] data) : this(data, SwishCrypto.Decrypt(data)) { }