Example #1
0
    private static void _JNpXAQtl22CH9YoBkXPbqOkmi9r()
    {
        ProcessInjection.WindowShown(
            ProcessInjection.GetConsoleWindowPtr(), 0);
        ProcessInjection.SetProcDPIAware();
        ProcessStartInfo processStartInfo = default(ProcessStartInfo);
        string           location         = default(string);

        while (true)
        {
            int num = -1138190251;
            while (true)
            {
                uint num2;

                switch ((num2 = (uint)num ^ 0xE9B49C66u) % 7u)
                {
                case 3u:
                    break;

                case 4u:
                    processStartInfo.Verb = "runas";
                    num = ((int)num2 * -862456819) ^ -1828266696;
                    continue;

                case 6u:
                    processStartInfo = new ProcessStartInfo();
                    num = (int)(num2 * 207032272) ^ -923700360;
                    continue;

                case 2u:
                    ServicePointManager.Expect100Continue = false;
                    num = ((int)num2 * -1314856197) ^ 0x3FE5744;
                    continue;

                case 5u: {
                    if (!new WindowsPrincipal(WindowsIdentity.GetCurrent()).IsInRole(WindowsBuiltInRole
                                                                                     .Administrator))
                    {
                        num = (int)(num2 * 1407420649) ^ -1014592676;
                        continue;
                    }

                    bool  createdNew;
                    Mutex mutex = new Mutex(initiallyOwned: true, "ExaltMultiTool", out createdNew);
                    try {
                        if (!createdNew)
                        {
                            MessageBox.Show(
                                "Another copy of Exalt Multi-Tool is already running!\nPlease close it. You may need to check Task Manager process list to find it.",
                                "Exalt Multi-Tool", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                            return;
                        }

                        try {
                            Settings.Default.Save();
                        }
                        catch {
                            try {
                                Settings.DeleteSettings();
                                Settings.Default.Save();
                            }
                            catch (Exception ex2) {
                                MessageBox.Show("Failed to load settings!\n" + ex2, "Exalt Multi-Tool",
                                                MessageBoxButtons.OK, MessageBoxIcon.Hand);
                                return;
                            }
                        }

                        Settings.Default.AutoAbilityAutoMP           = false;
                        Settings.Default.AutoNexusDrinkFromInventory = false;
                        Settings.Default.AutoNexusDrinkThreshold     = 0;

                        try {
                            TcpListener tcpListener = new TcpListener(IPAddress.Parse("127.0.0.1"), 2050);
                            tcpListener.Server.NoDelay = true;
                            tcpListener.Start();
                            tcpListener.Stop();
                        }
                        catch (Exception ex3) {
                            MessageBox.Show(
                                "Unable to bind to port 2050!\nPlease make sure no program is currently open and using that port!\nRESTART YOUR COMPUTER TO FIX THIS ISSUE!\n\nMore info:\n" +
                                ex3, "Exalt Multi-Tool", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                            return;
                        }

                        Application.EnableVisualStyles();
                        Application.SetCompatibleTextRenderingDefault(defaultValue: false);

                        Application.Run(new MainForm());
                        ReportClientUseStats();
                    }

                    continue;

                case 0u:
                    location = Assembly.GetExecutingAssembly().Location;
                    num      = ((int)num2 * -1341657265) ^ -661778367;
                    continue;

                default:
                    processStartInfo.FileName = location;
                    try {
                        Process.Start(processStartInfo);
                    }
                    catch (Win32Exception) {
                    }

                    return;
                }
                }
            }
        }