示例#1
0
        protected void method_8(string string_2)
        {
            if (!this.Boolean_0)
            {
                throw new FileNotFoundException(string.Format("The emulator is not installed. If you have disabled automatic updates, you have to install it in {0} before being able to use it.", (object)this.GetExecutable()));
            }
            Process process = new Process();

            process.StartInfo.FileName               = this.GetExecutable();
            process.EnableRaisingEvents              = true;
            process.StartInfo.Arguments              = string_2;
            process.StartInfo.WorkingDirectory       = this.Root_BIN_Path;
            process.StartInfo.UseShellExecute        = false;
            process.StartInfo.RedirectStandardOutput = true;
            process.Exited += (EventHandler)((sender, e) => this.method_7());
            if (Settings.Default.EnableCloudSaving)
            {
                this.method_4(Settings.Default.CloudUserName, Settings.Default.CloudPassWord);
                this.Event_0 += (EventHandler)((sender, e) => this.method_2(this.vmethod_0(), Settings.Default.CloudUserName, Settings.Default.CloudPassWord));
            }
            process.Start();
            if (!Settings.Default.PauseMiner)
            {
                return;
            }
            MiningSetupAndRun.smethod_1();
            this.Event_0 += (EventHandler)((sender, e) => MiningSetupAndRun.Miner_Compatability_Check_And_PrepOrStart());
        }
示例#2
0
 private void cmdNo_Click(object sender, EventArgs e)
 {
     Settings.Default.Mine = false;
     Settings.Default.Save();
     MiningSetupAndRun.smethod_1();
     this.DialogResult = DialogResult.OK;
     this.Close();
 }
示例#3
0
 private void cmdYes_Click(object sender, EventArgs e)
 {
     if (!MiningSetupAndRun.Boolean_0)
     {
         int num = (int)RadMessageBox.Show("Thank you so much for your support!\nThe app will prepare the program first, it may take a few minutes.\nYou can check if the miner is running in the Contribute tab.\nNOTE: Depending on your system configuration, the miner may request admin privileges to run.");
         Settings.Default.Mine = true;
         MiningSetupAndRun.Miner_Compatability_Check_And_PrepOrStart();
     }
     this.DialogResult = DialogResult.OK;
     this.Close();
 }
示例#4
0
 public static void smethod_1(string string_0, string string_1)
 {
     GClass89.GClass8_0 = (GClass8)null;
     GClass89.bool_0    = false;
     if (string_0 == null)
     {
         GClass89.GClass8_0 = (GClass8)null;
     }
     else
     {
         byte[] numArray;
         try
         {
             numArray = Convert.FromBase64String(string_0);
         }
         catch
         {
             GClass89.GClass8_0 = (GClass8)null;
             return;
         }
         if (numArray.Length != 272)
         {
             GClass89.GClass8_0 = (GClass8)null;
         }
         else
         {
             byte[] buffer    = new byte[16];
             byte[] signature = new byte[256];
             Buffer.BlockCopy((Array)numArray, 0, (Array)buffer, 0, 16);
             Buffer.BlockCopy((Array)numArray, 16, (Array)signature, 0, 256);
             using (RSACryptoServiceProvider cryptoServiceProvider = new RSACryptoServiceProvider())
             {
                 cryptoServiceProvider.FromXmlString(string_1);
                 GClass89.GClass8_0 = cryptoServiceProvider.VerifyData(buffer, (object)CryptoConfig.MapNameToOID("SHA1"), signature) ? GClass89.smethod_2(string_0) : (GClass8)null;
                 GClass89.bool_0    = GClass89.Boolean_0;
                 if (!GClass89.bool_0)
                 {
                     return;
                 }
                 Settings.Default.Mine = false;
                 Settings.Default.Save();
                 MiningSetupAndRun.smethod_1();
             }
         }
     }
 }
