mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-10 06:34:19 +00:00
parent
67fc0d0885
commit
992deea183
1 changed files with 2 additions and 2 deletions
|
@ -64,7 +64,7 @@ public sealed class KeySystem5(SAV5B2W2 SAV, Memory<byte> raw) : SaveBlock<SAV5B
|
||||||
{
|
{
|
||||||
ArgumentOutOfRangeException.ThrowIfGreaterThan((uint)key, (uint)KeyType5.Iceberg);
|
ArgumentOutOfRangeException.ThrowIfGreaterThan((uint)key, (uint)KeyType5.Iceberg);
|
||||||
var offset = OffsetKeysUnlocked + (sizeof(uint) * (int)key);
|
var offset = OffsetKeysUnlocked + (sizeof(uint) * (int)key);
|
||||||
var expect = MagicKeyUnlocked[(int)key + 5] ^ Crypto;
|
var expect = MagicKeyUnlocked[(int)key] ^ Crypto;
|
||||||
var value = ReadUInt32LittleEndian(Data[offset..]);
|
var value = ReadUInt32LittleEndian(Data[offset..]);
|
||||||
return value == expect;
|
return value == expect;
|
||||||
}
|
}
|
||||||
|
@ -73,7 +73,7 @@ public sealed class KeySystem5(SAV5B2W2 SAV, Memory<byte> raw) : SaveBlock<SAV5B
|
||||||
{
|
{
|
||||||
ArgumentOutOfRangeException.ThrowIfGreaterThan((uint)key, (uint)KeyType5.Iceberg);
|
ArgumentOutOfRangeException.ThrowIfGreaterThan((uint)key, (uint)KeyType5.Iceberg);
|
||||||
var offset = OffsetKeysUnlocked + (sizeof(uint) * (int)key);
|
var offset = OffsetKeysUnlocked + (sizeof(uint) * (int)key);
|
||||||
var expect = MagicKeyUnlocked[(int)key + 5] ^ Crypto;
|
var expect = MagicKeyUnlocked[(int)key] ^ Crypto;
|
||||||
WriteUInt32LittleEndian(Data[offset..], value ? expect : 0);
|
WriteUInt32LittleEndian(Data[offset..], value ? expect : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue