예제 #1
0
        private GClass99 method_11(GClass30 gclass30_0)
        {
            this.method_17("Fetching Ticket...");
            string str = Path.Combine(gclass30_0.OutputPath, "title.tik");

            if (gclass30_0.Platform != Platform.Wii_U_Custom && (!(gclass30_0 is GClass33) || gclass30_0.System != SystemType.SystemWiiU))
            {
                if (!gclass30_0.bool_0)
                {
                    this.method_17("Generating ticket");
                    System.IO.File.WriteAllBytes(str, gclass30_0.TicketArray);
                    return(gclass30_0.Ticket);
                }
                this.method_17("Downloading ticket from that site");
                byte[] bytes = System.IO.File.ReadAllBytes(Path.Combine(Path.Combine(GClass88.DirectoryCache, "tickets"), gclass30_0.TitleId.IdRaw + ".tik"));
                gclass30_0.TicketArray = bytes;
                System.IO.File.WriteAllBytes(str, bytes);
                gclass30_0.Ticket = GClass99.smethod_7(gclass30_0.TicketArray, gclass30_0.System);
                return(gclass30_0.Ticket);
            }
            this.method_17("Downloading Ticket from NUS");
            this.gclass78_0.method_5(string.Format("{0}cetk", (object)gclass30_0.CDN_URL_PLUS_TITLEID), str, 0UL, GClass78.GEnum4.const_0, this.Proxy, 0L, (byte[])null, (byte[])null, (byte)0);
            gclass30_0.TicketArray = System.IO.File.ReadAllBytes(str);
            gclass30_0.Ticket      = GClass99.smethod_6(str, gclass30_0.System);
            return(gclass30_0.Ticket);
        }
예제 #2
0
        private GClass32 method_1(TitleId titleId_0, string string_5, string string_6, string string_7, DataSize dataSize_0)
        {
            GClass32 gclass32 = new GClass32(string_5, titleId_0, "ALL", (byte[])null, dataSize_0, (List <GClass33>)null, "0", "CTR-P-CTAP", "", "http://ccs.cdn.c.shop.nintendowifi.net/ccs/download/", Platform.Unknown, GEnum3.const_0);

            gclass32.CfwOnly       = true;
            gclass32.TicketArray   = GClass99.smethod_0(titleId_0.IdRaw, string_7, 0);
            gclass32.byte_0        = string_6.smethod_6();
            gclass32.Ticket        = GClass99.smethod_7(gclass32.TicketArray, GEnum3.const_0);
            gclass32.Ticket.Byte_0 = string_6.smethod_6();
            return(gclass32);
        }
예제 #3
0
 private GClass99 method_5()
 {
     if (this.gclass30_0 is GClass33 || this.gclass30_0.Platform == Platform.Wii_U_Custom)
     {
         return(GClass99.smethod_7(new GClass78().DownloadFile(this.gclass30_0.CDN_URL_PLUS_TITLEID + "cetk"), SystemType.SystemWiiU));
     }
     if (this.gclass30_0.bool_0)
     {
         return(GClass99.smethod_7(new GClass78().DownloadFile(this.gclass30_0.string_0), SystemType.SystemWiiU));
     }
     return(GClass99.smethod_7(this.gclass30_0.TicketArray, SystemType.SystemWiiU));
 }
예제 #4
0
 private GClass99 method_5()
 {
     if (this.gclass30_0 is GClass33 || this.gclass30_0.Platform == Platform.Wii_U_Custom)
     {
         return(GClass99.smethod_7(new GClass78().method_2(this.gclass30_0.String_1 + "cetk"), GEnum3.const_1));
     }
     if (this.gclass30_0.bool_0)
     {
         return(GClass99.smethod_7(new GClass78().method_2(this.gclass30_0.string_0), GEnum3.const_1));
     }
     return(GClass99.smethod_7(this.gclass30_0.TicketArray, GEnum3.const_1));
 }
