public override byte[] Write(bool DSV, bool GCI) { // Set Memo Back StrategyMemo.FinalData.CopyTo(Data, Memo); ShadowInfo.FinalData.CopyTo(Data, Shadow); SetChecksums(); // Get updated save slot data ushort[] keys = new ushort[4]; for (int i = 0; i < keys.Length; i++) { keys[i] = BigEndian.ToUInt16(Data, 8 + (i * 2)); } byte[] newSAV = SaveUtil.EncryptGC(Data, 0x10, 0x27FD8, keys); // Put save slot back in original save data byte[] newFile = MC != null ? MC.SelectedSaveData : (byte[])BAK.Clone(); Array.Copy(newSAV, 0, newFile, SLOT_START + (SaveIndex * SLOT_SIZE), newSAV.Length); // Return the gci if Memory Card is not being exported if (!IsMemoryCardSave || GCI) { return(Header.Concat(newFile).ToArray()); } MC.SelectedSaveData = newFile.ToArray(); return(MC.Data); }
private byte[] GetInnerData() { StrategyMemo.Write().CopyTo(Data, Memo); SetChecksums(); // Get updated save slot data byte[] digest = Data.Slice(Data.Length - 20, 20); byte[] newSAV = EncryptColosseum(Data, digest); // Put save slot back in original save data byte[] newFile = MC != null ? MC.SelectedSaveData : (byte[])BAK.Clone(); Array.Copy(newSAV, 0, newFile, SLOT_START + (SaveIndex * SLOT_SIZE), newSAV.Length); return(newFile); }
private byte[] GetInnerData() { // Set Memo Back StrategyMemo.Write().CopyTo(Data, Memo); ShadowInfo.Write().CopyTo(Data, Shadow); SetChecksums(); // Get updated save slot data ushort[] keys = new ushort[4]; for (int i = 0; i < keys.Length; i++) { keys[i] = BigEndian.ToUInt16(Data, 8 + (i * 2)); } byte[] newSAV = GCSaveUtil.Encrypt(Data, 0x10, 0x27FD8, keys); // Put save slot back in original save data byte[] newFile = MC != null ? MC.SelectedSaveData : (byte[])BAK.Clone(); Array.Copy(newSAV, 0, newFile, SLOT_START + (SaveIndex * SLOT_SIZE), newSAV.Length); return(newFile); }
public override byte[] Write(bool DSV, bool GCI) { StrategyMemo.FinalData.CopyTo(Data, Memo); SetChecksums(); // Get updated save slot data byte[] digest = Data.Skip(Data.Length - 20).Take(20).ToArray(); byte[] newSAV = EncryptColosseum(Data, digest); // Put save slot back in original save data byte[] newFile = MC != null ? MC.SelectedSaveData : (byte[])BAK.Clone(); Array.Copy(newSAV, 0, newFile, SLOT_START + (SaveIndex * SLOT_SIZE), newSAV.Length); // Return the gci if Memory Card is not being exported if (!IsMemoryCardSave || GCI) { return(Header.Concat(newFile).ToArray()); } MC.SelectedSaveData = newFile.ToArray(); return(MC.Data); }