Exemplo n.º 1
0
 private GEnum2 method_19()
 {
     if (!Directory.Exists(this.OutputPath) || !File.Exists(Path.Combine(this.OutputPath, "title.tmd")) || !File.Exists(Path.Combine(this.OutputPath, "title.tik")) || (this.System == SystemType.SystemWiiU || this.System == SystemType.SystemWii) && !File.Exists(Path.Combine(this.OutputPath, "title.cert")))
     {
         return(GEnum2.const_0);
     }
     if ((this is GClass31 || this.Platform == Platform.Wii_U_Custom) && !new GClass78().DownloadFile(this.CDN_URL_PLUS_TITLEID + "tmd").smethod_5(File.ReadAllBytes(Path.Combine(this.OutputPath, "title.tmd"))))
     {
         return(GEnum2.const_1);
     }
     foreach (GClass101 gclass101 in TMDExcractionAndProcessing.smethod_0(Path.Combine(this.OutputPath, "title.tmd"), this.System).GClass101_0)
     {
         string outputPath1 = this.OutputPath;
         uint   contentId   = gclass101.ContentId;
         string path2_1     = contentId.ToString("x8") + ".app";
         string str         = Path.Combine(outputPath1, path2_1);
         if (!File.Exists(str) || new FileInfo(str).Length != (long)gclass101.ContentSize.TotalBytes.smethod_2(16U))
         {
             return(GEnum2.const_1);
         }
         if (gclass101.Boolean_0)
         {
             string outputPath2 = this.OutputPath;
             contentId = gclass101.ContentId;
             string path2_2 = contentId.ToString("x8") + ".h3";
             if (!File.Exists(Path.Combine(outputPath2, path2_2)))
             {
                 return(GEnum2.const_1);
             }
         }
     }
     return(GEnum2.const_2);
 }
Exemplo n.º 2
0
 public void method_0(string string_4, string string_5, string string_6, string string_7)
 {
     this.gclass100_0 = TMDExcractionAndProcessing.smethod_0(string_6, SystemType.SystemWii);
     this.string_0    = string_4;
     this.string_1    = string_5;
     this.string_2    = string_6;
     this.string_3    = string_7;
     this.gclass108_0 = new GClass108();
 }
Exemplo n.º 3
0
        private static void smethod_3(IEnumerable <DirectoryInfo> ienumerable_0)
        {
            foreach (DirectoryInfo directoryInfo in ienumerable_0.Where <DirectoryInfo>((Func <DirectoryInfo, bool>)(directoryInfo_0 =>
            {
                ulong result;
                if (directoryInfo_0.Name.Length == 16 && ulong.TryParse(directoryInfo_0.Name, NumberStyles.HexNumber, (IFormatProvider)CultureInfo.CurrentCulture, out result) && !directoryInfo_0.FullName.Contains("EMULATORS"))
                {
                    return(!directoryInfo_0.FullName.Contains("SAVES"));
                }
                return(false);
            })))
            {
                TitleId  index    = new TitleId(directoryInfo.Name);
                GClass30 gclass30 = (GClass30)null;
                try
                {
                    // ISSUE: object of a compiler-generated type is created
                    // ISSUE: variable of a compiler-generated type
                    GClass26.Class36 class36 = new GClass26.Class36();
                    switch (index.IdType)
                    {
                    case DownloadType.Update:
                        TMDExcractionAndProcessing gclass100 = TMDExcractionAndProcessing.smethod_0(Path.Combine(directoryInfo.FullName, "title.tmd"), SystemType.SystemWiiU);
                        // ISSUE: reference to a compiler-generated field
                        class36.ushort_0 = gclass100.TitleVersion;
                        // ISSUE: reference to a compiler-generated method
                        gclass30 = (GClass30)GClass28.dictionary_0[index.FullGame].Updates.First <GClass33>(new Func <GClass33, bool>(class36.method_0));
                        break;

                    case DownloadType.GameWiiOrU:
                        gclass30 = (GClass30)GClass28.dictionary_0[index];
                        break;

                    case DownloadType.DLC:
                        gclass30 = (GClass30)GClass28.dictionary_0[index.FullGame].Dlc;
                        break;

                    case DownloadType.Game3DS:
                        gclass30 = (GClass30)GClass28.dictionary_0[index];
                        break;
                    }
                }
                catch
                {
                    continue;
                }
                try
                {
                    FileSystem.MoveDirectory(directoryInfo.FullName, gclass30.OutputPath);
                }
                catch
                {
                }
            }
        }