예제 #5
0
 protected GClass30(string string_7, TitleId titleId_1, string string_8, byte[] byte_2, DataSize dataSize_1, string string_9, GEnum3 genum3_1)
 {
     this.Name        = string_7;
     this.TitleId     = titleId_1;
     this.Region      = string_8;
     this.TicketArray = byte_2;
     if (this.TicketArray != null)
     {
         this.Ticket = GClass99.smethod_7(byte_2, genum3_1);
     }
     this.Size = dataSize_1;
     this.RootDownloadLocation = string_9;
     this.System = genum3_1;
 }
예제 #6
0
        private void method_3(Stream stream_0)
        {
            int num1 = 0;

            for (int index = 0; index < this.gclass100_0.GClass101_0.Length - 1; ++index)
            {
                num1 += GClass27.smethod_0((int)this.gclass100_0.GClass101_0[index].Size.TotalBytes, 64);
            }
            this.gclass108_0.UInt32_0 = (uint)num1 + (uint)(int)this.gclass100_0.GClass101_0[this.gclass100_0.GClass101_0.Length - 1].Size.TotalBytes;
            byte[] buffer1  = File.ReadAllBytes(this.string_2);
            byte[] buffer2  = File.ReadAllBytes(this.string_0);
            byte[] numArray = File.ReadAllBytes(this.string_1);
            GClass99.smethod_7(numArray, GEnum3.const_3);
            this.gclass108_0.UInt32_2 = (uint)(484 + this.gclass100_0.GClass101_0.Length * 36);
            this.gclass108_0.UInt32_1 = 0U;
            stream_0.Seek(0L, SeekOrigin.Begin);
            this.gclass108_0.method_0(stream_0);
            stream_0.Seek((long)GClass27.smethod_0((int)stream_0.Position, 64), SeekOrigin.Begin);
            stream_0.Write(buffer2, 0, buffer2.Length);
            stream_0.Seek((long)GClass27.smethod_0((int)stream_0.Position, 64), SeekOrigin.Begin);
            stream_0.Write(numArray, 0, numArray.Length);
            stream_0.Seek((long)GClass27.smethod_0((int)stream_0.Position, 64), SeekOrigin.Begin);
            stream_0.Write(buffer1, 0, (int)this.gclass108_0.UInt32_2);
            byte[] buffer3 = new byte[4096];
            long   num2    = 0;

            foreach (GClass101 gclass101_0 in this.gclass100_0.GClass101_0)
            {
                stream_0.Seek((long)GClass27.smethod_0((int)stream_0.Position, 64), SeekOrigin.Begin);
                using (FileStream fileStream = File.OpenRead(this.method_2(gclass101_0)))
                {
                    int count;
                    do
                    {
                        count = fileStream.Read(buffer3, 0, buffer3.Length);
                        stream_0.Write(buffer3, 0, count);
                        num2 += (long)count;
                    }while (count > 0);
                }
                this.method_4((int)((double)num2 / (double)this.gclass108_0.UInt32_0 * 100.0));
            }
            while (stream_0.Position % 64L != 0L)
            {
                stream_0.WriteByte((byte)0);
            }
        }
예제 #7
0
        public GClass13 method_15()
        {
            if (this.System != GEnum3.const_1)
            {
                throw new Exception("The FST can only be retrieved for WUP titles.");
            }
            GClass100 gclass100 = !(this is GClass33) ? GClass100.smethod_1(new GClass78().method_2(string.Format("{0}tmd", (object)this.String_1)), GEnum3.const_1) : GClass100.smethod_1(new GClass78().method_2(string.Format("{0}tmd.{1}", (object)this.String_1, (object)this.Version)), GEnum3.const_1);
            GClass99  gclass99  = this is GClass33 || this.Platform == Platform.Wii_U_Custom ? GClass99.smethod_7(new GClass78().method_2(this.String_1 + "cetk"), GEnum3.const_1) : (!this.bool_0 ? GClass99.smethod_7(this.TicketArray, GEnum3.const_1) : GClass99.smethod_7(File.ReadAllBytes(Path.Combine(Path.Combine(GClass88.CachePath, "tickets"), this.TitleId.IdRaw + ".tik")), GEnum3.const_1));

            byte[] inputBuffer = new GClass78().method_2(this.String_1 + gclass100.GClass101_0[0].ContentId.ToString("x8"));
            using (AesCryptoServiceProvider cryptoServiceProvider = new AesCryptoServiceProvider())
            {
                cryptoServiceProvider.Key     = gclass99.Byte_0;
                cryptoServiceProvider.Mode    = CipherMode.CBC;
                cryptoServiceProvider.Padding = PaddingMode.None;
                cryptoServiceProvider.IV      = new byte[16];
                return(new GClass13(cryptoServiceProvider.CreateDecryptor().TransformFinalBlock(inputBuffer, 0, inputBuffer.Length)));
            }
        }
