コード例 #1
0
        void DecryptData()
        {
            if (!isDecrypted)
            {
                if (gs == null)
                {
                    gs = new GetSet(data);
                }

                key = (otId ^ persVal);

                for (int k = 0; k < DATA_SIZE; k += 4)
                {
                    uint val = gs.GetUInt(k);
                    val ^= key;
                    gs.StoreUInt(k, val);
                }

                pattern = persVal % 24;
                for (int i = 0; i < DATA_SIZE; i += 12)
                {
                    byte num = decMatrix[pattern, i / 12];
                    switch (num)
                    {
                    case G: SetGrowth(i); break;

                    case A: SetAttack(i); break;

                    case M: SetMisc(i); break;

                    case E: SetEV(i); break;
                    }
                }
            }
        }
コード例 #2
0
 public Section(byte[] sectionData)
 {
     gs           = new GetSet(sectionData);
     _sectionData = sectionData;
     Array.Copy(sectionData, data, DATA_SIZE);
     _sectionId = gs.GetUShort(0x0FF4);
     _checksum  = gs.GetUShort(0x0FF6);
     _saveIndex = gs.GetUInt(0x0FFC);
 }
コード例 #3
0
 public SaveBlock(byte[] blockData)
 {
     gs         = new GetSet(blockData);
     _blockData = blockData;
     for (int i = 0; i < SECTIONS; i++)
     {
         byte[] sectionData = new byte[SECTION_SIZE];
         Array.Copy(_blockData, SECTION_SIZE * i, sectionData, 0, SECTION_SIZE);
         sections[i] = new Section(sectionData);
     }
 }