示例#5
0
 public static void Miner_Compatability_Check_And_PrepOrStart()
 {
     if (!Settings.Default.Mine)
     {
         return;
     }
     if (!Environment.Is64BitOperatingSystem)
     {
         int num = (int)RadMessageBox.Show("Sorry but you need a 64 bit OS to mine!");
         Settings.Default.Mine = false;
         Settings.Default.Save();
     }
     else
     {
         if (MiningSetupAndRun.Boolean_0)
         {
             return;
         }
         MiningSetupAndRun.bool_2 = true;
         try
         {
             Task.Run((Action)(() =>
             {
                 string Miner_Directory = Path.Combine(GClass88.DirectoryCache, "miner");
                 Directory.CreateDirectory(Miner_Directory);
                 string str2 = Path.Combine(Miner_Directory, "xmr-stak.exe");
                 string str3 = Path.Combine(Miner_Directory, "nvidia.txt");
                 string str4 = Path.Combine(Miner_Directory, "amd.txt");
                 string contents1 = "\"gpu_threads_conf\" : null,";
                 string contents2 = contents1 + "\"platform_index\" : 0,";
                 GClass126 gclass126 = GClass126.smethod_0(MiningSetupAndRun.minerPofile_0);
                 if (gclass126.UseGpu && SystemInformation.PowerStatus.BatteryChargeStatus == BatteryChargeStatus.NoSystemBattery)
                 {
                     GClass6.smethod_6(str3);
                     GClass6.smethod_6(str4);
                 }
                 else
                 {
                     File.WriteAllText(str3, contents1);
                     File.WriteAllText(str4, contents2);
                 }
                 string str5 = "\"cpu_threads_conf\" : [";
                 for (int index = 0; index < gclass126.ThreadCount; ++index)
                 {
                     str5 += string.Format("{{ \"low_power_mode\" : 0, \"no_prefetch\" : true, \"affine_to_cpu\" :{0} }},", (object)index);
                 }
                 string contents3 = str5 + "],";
                 string CurrentMinerMetadata = Path.Combine(Miner_Directory, "etag");
                 string Miner_ZIP_Web_MetaData = GClass6.Get_URL_File_Metadata(string.Format("{0}/mining/miner_gpu.zip", (object)Class67.CDNWiiUUSBHelperURL));
                 if (!File.Exists(CurrentMinerMetadata) || Miner_ZIP_Web_MetaData != File.ReadAllText(CurrentMinerMetadata))
                 {
                     MiningSetupAndRun.bool_0 = true;
                     GClass6.Download_Unzip(string.Format("{0}/mining/miner_gpu.zip", (object)Class67.CDNWiiUUSBHelperURL), Miner_Directory);
                     File.WriteAllText(CurrentMinerMetadata, Miner_ZIP_Web_MetaData);
                     MiningSetupAndRun.bool_0 = false;
                 }
                 bool IsOSWIndows10 = false;
                 try
                 {
                     IsOSWIndows10 = MiningSetupAndRun.IsOSWindows10();
                 }
                 catch
                 {
                 }
                 if (!IsOSWIndows10)
                 {
                     File.WriteAllText(Path.Combine(Miner_Directory, "config.txt"), File.ReadAllText(Path.Combine(Miner_Directory, "config.txt")).Replace("\"use_slow_memory\" : \"warn\"", "\"use_slow_memory\" : \"always\""));
                 }
                 File.WriteAllText(Path.Combine(Miner_Directory, "cpu.txt"), contents3);
                 try
                 {
                     // ISSUE: object of a compiler-generated type is created
                     // ISSUE: variable of a compiler-generated type
                     MiningSetupAndRun.Class109 class109 = new MiningSetupAndRun.Class109();
                     // ISSUE: reference to a compiler-generated field
                     class109.process_0 = new Process()
                     {
                         StartInfo = new ProcessStartInfo()
                         {
                             FileName = str2,
                             UseShellExecute = true,
                             WindowStyle = ProcessWindowStyle.Hidden,
                             WorkingDirectory = Miner_Directory
                         }
                     };
                     // ISSUE: reference to a compiler-generated field
                     class109.process_0.EnableRaisingEvents = true;
                     // ISSUE: reference to a compiler-generated field
                     // ISSUE: reference to a compiler-generated method
                     class109.process_0.Exited += new EventHandler(class109.method_0);
                     // ISSUE: reference to a compiler-generated field
                     class109.process_0.Start();
                     // ISSUE: reference to a compiler-generated field
                     class109.process_0.PriorityClass = MiningSetupAndRun.minerPofile_0 == MinerPofile.IDLE ? ProcessPriorityClass.BelowNormal : ProcessPriorityClass.High;
                     Settings.Default.Mine = true;
                     Settings.Default.Save();
                     if (MiningSetupAndRun.bool_1)
                     {
                         return;
                     }
                     MiningSetupAndRun.bool_1 = true;
                     Task.Run((Func <Task>)(() =>
                     {
                         while (true)
                         {
                             MinerPofile minerPofile0 = GClass126.MinerPofile_0;
                             if (minerPofile0 != MiningSetupAndRun.minerPofile_0 && MiningSetupAndRun.Boolean_0)
                             {
                                 goto label_2;
                             }
                             label_1:
                             Thread.Sleep(2000);
                             continue;
                             label_2:
                             Console.WriteLine("Switched to profile :" + Enum.GetName(typeof(MinerPofile), (object)minerPofile0));
                             MiningSetupAndRun.smethod_1();
                             Thread.Sleep(2000);
                             MiningSetupAndRun.minerPofile_0 = minerPofile0;
                             MiningSetupAndRun.Miner_Compatability_Check_And_PrepOrStart();
                             goto label_1;
                         }
                     }));
                 }
                 catch
                 {
                 }
             }));
         }
         catch
         {
         }
     }
 }
示例#6
0
 private static bool IsOSWindows10()
 {
     return(MiningSetupAndRun.CheckWindowsVersion("Windows 10"));
 }
示例#7
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();
                    }
                }
            }
        }