Exemplo n.º 4
0
        public static List <GStruct7> smethod_1(GClass30 gclass30_0)
        {
            // ISSUE: object of a compiler-generated type is created
            // ISSUE: variable of a compiler-generated type
            Class85.Class86 class86 = new Class85.Class86();
            // ISSUE: reference to a compiler-generated field
            class86.gclass30_0 = gclass30_0;
            // ISSUE: reference to a compiler-generated field
            string str1 = Path.Combine(class86.gclass30_0.OutputPath, "title.tmd");
            // ISSUE: reference to a compiler-generated field
            string str2 = Path.Combine(class86.gclass30_0.OutputPath, "title.tik");

            // ISSUE: reference to a compiler-generated field
            if (File.Exists(str1) && (class86.gclass30_0.Ticket != null || File.Exists(str2)))
            {
                if (!File.Exists(str1))
                {
                    return(((IEnumerable <GStruct7>) new GStruct7[1]
                    {
                        new GStruct7((GClass101)null, new List <int>(), false, true)
                    }).ToList <GStruct7>());
                }
                // ISSUE: reference to a compiler-generated field
                TMDExcractionAndProcessing gclass100 = TMDExcractionAndProcessing.smethod_0(str1, class86.gclass30_0.System);
                // ISSUE: reference to a compiler-generated field
                // ISSUE: reference to a compiler-generated field
                // ISSUE: reference to a compiler-generated field
                class86.gclass99_0 = class86.gclass30_0.Ticket ?? GClass99.smethod_6(str2, class86.gclass30_0.System);
                // ISSUE: reference to a compiler-generated method
                return(((IEnumerable <GClass101>)gclass100.GClass101_0).Select <GClass101, GStruct7>(new Func <GClass101, GStruct7>(class86.method_0)).ToList <GStruct7>());
            }
            return(((IEnumerable <GStruct7>) new GStruct7[1]
            {
                new GStruct7((GClass101)null, new List <int>(), false, true)
            }).ToList <GStruct7>());
        }