예제 #8
0
        public void method_2()
        {
            // ISSUE: object of a compiler-generated type is created
            // ISSUE: variable of a compiler-generated type
            Class72.Class75 class75 = new Class72.Class75();
            // ISSUE: reference to a compiler-generated field
            class75.class72_0 = this;
            // ISSUE: reference to a compiler-generated field
            class75.frmWait_0 = new FrmWait("USB Helper is preparing the ticket cache", true);
            // ISSUE: reference to a compiler-generated method
            Task.Run(new Action(class75.method_0));
            // ISSUE: reference to a compiler-generated field
            class75.frmWait_0.TopMost = true;
            // ISSUE: reference to a compiler-generated field
            int num1 = (int)class75.frmWait_0.ShowDialog();

            if (this.string_0 != "")
            {
                List <Class72.Class73> source = JsonConvert.DeserializeObject <List <Class72.Class73> >(this.string_0);
                foreach (Class72.Class73 class73 in source.Where <Class72.Class73>((Func <Class72.Class73, bool>)(class73_0 =>
                {
                    if (class73_0.encTitleKey != null && class73_0.titleID != null)
                    {
                        return(new TitleId(class73_0.titleID).IdType == GEnum1.const_0);
                    }
                    return(false);
                })))
                {
                    TitleId key = new TitleId(class73.titleID);
                    if (GClass28.dictionary_3.ContainsKey(key))
                    {
                        for (int index = 0; index < GClass28.dictionary_3[key].Count; ++index)
                        {
                            GClass80.GStruct5 gstruct5 = GClass28.dictionary_3[key][index];
                            GClass28.dictionary_3[key][index] = new GClass80.GStruct5()
                            {
                                dataSize_0 = gstruct5.dataSize_0,
                                titleId_0  = gstruct5.titleId_0,
                                string_0   = gstruct5.string_0,
                                string_2   = class73.titleKey,
                                string_1   = class73.encTitleKey
                            };
                        }
                    }
                }
                foreach (Class72.Class73 class73 in source.Where <Class72.Class73>((Func <Class72.Class73, bool>)(class73_0 =>
                {
                    if (class73_0.encTitleKey != null && class73_0.titleID != null)
                    {
                        return(new TitleId(class73_0.titleID).IdType == GEnum1.const_2);
                    }
                    return(false);
                })))
                {
                    TitleId key = new TitleId(class73.titleID);
                    if (GClass28.dictionary_1.ContainsKey(key))
                    {
                        GClass80.GStruct4 gstruct4  = GClass28.dictionary_1[key];
                        string            string_7  = HttpUtility.HtmlDecode(class73.name.Trim()).Replace("\n", " ");
                        string            str       = class73.region.Trim();
                        TitleId           titleId_1 = key;
                        string            string_8  = str;
                        // ISSUE: variable of the null type
                        __Null   local      = null;
                        DataSize dataSize0  = gstruct4.dataSize_0;
                        string   string_9   = "http://ccs.cdn.wup.shop.nintendo.net/ccs/download/";
                        int      num2       = 0;
                        GClass31 gclass31_1 = new GClass31(string_7, titleId_1, string_8, (byte[])local, dataSize0, string_9, (GEnum3)num2);
                        gclass31_1.CfwOnly     = true;
                        gclass31_1.TicketArray = GClass99.smethod_0((string)key, class73.encTitleKey, 1);
                        gclass31_1.byte_0      = class73.titleKey.smethod_6();
                        GClass31 gclass31_2 = gclass31_1;
                        gclass31_2.Ticket        = GClass99.smethod_7(gclass31_2.TicketArray, GEnum3.const_0);
                        gclass31_2.Ticket.Byte_0 = class73.titleKey.smethod_6();
                        GClass28.list_6.Add(gclass31_2);
                    }
                }
                foreach (Class72.Class73 class73 in source.Where <Class72.Class73>((Func <Class72.Class73, bool>)(class73_0 =>
                {
                    if (class73_0.encTitleKey != null)
                    {
                        return(class73_0.titleID != null);
                    }
                    return(false);
                })))
                {
                    TitleId index = new TitleId(class73.titleID);
                    if (index.IdRaw == "0004009B00010202")
                    {
                        GClass28.list_0.Add(this.method_1(index, "ARC1", class73.titleKey, class73.encTitleKey, new DataSize(1UL)));
                    }
                    if (index.IdRaw == "0004009B00010402")
                    {
                        GClass28.list_0.Add(this.method_1(index, "ARC2", class73.titleKey, class73.encTitleKey, new DataSize(1UL)));
                    }
                    if (index.IdRaw == "0004009B00014002")
                    {
                        GClass28.list_0.Add(this.method_1(index, "ARC3", class73.titleKey, class73.encTitleKey, new DataSize(1UL)));
                    }
                    if (index.IdRaw == "0004009B00014102")
                    {
                        GClass28.list_0.Add(this.method_1(index, "ARC4", class73.titleKey, class73.encTitleKey, new DataSize(1UL)));
                    }
                    if (index.IdRaw == "0004009B00014202")
                    {
                        GClass28.list_0.Add(this.method_1(index, "ARC5", class73.titleKey, class73.encTitleKey, new DataSize(1UL)));
                    }
                    if (index.IdRaw == "0004009B00014302")
                    {
                        GClass28.list_0.Add(this.method_1(index, "ARC6", class73.titleKey, class73.encTitleKey, new DataSize(1UL)));
                    }
                    if (index.IdRaw == "000400DB00010302")
                    {
                        GClass28.list_0.Add(this.method_1(index, "ARC7", class73.titleKey, class73.encTitleKey, new DataSize(1UL)));
                    }
                    if (index.IdRaw == "0004009B00014002")
                    {
                        GClass28.gclass32_0 = this.method_1(index, "Shared Font", class73.titleKey, class73.encTitleKey, new DataSize(1466880UL));
                    }
                    if ((index.IdType == GEnum1.const_3 || index.IdType == GEnum1.const_4) && GClass28.dictionary_2.ContainsKey(index))
                    {
                        DbRow           dbRow    = GClass28.dictionary_2[index];
                        string          str      = HttpUtility.HtmlDecode(class73.name.Trim()).Replace("\n", " ");
                        string          string_8 = class73.region.Trim();
                        List <GClass33> list_2   = new List <GClass33>();
                        if (GClass28.dictionary_3.ContainsKey(new TitleId((string)index.FullUpdate)))
                        {
                            foreach (GClass80.GStruct5 gstruct5 in GClass28.dictionary_3[index.FullUpdate])
                            {
                                if (gstruct5.string_2 != null && gstruct5.string_1 != null)
                                {
                                    GClass33 gclass33_1 = new GClass33(str, gstruct5.titleId_0, string_8, (byte[])null, gstruct5.dataSize_0, gstruct5.string_0, "http://ccs.cdn.wup.shop.nintendo.net/ccs/download/", GEnum3.const_0);
                                    gclass33_1.CfwOnly = true;
                                    GClass33 gclass33_2 = gclass33_1;
                                    gclass33_2.TicketArray   = GClass99.smethod_0((string)gstruct5.titleId_0, gstruct5.string_1, int.Parse(gstruct5.string_0));
                                    gclass33_2.byte_0        = gstruct5.string_2.smethod_6();
                                    gclass33_2.Ticket        = GClass99.smethod_7(gclass33_2.TicketArray, GEnum3.const_0);
                                    gclass33_2.Ticket.Byte_0 = gstruct5.string_2.smethod_6();
                                    list_2.Add(gclass33_2);
                                }
                            }
                        }
                        GClass32 gclass32_1 = new GClass32(str, index, dbRow.Region, (byte[])null, dbRow.Size, list_2, dbRow.EshopId, dbRow.ProductCode, dbRow.IconUrl, "http://ccs.cdn.c.shop.nintendowifi.net/ccs/download/", dbRow.Platform, GEnum3.const_0);
                        gclass32_1.CfwOnly = true;
                        GClass32 gclass32_2 = gclass32_1;
                        gclass32_2.TicketArray   = GClass99.smethod_0(index.IdRaw, class73.encTitleKey, 1);
                        gclass32_2.byte_0        = class73.titleKey.smethod_6();
                        gclass32_2.Ticket        = GClass99.smethod_7(gclass32_2.TicketArray, GEnum3.const_0);
                        gclass32_2.Ticket.Byte_0 = class73.titleKey.smethod_6();
                        GClass28.dictionary_0.Add(index, gclass32_2);
                    }
                }
            }
            if (!(this.string_1 != ""))
            {
                return;
            }
            foreach (Class72.Class74 class74 in this.method_0(this.string_1))
            {
                TitleId index = new TitleId(class74.titleID);
                if (GClass28.dictionary_2.ContainsKey(index))
                {
                    DbRow    dbRow      = GClass28.dictionary_2[index];
                    GClass32 gclass32_1 = new GClass32(class74.name, index, dbRow.Region, (byte[])null, dbRow.Size, new List <GClass33>(), dbRow.EshopId, dbRow.ProductCode, dbRow.IconUrl, "http://ccs.cdn.wup.shop.nintendo.net/ccs/download/", dbRow.Platform, GEnum3.const_3);
                    gclass32_1.CfwOnly = true;
                    GClass32 gclass32_2 = gclass32_1;
                    byte[]   numArray   = GClass99.smethod_1((string)dbRow.TitleId, class74.titleKey, 0);
                    gclass32_2.TicketArray = numArray;
                    gclass32_2.Ticket      = GClass99.smethod_7(gclass32_2.TicketArray, GEnum3.const_3);
                    GClass28.dictionary_0.Add(dbRow.TitleId, gclass32_2);
                }
            }
        }
