Ejemplo n.º 1
0
        private GClass100 method_15(GClass30 gclass30_0, bool bool_5 = true)
        {
            this.method_17("Downloading TMD...");
            string path = Path.Combine(gclass30_0.OutputPath, "title.tmd");

            if (!bool_5 && gclass30_0.Tmd != null)
            {
                return(gclass30_0.Tmd);
            }
            GClass78 gclass78 = new GClass78();

            byte[] numArray = (byte[])null;
            try
            {
                numArray       = !(gclass30_0 is GClass33) ? gclass78.method_2(gclass30_0.String_1 + "tmd") : gclass78.method_2(string.Format("{0}tmd.{1}", (object)gclass30_0.String_1, (object)gclass30_0.Version));
                gclass30_0.Tmd = GClass100.smethod_1(numArray, gclass30_0.System);
            }
            catch (Exception ex)
            {
                this.method_5("TMD not found\n" + ex.ToString() + "\n" + ex.InnerException?.ToString());
            }
            if (bool_5)
            {
                System.IO.File.WriteAllBytes(path, numArray);
            }
            return(gclass30_0.Tmd);
        }
Ejemplo n.º 2
0
 private GClass100 method_6()
 {
     if (this.gclass30_0 is GClass33)
     {
         return(GClass100.smethod_1(new GClass78().method_2(string.Format("{0}tmd.{1}", (object)this.gclass30_0.String_1, (object)this.gclass30_0.Version)), GEnum3.const_1));
     }
     return(GClass100.smethod_1(new GClass78().method_2(string.Format("{0}tmd", (object)this.gclass30_0.String_1)), GEnum3.const_1));
 }
Ejemplo n.º 3
0
 public static void smethod_2(GClass30 gclass30_0)
 {
     if (gclass30_0.GEnum2_0 != GEnum2.const_2)
     {
         throw new Exception("The title must have been downloaded!");
     }
     foreach (GClass101 gclass101 in GClass100.smethod_1(File.ReadAllBytes(Path.Combine(gclass30_0.OutputPath, "title.tmd")), GEnum3.const_0).GClass101_0)
     {
         string string_0 = Path.Combine(gclass30_0.OutputPath, gclass101.ContentId.ToString("x8") + ".app");
         Class85.smethod_6(string_0, string_0 + ".dec", gclass30_0.byte_0, Class85.smethod_9(gclass101.Index));
     }
 }
Ejemplo n.º 4
0
 public byte[] method_0(GClass12 gclass12_0, ulong ulong_2 = 0)
 {
     if (this.gclass100_0 == null || this.gclass99_0 == null)
     {
         this.gclass100_0 = GClass100.smethod_1(new GClass78().method_2(this.gclass30_0.String_1 + "tmd"), GEnum3.const_1);
         this.gclass99_0  = this.method_5();
     }
     if (gclass12_0.bool_1 || gclass12_0.bool_0)
     {
         return((byte[])null);
     }
     using (MemoryStream memoryStream = new MemoryStream())
     {
         this.method_2(gclass12_0, (Stream)memoryStream, true, ulong_2);
         return(memoryStream.ToArray());
     }
 }
Ejemplo n.º 5
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)));
            }
        }
Ejemplo n.º 6
0
 public static GClass100 smethod_0(string string_0, GEnum3 genum3_0)
 {
     return(GClass100.smethod_1(File.ReadAllBytes(string_0), genum3_0));
 }