Ejemplo n.º 1
0
 public static BK4 ReadUnshuffle(ReadOnlySpan<byte> data)
 {
     var PID = ReadUInt32BigEndian(data);
     uint sv = ((PID & 0x3E000) >> 0xD) % 24;
     var unshuffled = PokeCrypto.ShuffleArray(data, sv, PokeCrypto.SIZE_4BLOCK);
     var result = new BK4(unshuffled);
     result.RefreshChecksum();
     return result;
 }
Ejemplo n.º 2
0
        public static BK4 ReadUnshuffle(byte[] data)
        {
            var  PID    = BigEndian.ToUInt32(data, 0);
            uint sv     = ((PID & 0x3E000) >> 0xD) % 24;
            var  Data   = PokeCrypto.ShuffleArray(data, sv, PokeCrypto.SIZE_4BLOCK);
            var  result = new BK4(Data);

            result.RefreshChecksum();
            return(result);
        }
Ejemplo n.º 3
0
        public BK4(byte[] data)
        {
            Data = data;
            uint sv = ((PID & 0x3E000) >> 0xD) % 24;

            Data = PokeCrypto.ShuffleArray(Data, sv, PokeCrypto.SIZE_4BLOCK);
            if (Sanity != 0 && Species <= MaxSpeciesID && !ChecksumValid) // We can only hope
            {
                RefreshChecksum();
            }
            if (Valid && Sanity == 0)
            {
                Sanity = 0x4000;
            }
            ResetPartyStats();
        }