예제 #9
0
        public GClass13 method_15()
        {
            if (this.System != SystemType.SystemWiiU)
            {
                throw new Exception("The FST can only be retrieved for WUP titles.");
            }
            TMDExcractionAndProcessing gclass100 = !(this is GClass33) ? TMDExcractionAndProcessing.ReadTMDBytes(new GClass78().DownloadFile(string.Format("{0}tmd", (object)this.CDN_URL_PLUS_TITLEID)), SystemType.SystemWiiU) : TMDExcractionAndProcessing.ReadTMDBytes(new GClass78().DownloadFile(string.Format("{0}tmd.{1}", (object)this.CDN_URL_PLUS_TITLEID, (object)this.Version)), SystemType.SystemWiiU);
            GClass99 gclass99 = this is GClass33 || this.Platform == Platform.Wii_U_Custom ? GClass99.smethod_7(new GClass78().DownloadFile(this.CDN_URL_PLUS_TITLEID + "cetk"), SystemType.SystemWiiU) : (!this.bool_0 ? GClass99.smethod_7(this.TicketArray, SystemType.SystemWiiU) : GClass99.smethod_7(File.ReadAllBytes(Path.Combine(Path.Combine(GClass88.DirectoryCache, "tickets"), this.TitleId.IdRaw + ".tik")), SystemType.SystemWiiU));

            byte[] inputBuffer = new GClass78().DownloadFile(this.CDN_URL_PLUS_TITLEID + gclass100.GClass101_0[0].ContentId.ToString("x8"));
            using (AesCryptoServiceProvider cryptoServiceProvider = new AesCryptoServiceProvider())
            {
                cryptoServiceProvider.Key     = gclass99.Byte_0;
                cryptoServiceProvider.Mode    = CipherMode.CBC;
                cryptoServiceProvider.Padding = PaddingMode.None;
                cryptoServiceProvider.IV      = new byte[16];
                return(new GClass13(cryptoServiceProvider.CreateDecryptor().TransformFinalBlock(inputBuffer, 0, inputBuffer.Length)));
            }
        }