private void open1MB(byte[] input, string path, string GameType, bool oras)
{
ramsavloaded = false;
L_Save.Text = "SAV: " + Path.GetFileName(path);
SaveGame = new PKX.Structures.SaveGame(GameType);
savegame_oras = oras;
savefile = input;
cybergadget = false;
// Logic to allow unlocking of Switch SAV
// Setup SHA
SHA256 mySHA256 = SHA256.Create();
// Check both IVFC Hashes
byte[] zeroarray = new byte[0x200];
Array.Copy(savefile, 0x2000 + 0 * 0x7F000, zeroarray, 0, 0x20);
byte[] hashValue1 = mySHA256.ComputeHash(zeroarray);
Array.Copy(savefile, 0x2000 + 1 * 0x7F000, zeroarray, 0, 0x20);
byte[] hashValue2 = mySHA256.ComputeHash(zeroarray);
byte[] realHash1 = new byte[0x20];
byte[] realHash2 = new byte[0x20];
Array.Copy(savefile, 0x43C - 0 * 0x130, realHash1, 0, 0x20);
Array.Copy(savefile, 0x43C - 1 * 0x130, realHash2, 0, 0x20);
B_SwitchSAV.Enabled = (hashValue1.SequenceEqual(realHash1) && hashValue2.SequenceEqual(realHash2));
getSAVOffsets(ref oras); // to detect if we are ORAS or not
Array.Copy(savefile, 0x5400 + 0x7F000 * savindex, cyberSAV, 0, cyberSAV.Length);
openSave(oras);
}
private bool openXOR(byte[] input, string path)