private TMDExcractionAndProcessing 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.DownloadFile(gclass30_0.CDN_URL_PLUS_TITLEID + "tmd") : gclass78.DownloadFile(string.Format("{0}tmd.{1}", (object)gclass30_0.CDN_URL_PLUS_TITLEID, (object)gclass30_0.Version)); gclass30_0.Tmd = TMDExcractionAndProcessing.ReadTMDBytes(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); }
private TMDExcractionAndProcessing method_6() { if (this.gclass30_0 is GClass33) { return(TMDExcractionAndProcessing.ReadTMDBytes(new GClass78().DownloadFile(string.Format("{0}tmd.{1}", (object)this.gclass30_0.CDN_URL_PLUS_TITLEID, (object)this.gclass30_0.Version)), SystemType.SystemWiiU)); } return(TMDExcractionAndProcessing.ReadTMDBytes(new GClass78().DownloadFile(string.Format("{0}tmd", (object)this.gclass30_0.CDN_URL_PLUS_TITLEID)), SystemType.SystemWiiU)); }
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 TMDExcractionAndProcessing.ReadTMDBytes(File.ReadAllBytes(Path.Combine(gclass30_0.OutputPath, "title.tmd")), SystemType.System3DS).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)); } }
public byte[] method_0(GClass12 gclass12_0, ulong ulong_2 = 0) { if (this.gclass100_0 == null || this.gclass99_0 == null) { this.gclass100_0 = TMDExcractionAndProcessing.ReadTMDBytes(new GClass78().DownloadFile(this.gclass30_0.CDN_URL_PLUS_TITLEID + "tmd"), SystemType.SystemWiiU); 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()); } }
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))); } }
public static TMDExcractionAndProcessing smethod_0(string Nintendo_TMD_File, SystemType SystemType) { return(TMDExcractionAndProcessing.ReadTMDBytes(File.ReadAllBytes(Nintendo_TMD_File), SystemType)); }