コード例 #1
0
        }                                                         // Offset: 0x1410, Size: 0xF0

        public override byte[] ToByteArray()
        {
            var buffer = new byte[0x1500];

            base.ToByteArray().CopyTo(buffer, 0);
            ExheaderHash.CopyTo(buffer, 0x160);
            BitConverter.GetBytes(AdditionalHeaderSize).CopyTo(buffer, 0x180);
            BitConverter.GetBytes(SectorZeroOffset).CopyTo(buffer, 0x184);
            BitConverter.GetBytes(PartitionFlags).CopyTo(buffer, 0x188);
            PartitionIdTable.CopyTo(buffer, 0x190);
            Reserved1.CopyTo(buffer, 0x1D0);
            Reserved2.CopyTo(buffer, 0x1F0);
            BitConverter.GetBytes(Card2SaveAddress).CopyTo(buffer, 0x200);
            BitConverter.GetBytes(CardInfoBitmask).CopyTo(buffer, 0x204);
            Reserved3.CopyTo(buffer, 0x208);
            BitConverter.GetBytes(TitleVersion).CopyTo(buffer, 0x310);
            BitConverter.GetBytes(CardRevision).CopyTo(buffer, 0x312);
            Reserved4.CopyTo(buffer, 0x314);
            CardSeedY.CopyTo(buffer, 0x1000);
            EncryptedCardSeed.CopyTo(buffer, 0x1010);
            CardSeedAESMAC.CopyTo(buffer, 0x1020);
            CardSeedNonce.CopyTo(buffer, 0x1030);
            Reserved5.CopyTo(buffer, 0x103C);
            FirstNcchHeader.CopyTo(buffer, 0x1100);
            CardDeviceReserved1.CopyTo(buffer, 0x1200);
            TitleKey.CopyTo(buffer, 0x1400);
            CardDeviceReserved2.CopyTo(buffer, 0x1410);
            return(buffer);
        }
コード例 #2
0
                public override int GetHashCode()
                {
                    int hash = 1;

                    if (NotificationId.Length != 0)
                    {
                        hash ^= NotificationId.GetHashCode();
                    }
                    if (TitleKey.Length != 0)
                    {
                        hash ^= TitleKey.GetHashCode();
                    }
                    if (Category.Length != 0)
                    {
                        hash ^= Category.GetHashCode();
                    }
                    if (CreateTimestampMs != 0L)
                    {
                        hash ^= CreateTimestampMs.GetHashCode();
                    }
                    hash ^= variables_.GetHashCode();
                    hash ^= labels_.GetHashCode();
                    if (ExpireTimeMs != 0L)
                    {
                        hash ^= ExpireTimeMs.GetHashCode();
                    }
                    if (_unknownFields != null)
                    {
                        hash ^= _unknownFields.GetHashCode();
                    }
                    return(hash);
                }