Exemplo n.º 5
0
        private void FrmImport_Load(object sender, EventArgs e)
        {
            // ISSUE: object of a compiler-generated type is created
            // ISSUE: variable of a compiler-generated type
            FrmImport.Class156 class156 = new FrmImport.Class156();
            // ISSUE: reference to a compiler-generated field
            class156.frmImport_0 = this;
            this.lstTitles.SortDescriptors.Add(new SortDescriptor("Value", ListSortDirection.Ascending));
            // ISSUE: reference to a compiler-generated field
            class156.string_0 = new string[0];
            // ISSUE: reference to a compiler-generated field
            class156.string_1 = new string[0];
            int num1;
            // ISSUE: reference to a compiler-generated method
            FrmWait frmWait = new FrmWait("USB Helper is looking for importable titles...", new Action(class156.method_0), (Action <Exception>)(exception_0 => num1 = (int)RadMessageBox.Show("An error has occured.\n" + (object)exception_0)));
            Struct4 struct4;

            // ISSUE: reference to a compiler-generated field
            foreach (string str1 in class156.string_0)
            {
                string str2 = "Ready to import";
                TMDExcractionAndProcessing gclass100 = TMDExcractionAndProcessing.smethod_0(str1, SystemType.SystemWiiU);
                TitleId titleId = new TitleId(gclass100.TitleId.ToString("x16"));
                if (!GClass28.dictionary_0.ContainsKey(titleId.FullGame))
                {
                    string           str3             = "Cannot be imported, not in the database";
                    ListViewDataItem listViewDataItem = new ListViewDataItem();
                    this.lstTitles.Items.Add(listViewDataItem);
                    listViewDataItem.Enabled = false;
                    listViewDataItem[0]      = (object)string.Format("UNKNOWN ({0})", (object)titleId.IdRaw);
                    listViewDataItem[1]      = (object)str3;
                }
                else
                {
                    GClass30 gclass30 = (GClass30)null;
                    switch (titleId.IdType)
                    {
                    case DownloadType.Update:
                        gclass30 = (GClass30)GClass28.dictionary_0[titleId.FullGame];
                        if (gclass30.System == SystemType.System3DS)
                        {
                            gclass30 = (GClass30)GClass28.dictionary_0[titleId.FullGame].Updates.Last <GClass33>();
                            break;
                        }
                        if (gclass30.System == SystemType.SystemWiiU)
                        {
                            // ISSUE: object of a compiler-generated type is created
                            // ISSUE: variable of a compiler-generated type
                            FrmImport.Class157 class157 = new FrmImport.Class157();
                            // ISSUE: reference to a compiler-generated field
                            class157.ushort_0 = gclass100.TitleVersion;
                            try
                            {
                                // ISSUE: reference to a compiler-generated method
                                gclass30 = (GClass30)GClass28.dictionary_0[titleId.FullGame].Updates.Find(new Predicate <GClass33>(class157.method_0));
                                break;
                            }
                            catch
                            {
                                gclass30 = (GClass30)null;
                                break;
                            }
                        }
                        else
                        {
                            break;
                        }

                    case DownloadType.GameWiiOrU:
                        gclass30 = (GClass30)GClass28.dictionary_0[titleId.FullGame];
                        break;

                    case DownloadType.DLC:
                        gclass30 = (GClass30)GClass28.dictionary_0[titleId.FullGame].Dlc;
                        break;

                    case DownloadType.Game3DS:
                        gclass30 = (GClass30)GClass28.dictionary_0[titleId.FullGame];
                        break;

                    case DownloadType.GameDSI:
                        gclass30 = (GClass30)GClass28.dictionary_0[titleId.FullGame];
                        break;
                    }
                    if (gclass30 != null)
                    {
                        ListViewDataItem listViewDataItem1 = new ListViewDataItem();
                        struct4               = new Struct4();
                        struct4.gclass100_0   = gclass100;
                        struct4.gclass30_0    = gclass30;
                        struct4.string_0      = Path.GetDirectoryName(str1);
                        listViewDataItem1.Tag = (object)struct4;
                        ListViewDataItem listViewDataItem2 = listViewDataItem1;
                        if (gclass30.GEnum2_0 != GEnum2.const_0)
                        {
                            str2 = "Cannot be imported, already in the library";
                            listViewDataItem2.Enabled = false;
                        }
                        this.lstTitles.Items.Add(listViewDataItem2);
                        listViewDataItem2[0] = (object)gclass30.ToString();
                        listViewDataItem2[1] = (object)str2;
                    }
                }
            }
            // ISSUE: reference to a compiler-generated field
            foreach (string str in class156.string_1)
            {
                try
                {
                    if (!(new DirectoryInfo(Path.GetDirectoryName(str)).Name != "meta"))
                    {
                        TitleId key = new TitleId(XDocument.Load(str).Descendants((XName)"title_id").ElementAt <XElement>(0).Value);
                        if (key.IdType == DownloadType.GameWiiOrU)
                        {
                            if (GClass28.dictionary_0.ContainsKey(key))
                            {
                                GClass32 gclass32 = GClass28.dictionary_0[key];
                                GClass95 gclass95 = gclass32.method_14(false);
                                if (gclass95 != null)
                                {
                                    if (!gclass32.Boolean_1)
                                    {
                                        ListViewDataItem listViewDataItem1 = new ListViewDataItem();
                                        this.lstTitles.Items.Add(listViewDataItem1);
                                        listViewDataItem1[0] = (object)(gclass32.Name + " (EMU)");
                                        listViewDataItem1[1] = (object)"Importable";
                                        ListViewDataItem listViewDataItem2 = listViewDataItem1;
                                        struct4            = new Struct4();
                                        struct4.gclass30_0 = (GClass30)gclass32;
                                        struct4.gclass95_0 = gclass95;
                                        struct4.string_0   = new DirectoryInfo(Path.GetDirectoryName(str)).Parent.FullName;
                                        // ISSUE: variable of a boxed type
                                        __Boxed <Struct4> local = (ValueType)struct4;
                                        listViewDataItem2.Tag = (object)local;
                                    }
                                }
                            }
                        }
                    }
                }
                catch
                {
                }
            }
            if (this.lstTitles.Items.Count != 0)
            {
                return;
            }
            int num2 = (int)RadMessageBox.Show("No games were found. Please specify another path.");

            this.DialogResult = DialogResult.Abort;
            this.Close();
        }