예제 #1
0
        private void UnPack()           //2018-03-27
        {
            //解密
            if (AmiiboData.Length < NtagHelpers.NFC3D_AMIIBO_SIZE)
            {
                byte[] AmiiboDataTemp = this.AmiiboData;
                Array.Resize(ref AmiiboDataTemp, NtagHelpers.NFC3D_AMIIBO_SIZE);
                this.AmiiboData = AmiiboDataTemp;
            }

            try
            {
                //AmiiKeys = AmiiboKeys.LoadKeys("KeyTemp.bin");
                //AmiiKeys = AmiiboKeys.LoadKeys(key_retail);
                AmiiKeys.Unpack(this.AmiiboData, Decrypted);
                this.AmiiboDataDecrypted = Decrypted;
                this.msgNFC = new Message_NFC(AmiiboDataDecrypted);

                msgTP  = new Message_TP(AmiiboDataDecrypted, msgNFC);
                msgSSB = new Message_SSB(AmiiboDataDecrypted, msgNFC);
            }
            catch
            {
            }
            this.NTAG_ID = GetFileString(0x00, 3) + GetFileString(0x04, 4);
            this.SerA    = GetFileString(0x54, 4);
            this.SerB    = GetFileString(0x58, 4);

            this.isBegin04 = (GetFileString(0x00, 1) == "04") ? true : false;
            IdMessage      = new AmiiboMessage(this.SerA + this.SerB);       //2018-01-25

            FileToCRC32 crc32 = new FileToCRC32();

            this.CRC32_Decrypted = crc32.ComputeCRC32(this.AmiiboDataDecrypted, 0x28, 0x18c);   //2018-01-27 0x28~0x1B3 396
            this.CRC32_block36   = crc32.ComputeCRC32(this.AmiiboDataDecrypted, 0x1e4, 0x24);   //2018-01-30 0x1E4~0x207 36

            getMcasName myMcasName = new getMcasName(this.CRC32);

            this.mcasName = myMcasName.Mcas_Name;

            this.NewName  = this.isBegin04 ? "" : "[E]";
            this.NewName += "[" + this.IdMessage.GameShortName + "]";
            this.NewName += " " + this.IdMessage.Number + "-" + this.IdMessage.AmiiboName + " ";
            this.NewName += "[" + this.CRC32_Decrypted + "-" + this.CRC32_block36 + "-" + this.NTAG_ID + "-" + this.Length.ToString("000") + "]";
            if (msgSSB.canEdit)
            {
                this.NewName += "(" + this.msgSSB.LEVEL + ")";
            }
            this.NewName += ".bin";

            this.NetPath     = "http://amiibo.life/nfc/" + this.SerA + "-" + this.SerB;
            this.PicturePath = "https://raw.githubusercontent.com/N3evin/AmiiboAPI/master/images/icon_" + this.SerA.ToLower() + "-" + this.SerB.ToLower() + ".png";
            //"image": "https://raw.githubusercontent.com/N3evin/AmiiboAPI/master/images/icon_00000000-00340102.png",
        }
예제 #2
0
 public Message_TP(byte[] date, Message_NFC msgNFC)
 {
     if (msgNFC.NFC_ID.Remove(8) == "01030000" && msgNFC.Amiibo_AppID == "1019C800")
     {
         canEdit   = true;
         LEVEL     = (int)date[OFFSET_LEVEL];
         HEARTS    = (int)date[OFFSET_HEARTS];
         myMessage = GetMessage();
     }
     else
     {
         canEdit   = false;
         LEVEL     = 0;
         HEARTS    = 0;
         myMessage = new string[0];
     }
 }
예제 #3
0
        public Message_SSB(byte[] data, Message_NFC msgNFC)
        {
            //if (msgNFC.NFC_ID.Remove(6).Remove(0, 4) == "00" && msgNFC.Amiibo_AppID == "10110E00")
            if (msgNFC.Amiibo_AppID == "10110E00")
            {
                canEdit = true;

                LEVEL_THRESHOLDS = new int[] { 0x00, 0x08, 0x010, 0x01D, 0x02D, 0x048,
                                               0x05B, 0x075, 0x08D, 0x0AF, 0x0E1, 0x0103, 0x0126, 0x0149, 0x0172, 0x0196, 0x01BE, 0x01F7,
                                               0x0216, 0x0240, 0x0278, 0x02A4, 0x02D6, 0x030E, 0x034C, 0x037C, 0x03BB, 0x03F4, 0x042A, 0x0440,
                                               0x048A, 0x04B6, 0x04E3, 0x053F, 0x056D, 0x059C, 0x0606, 0x0641, 0x0670, 0x069E, 0x06FC, 0x072E,
                                               0x075D, 0x07B9, 0x07E7, 0x0844, 0x0875, 0x08D3, 0x0902, 0x093E };

                SetXA();

                APP_DATA = (int)data[OFFSET_APP_DATA];

                APPEARANCE = (int)data[OFFSET_APPEARANCE] + 1;

                SPECIAL_NEUTRAL      = (int)data[OFFSET_SPECIAL_NEUTRAL] + 1;
                SPECIAL_SIDE_TO_SIDE = (int)data[OFFSET_SPECIAL_SIDE_TO_SIDE] + 1;
                SPECIAL_UP           = (int)data[OFFSET_SPECIAL_UP] + 1;
                SPECIAL_DOWN         = (int)data[OFFSET_SPECIAL_DOWN] + 1;

                STATS_ATTACK  = readStat(data, OFFSET_STATS_ATTACK);
                STATS_DEFENSE = readStat(data, OFFSET_STATS_DEFENSE);
                STATS_SPEED   = readStat(data, OFFSET_STATS_SPEED);
                try
                {
                    BONUS_EFFECT1 = XA[(int)data[OFFSET_BONUS_EFFECT1]];
                }
                catch
                {
                    BONUS_EFFECT1 = "No Effect";
                }
                try
                {
                    BONUS_EFFECT2 = XA[(int)data[OFFSET_BONUS_EFFECT2]];
                }
                catch
                {
                    BONUS_EFFECT2 = "No Effect";
                }
                try
                {
                    BONUS_EFFECT3 = XA[(int)data[OFFSET_BONUS_EFFECT3]];
                }
                catch
                {
                    BONUS_EFFECT3 = "No Effect";
                }


                LEVEL = readLevel(data);

                myMessage = GetMessage();
            }
            else
            {
                canEdit = false;

                APP_DATA             = 0;
                APPEARANCE           = 0;
                SPECIAL_NEUTRAL      = 0;
                SPECIAL_SIDE_TO_SIDE = 0;
                SPECIAL_UP           = 0;
                SPECIAL_DOWN         = 0;
                STATS_ATTACK         = 0;
                STATS_DEFENSE        = 0;
                STATS_SPEED          = 0;
                BONUS_EFFECT1        = "";
                BONUS_EFFECT2        = "";
                BONUS_EFFECT3        = "";
                LEVEL = 0;

                myMessage = new string[0];
            }
        }