コード例 #3
0
        /// <summary>
        ///     Creates a blank ticket using the referenced title
        /// </summary>
        /// <param name="title">The title</param>
        /// <returns></returns>
        public static byte[] Create(TitleKey title)
        {
            if (string.IsNullOrEmpty(title.titleID))
            {
                return(null);
            }

            var tiktem =
                ("00010004d15ea5ed15abe11ad15ea5ed15abe11ad15ea5ed15abe11ad15ea5ed15abe11a" +
                 "d15ea5ed15abe11ad15ea5ed15abe11ad15ea5ed15abe11ad15ea5ed15abe11ad15ea5ed" +
                 "15abe11ad15ea5ed15abe11ad15ea5ed15abe11ad15ea5ed15abe11ad15ea5ed15abe11a" +
                 "d15ea5ed15abe11ad15ea5ed15abe11ad15ea5ed15abe11ad15ea5ed15abe11ad15ea5ed" +
                 "15abe11ad15ea5ed15abe11ad15ea5ed15abe11ad15ea5ed15abe11ad15ea5ed15abe11a" +
                 "d15ea5ed15abe11ad15ea5ed15abe11ad15ea5ed15abe11ad15ea5ed15abe11ad15ea5ed" +
                 "15abe11ad15ea5ed15abe11ad15ea5ed15abe11ad15ea5ed15abe11ad15ea5ed15abe11a" +
                 "d15ea5ed15abe11a00000000000000000000000000000000000000000000000000000000" +
                 "0000000000000000000000000000000000000000000000000000000000000000526f6f74" +
                 "2d434130303030303030332d585330303030303030630000000000000000000000000000" +
                 "000000000000000000000000000000000000000000000000feedfacefeedfacefeedface" +
                 "feedfacefeedfacefeedfacefeedfacefeedfacefeedfacefeedfacefeedfacefeedface" +
                 "feedfacefeedfacefeedface010000cccccccccccccccccccccccccccccccc0000000000" +
                 "0000000000000000aaaaaaaaaaaaaaaa0000000000000000000000000000000000000000" +
                 "000000000000000000000000000000000000000000000000000000000000000000000000" +
                 "000000000001000000000000000000000000000000000000000000000000000000000000" +
                 "000000000000000000000000000000000000000000000000000000000000000000000000" +
                 "000000000000000000000000000000000000000000000000000000000000000000000000" +
                 "0000000000000000000000000000000000000000000000000000000000010014000000ac" +
                 "000000140001001400000000000000280000000100000084000000840003000000000000" +
                 "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00000000" +
                 "000000000000000000000000000000000000000000000000000000000000000000000000" +
                 "000000000000000000000000000000000000000000000000000000000000000000000000" +
                 "0000000000000000000000000000000000000000").HexToBytes();

            var tikdata = new List <byte>(tiktem);

            switch (title.ContentType)
            {
            case "DLC":
                PatchDlc(ref tikdata);
                break;

            case "Demo":
                PatchDemo(ref tikdata);
                break;
            }

            var versions = WiiuTitleDatabase.GetVersions($"00050000{title.Lower8Digits()}");

            tikdata.InsertRange(TK + 0xA6, versions[0].ToBytes());
            tikdata.InsertRange(TK + 0x9C, title.titleID.ToUpper().HexToBytes());
            tikdata.InsertRange(TK + 0x7F, title.titleKey.ToUpper().HexToBytes());

            return(tikdata.ToArray());
        }
コード例 #4
0
ファイル: PopUpNews.cs プロジェクト: OatmealDome/SSBUBot
        public PopUpNews(Stream stream) : base(stream)
        {
            using (BinaryDataReader reader = new BinaryDataReader(stream, true))
            {
                // Read the title key
                reader.Seek(0x50, SeekOrigin.Begin);
                TitleKey = reader.ReadString(StringDataFormat.ZeroTerminated, Encoding.ASCII);

                // Read the content key
                reader.Seek(0x90, SeekOrigin.Begin);
                ContentKey = reader.ReadString(StringDataFormat.ZeroTerminated, Encoding.ASCII);

                // Split the title key by underscores
                string[] splitKey = TitleKey.Split("_");

                // Check if this is a pop-up for an event
                if (splitKey[2] == "event")
                {
                    // Combine the event ID and the pop-up ID
                    Id = splitKey[3] + "_" + splitKey[4];

                    // Set the event flag
                    IsPopUpForEvent = true;
                }
                else
                {
                    // The ID is simply the last entry
                    Id = splitKey.Last();

                    // Set the event flag
                    IsPopUpForEvent = false;
                }

                // Seek to the data
                reader.Seek(0xF0, SeekOrigin.Begin);

                // Read the MSBTs
                Dictionary <Language, Dictionary <string, string> > msbts = this.ReadMsbts(reader);

                // Loop over every MSBT combination
                foreach (KeyValuePair <Language, Dictionary <string, string> > pair in msbts)
                {
                    // Add the title and content to their respective Dictionaries
                    TitleText.Add(pair.Key, pair.Value[TitleKey]);
                    ContentText.Add(pair.Key, pair.Value[ContentKey]);
                }

                // Read the image
                Image = this.ReadDataEntry(reader);

                // Read the URL
                Url = this.ReadDataEntryAsString(reader);
            }
        }
