コード例 #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;
 }
コード例 #2
0
ファイル: BK4.cs プロジェクト: yanisdreemurr/PKHeX
        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);
        }
コード例 #3
0
ファイル: PK4.cs プロジェクト: tkfltkgk/PKHeX
        public BK4 convertToBK4()
        {
            BK4 bk4 = new BK4();

            TransferPropertiesWithReflection(this, bk4);
            // Fix Non-Reflectable properties
            Array.Copy(Data, 0x78, bk4.Data, 0x78, 6); // Met Info
            // Preserve Trash Bytes
            for (int i = 0; i < 11; i++)               // Nickname
            {
                bk4.Data[0x48 + 2 * i]     = Data[0x48 + 2 * i + 1];
                bk4.Data[0x48 + 2 * i + 1] = Data[0x48 + 2 * i];
            }
            for (int i = 0; i < 8; i++) // OT_Name
            {
                bk4.Data[0x68 + 2 * i]     = Data[0x68 + 2 * i + 1];
                bk4.Data[0x68 + 2 * i + 1] = Data[0x68 + 2 * i];
            }
            bk4.Sanity = 0x4000;
            bk4.RefreshChecksum();
            return(bk4);
        }
コード例 #4
0
ファイル: PK4.cs プロジェクト: kwsch/PKHeX
 public BK4 convertToBK4()
 {
     BK4 bk4 = new BK4();
     TransferPropertiesWithReflection(this, bk4);
     // Fix Non-Reflectable properties
     Array.Copy(Data, 0x78, bk4.Data, 0x78, 6); // Met Info
     // Preserve Trash Bytes
     for (int i = 0; i < 11; i++) // Nickname
     {
         bk4.Data[0x48 + 2*i] = Data[0x48 + 2*i + 1];
         bk4.Data[0x48 + 2*i + 1] = Data[0x48 + 2*i];
     }
     for (int i = 0; i < 8; i++) // OT_Name
     {
         bk4.Data[0x68 + 2*i] = Data[0x68 + 2*i + 1];
         bk4.Data[0x68 + 2*i + 1] = Data[0x68 + 2*i];
     }
     bk4.Sanity = 0x4000;
     bk4.RefreshChecksum();
     return bk4;
 }