コード例 #5
0
ファイル: Present.cs プロジェクト: OatmealDome/SSBUBot
        public Present(Stream stream) : base(stream)
        {
            using (BinaryDataReader reader = new BinaryDataReader(stream, true))
            {
                // Read the title key
                reader.Seek(0x50, SeekOrigin.Begin);
                TitleKey = reader.ReadString(StringDataFormat.ZeroTerminated, Encoding.ASCII);

                // Read the content key
                reader.Seek(0x90, SeekOrigin.Begin);
                ContentKey = reader.ReadString(StringDataFormat.ZeroTerminated, Encoding.ASCII);

                // Parse the ID from the title key
                Id = TitleKey.Split("_").Last();

                // Seek to the data
                reader.Seek(0xF0, SeekOrigin.Begin);

                // Read the MSBTs
                Dictionary <Language, Dictionary <string, string> > msbts = this.ReadMsbts(reader);

                // Loop over every MSBT combination
                foreach (KeyValuePair <Language, Dictionary <string, string> > pair in msbts)
                {
                    // Add the title and content to their respective Dictionaries
                    TitleText.Add(pair.Key, pair.Value[TitleKey]);
                    ContentText.Add(pair.Key, pair.Value[ContentKey]);
                }

                // Read the image
                Image = this.ReadDataEntry(reader);

                // Seek to the unknown
                reader.Seek(0x174, SeekOrigin.Begin);
                SpiritId = reader.ReadUInt32();
            }
        }
コード例 #6
0
                        public override int GetHashCode()
                        {
                            int hash = 1;

                            if (NotificationId.Length != 0)
                            {
                                hash ^= NotificationId.GetHashCode();
                            }
                            if (TitleKey.Length != 0)
                            {
                                hash ^= TitleKey.GetHashCode();
                            }
                            if (Category.Length != 0)
                            {
                                hash ^= Category.GetHashCode();
                            }
                            if (CreateTimestampMs != 0L)
                            {
                                hash ^= CreateTimestampMs.GetHashCode();
                            }
                            hash ^= variables_.GetHashCode();
                            hash ^= labels_.GetHashCode();
                            return(hash);
                        }
コード例 #7
0
ファイル: BuiltinProperties.cs プロジェクト: Allors/excel
 get => this.GetString(TitleKey); set => this.SetString(TitleKey, value);
コード例 #8
0
 public override int GetHashCode()
 {
     return(ArtistKey.GetHashCode() ^ TitleKey.GetHashCode());
 }
コード例 #9
0
ファイル: Event.cs プロジェクト: OatmealDome/SSBUBot
        public Event(Stream stream) : base(stream)
        {
            using (BinaryDataReader reader = new BinaryDataReader(stream, true))
            {
                // Read the title key
                reader.Seek(0x40, SeekOrigin.Begin);
                TitleKey = reader.ReadString(StringDataFormat.ZeroTerminated, Encoding.ASCII);

                // Parse the ID from the title key
                Id = TitleKey.Split("_").Last();

                // Read the third DateTime
                reader.Seek(0x80, SeekOrigin.Begin);
                StartDateTimeDuplicate = ReadDateTime(reader);

                // Read the unknown data
                UnknownDataOne = reader.ReadBytes(0x44);

                // Read the MSBTs
                Dictionary <Language, Dictionary <string, string> > msbts = this.ReadMsbts(reader);

                // Loop over every MSBT combination
                foreach (KeyValuePair <Language, Dictionary <string, string> > pair in msbts)
                {
                    // Add the title text
                    TitleText.Add(pair.Key, pair.Value[TitleKey]);
                }

                // Read the image
                Image = this.ReadDataEntry(reader);

                // Read the URL
                Url = this.ReadDataEntryAsString(reader);

                // Read the fixed time spirits
                ReadFixedTimeSpirits(reader, FixedTimeSpirits);

                // Read the unknown data offset
                uint unknownDataTwoOffset = reader.ReadUInt32();

                // Read more unknown data
                using (reader.TemporarySeek(unknownDataTwoOffset, SeekOrigin.Begin))
                {
                    UnknownDataTwo = reader.ReadBytes(0x10);
                }

                // Read randomly appearing spirits
                ReadRandomlyAppearingSpirits(reader, RandomSpiritsOne, ref RandomSpiritsOneUnknown);
                ReadRandomlyAppearingSpirits(reader, RandomSpiritsTwo, ref RandomSpiritsTwoUnknown);
                ReadRandomlyAppearingSpirits(reader, RandomSpiritsThree, ref RandomSpiritsThreeUnknown);

                // Read the rates offset
                uint ratesOffset = reader.ReadUInt32();

                // Seek to the rates
                using (reader.TemporarySeek(ratesOffset, SeekOrigin.Begin))
                {
                    // Read the rates
                    Rates = new Rates(reader);
                }
            }
        }