예제 #1
0
        public static bool AIOLogin(string AIO)
        {
            if (!Constants.Initialized)
            {
                MessageBox.Show("Please initialize your application first!", OnProgramStart.Name, MessageBoxButtons.OK, MessageBoxIcon.Hand);
                Process.GetCurrentProcess().Kill();
            }
            if (string.IsNullOrWhiteSpace(AIO))
            {
                MessageBox.Show("Missing user login information!", ApplicationSettings.Name, MessageBoxButtons.OK, MessageBoxIcon.Hand);
                Security.End();
                return(false);
            }
            string[] array = new string[0];
            using WebClient webClient = new WebClient();
            try
            {
                Security.Start();
                webClient.Proxy = null;
                array           = Encryption.DecryptService(Encoding.Default.GetString(webClient.UploadValues(Constants.ApiUrl, new NameValueCollection
                {
                    ["token"]       = Encryption.EncryptService(Constants.Token),
                    ["timestamp"]   = Encryption.EncryptService(DateTime.Now.ToString()),
                    ["aid"]         = Encryption.APIService(OnProgramStart.AID),
                    ["session_id"]  = Constants.IV,
                    ["api_id"]      = Constants.APIENCRYPTSALT,
                    ["api_key"]     = Constants.APIENCRYPTKEY,
                    ["username"]    = Encryption.APIService(AIO),
                    ["password"]    = Encryption.APIService(AIO),
                    ["hwid"]        = Encryption.APIService(Constants.HWID()),
                    ["session_key"] = Constants.Key,
                    ["secret"]      = Encryption.APIService(OnProgramStart.Secret),
                    ["type"]        = Encryption.APIService("login")
                }))).Split("|".ToCharArray());
                if (array[0] != Constants.Token)
                {
                    MessageBox.Show("Security error has been triggered!", OnProgramStart.Name, MessageBoxButtons.OK, MessageBoxIcon.Hand);
                    Process.GetCurrentProcess().Kill();
                }
                if (Security.MaliciousCheck(array[1]))
                {
                    MessageBox.Show("Possible malicious activity detected!", OnProgramStart.Name, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    Process.GetCurrentProcess().Kill();
                }
                if (Constants.Breached)
                {
                    MessageBox.Show("Possible malicious activity detected!", OnProgramStart.Name, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    Process.GetCurrentProcess().Kill();
                }
                switch (array[2])
                {
                case "success":
                {
                    Security.End();
                    User.ID           = array[3];
                    User.Username     = array[4];
                    User.Password     = array[5];
                    User.Email        = array[6];
                    User.HWID         = array[7];
                    User.UserVariable = array[8];
                    User.Rank         = array[9];
                    User.IP           = array[10];
                    User.Expiry       = array[11];
                    User.LastLogin    = array[12];
                    User.RegisterDate = array[13];
                    string   text   = array[14];
                    string[] array2 = text.Split('~');
                    foreach (string text2 in array2)
                    {
                        string[] array3 = text2.Split('^');
                        try
                        {
                            App.Variables.Add(array3[0], array3[1]);
                        }
                        catch
                        {
                        }
                    }
                    return(true);
                }

                case "invalid_details":
                    Security.End();
                    return(false);

                case "time_expired":
                    MessageBox.Show("Your subscription has expired!", ApplicationSettings.Name, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    Security.End();
                    return(false);

                case "hwid_updated":
                    MessageBox.Show("New machine has been binded, re-open the application!", ApplicationSettings.Name, MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                    Security.End();
                    return(false);

                case "invalid_hwid":
                    MessageBox.Show("This user is binded to another computer, please contact support!", ApplicationSettings.Name, MessageBoxButtons.OK, MessageBoxIcon.Hand);
                    Security.End();
                    return(false);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, ApplicationSettings.Name, MessageBoxButtons.OK, MessageBoxIcon.Hand);
                Security.End();
                Process.GetCurrentProcess().Kill();
            }
            return(false);
        }
예제 #2
0
        // Token: 0x06000066 RID: 102 RVA: 0x00004160 File Offset: 0x00002360
        public static bool Login(string username, string password)
        {
            if (!Constants.Initialized)
            {
                MessageBox.Show("Please initialize your application first!", OnProgramStart.Name, MessageBoxButtons.OK, MessageBoxIcon.Hand);
                Process.GetCurrentProcess().Kill();
            }
            if (string.IsNullOrWhiteSpace(username) || string.IsNullOrWhiteSpace(password))
            {
                MessageBox.Show("Missing user login information!", ApplicationSettings.Name, MessageBoxButtons.OK, MessageBoxIcon.Hand);
                Security.End();
                return(false);
            }
            string[] array = new string[0];
            bool     result;

            using (WebClient webClient = new WebClient())
            {
                try
                {
                    Security.Start();
                    webClient.Proxy = null;
                    Encoding            @default            = Encoding.Default;
                    WebClient           webClient2          = webClient;
                    string              apiUrl              = Constants.ApiUrl;
                    NameValueCollection nameValueCollection = new NameValueCollection();
                    nameValueCollection["token"]       = Encryption.EncryptService(Constants.Token);
                    nameValueCollection["timestamp"]   = Encryption.EncryptService(DateTime.Now.ToString());
                    nameValueCollection["aid"]         = Encryption.APIService(OnProgramStart.AID);
                    nameValueCollection["session_id"]  = Constants.IV;
                    nameValueCollection["api_id"]      = Constants.APIENCRYPTSALT;
                    nameValueCollection["api_key"]     = Constants.APIENCRYPTKEY;
                    nameValueCollection["username"]    = Encryption.APIService(username);
                    nameValueCollection["password"]    = Encryption.APIService(password);
                    nameValueCollection["hwid"]        = Encryption.APIService(Constants.HWID());
                    nameValueCollection["session_key"] = Constants.Key;
                    nameValueCollection["secret"]      = Encryption.APIService(OnProgramStart.Secret);
                    nameValueCollection["type"]        = Encryption.APIService("login");
                    array = Encryption.DecryptService(@default.GetString(webClient2.UploadValues(apiUrl, nameValueCollection))).Split("|".ToCharArray());
                    if (array[0] != Constants.Token)
                    {
                        MessageBox.Show("Security error has been triggered!", OnProgramStart.Name, MessageBoxButtons.OK, MessageBoxIcon.Hand);
                        Process.GetCurrentProcess().Kill();
                    }
                    if (Security.MaliciousCheck(array[1]))
                    {
                        MessageBox.Show("Possible malicious activity detected!", OnProgramStart.Name, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                        Process.GetCurrentProcess().Kill();
                    }
                    if (Constants.Breached)
                    {
                        MessageBox.Show("Possible malicious activity detected!", OnProgramStart.Name, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                        Process.GetCurrentProcess().Kill();
                    }
                    string text = array[2];
                    if (text != null)
                    {
                        if (text == "success")
                        {
                            User.ID           = array[3];
                            User.Username     = array[4];
                            User.Password     = array[5];
                            User.Email        = array[6];
                            User.HWID         = array[7];
                            User.UserVariable = array[8];
                            User.Rank         = array[9];
                            User.IP           = array[10];
                            User.Expiry       = array[11];
                            User.LastLogin    = array[12];
                            User.RegisterDate = array[13];
                            string text2 = array[14];
                            foreach (string text3 in text2.Split(new char[]
                            {
                                '~'
                            }))
                            {
                                string[] array3 = text3.Split(new char[]
                                {
                                    '^'
                                });
                                try
                                {
                                    App.Variables.Add(array3[0], array3[1]);
                                }
                                catch
                                {
                                }
                            }
                            Security.End();
                            return(true);
                        }
                        if (text == "invalid_details")
                        {
                            MessageBox.Show("Sorry, your username/password does not match!", ApplicationSettings.Name, MessageBoxButtons.OK, MessageBoxIcon.Hand);
                            Security.End();
                            return(false);
                        }
                        if (text == "time_expired")
                        {
                            MessageBox.Show("Your subscription has expired!", ApplicationSettings.Name, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                            Security.End();
                            return(false);
                        }
                        if (text == "hwid_updated")
                        {
                            MessageBox.Show("New machine has been binded, re-open the application!", ApplicationSettings.Name, MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                            Security.End();
                            return(false);
                        }
                        if (text == "invalid_hwid")
                        {
                            MessageBox.Show("This user is binded to another computer, please contact support!", ApplicationSettings.Name, MessageBoxButtons.OK, MessageBoxIcon.Hand);
                            Security.End();
                            return(false);
                        }
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message, ApplicationSettings.Name, MessageBoxButtons.OK, MessageBoxIcon.Hand);
                    Security.End();
                    Process.GetCurrentProcess().Kill();
                }
                result = false;
            }
            return(result);
        }
예제 #3
0
        public static bool Register(string username, string password, string license)
        {
            if (!Constants.Initialized)
            {
                MessageBox.Show("Please initialize your application first!", OnProgramStart.Name, MessageBoxButtons.OK, MessageBoxIcon.Hand);
                Security.End();
                Process.GetCurrentProcess().Kill();
            }
            if (string.IsNullOrWhiteSpace(username) || string.IsNullOrWhiteSpace(password) || string.IsNullOrWhiteSpace(license))
            {
                MessageBox.Show("Invalid registering information!", ApplicationSettings.Name, MessageBoxButtons.OK, MessageBoxIcon.Hand);
                Security.End();
                return(false);
            }
            string[] array = new string[0];
            using WebClient webClient = new WebClient();
            try
            {
                Security.Start();
                webClient.Proxy = null;
                array           = Encryption.DecryptService(Encoding.Default.GetString(webClient.UploadValues(Constants.ApiUrl, new NameValueCollection
                {
                    ["token"]       = Encryption.EncryptService(Constants.Token),
                    ["timestamp"]   = Encryption.EncryptService(DateTime.Now.ToString()),
                    ["aid"]         = Encryption.APIService(OnProgramStart.AID),
                    ["session_id"]  = Constants.IV,
                    ["api_id"]      = Constants.APIENCRYPTSALT,
                    ["api_key"]     = Constants.APIENCRYPTKEY,
                    ["session_key"] = Constants.Key,
                    ["secret"]      = Encryption.APIService(OnProgramStart.Secret),
                    ["type"]        = Encryption.APIService("register"),
                    ["username"]    = Encryption.APIService(username),
                    ["password"]    = Encryption.APIService(password),
                    ["email"]       = Encryption.APIService(username),
                    ["license"]     = Encryption.APIService(license),
                    ["hwid"]        = Encryption.APIService(Constants.HWID())
                }))).Split("|".ToCharArray());
                if (array[0] != Constants.Token)
                {
                    MessageBox.Show("Security error has been triggered!", OnProgramStart.Name, MessageBoxButtons.OK, MessageBoxIcon.Hand);
                    Security.End();
                    Process.GetCurrentProcess().Kill();
                }
                if (Security.MaliciousCheck(array[1]))
                {
                    MessageBox.Show("Possible malicious activity detected!", OnProgramStart.Name, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    Process.GetCurrentProcess().Kill();
                }
                if (Constants.Breached)
                {
                    MessageBox.Show("Possible malicious activity detected!", OnProgramStart.Name, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    Process.GetCurrentProcess().Kill();
                }
                switch (array[2])
                {
                case "success":
                    Security.End();
                    return(true);

                case "invalid_license":
                    MessageBox.Show("License does not exist!", ApplicationSettings.Name, MessageBoxButtons.OK, MessageBoxIcon.Hand);
                    Security.End();
                    return(false);

                case "email_used":
                    MessageBox.Show("You entered an invalid/used username!", ApplicationSettings.Name, MessageBoxButtons.OK, MessageBoxIcon.Hand);
                    Security.End();
                    return(false);

                case "invalid_username":
                    MessageBox.Show("You entered an invalid/used username!", ApplicationSettings.Name, MessageBoxButtons.OK, MessageBoxIcon.Hand);
                    Security.End();
                    return(false);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, ApplicationSettings.Name, MessageBoxButtons.OK, MessageBoxIcon.Hand);
                Process.GetCurrentProcess().Kill();
            }
            return(false);
        }
예제 #4
0
        // Token: 0x06000065 RID: 101 RVA: 0x00003E9C File Offset: 0x0000209C
        public static bool AIORegister(string AIO)
        {
            if (!Constants.Initialized)
            {
                MessageBox.Show("Please initialize your application first!", OnProgramStart.Name, MessageBoxButtons.OK, MessageBoxIcon.Hand);
                Security.End();
                Process.GetCurrentProcess().Kill();
            }
            if (string.IsNullOrWhiteSpace(AIO))
            {
                MessageBox.Show("Invalid registering information!", ApplicationSettings.Name, MessageBoxButtons.OK, MessageBoxIcon.Hand);
                Security.End();
                return(false);
            }
            string[] array = new string[0];
            bool     result;

            using (WebClient webClient = new WebClient())
            {
                try
                {
                    Security.Start();
                    webClient.Proxy = null;
                    Encoding            @default            = Encoding.Default;
                    WebClient           webClient2          = webClient;
                    string              apiUrl              = Constants.ApiUrl;
                    NameValueCollection nameValueCollection = new NameValueCollection();
                    nameValueCollection["token"]       = Encryption.EncryptService(Constants.Token);
                    nameValueCollection["timestamp"]   = Encryption.EncryptService(DateTime.Now.ToString());
                    nameValueCollection["aid"]         = Encryption.APIService(OnProgramStart.AID);
                    nameValueCollection["session_id"]  = Constants.IV;
                    nameValueCollection["api_id"]      = Constants.APIENCRYPTSALT;
                    nameValueCollection["api_key"]     = Constants.APIENCRYPTKEY;
                    nameValueCollection["session_key"] = Constants.Key;
                    nameValueCollection["secret"]      = Encryption.APIService(OnProgramStart.Secret);
                    nameValueCollection["type"]        = Encryption.APIService("register");
                    nameValueCollection["username"]    = Encryption.APIService(AIO);
                    nameValueCollection["password"]    = Encryption.APIService(AIO);
                    nameValueCollection["email"]       = Encryption.APIService(AIO);
                    nameValueCollection["license"]     = Encryption.APIService(AIO);
                    nameValueCollection["hwid"]        = Encryption.APIService(Constants.HWID());
                    array = Encryption.DecryptService(@default.GetString(webClient2.UploadValues(apiUrl, nameValueCollection))).Split("|".ToCharArray());
                    if (array[0] != Constants.Token)
                    {
                        MessageBox.Show("Security error has been triggered!", OnProgramStart.Name, MessageBoxButtons.OK, MessageBoxIcon.Hand);
                        Security.End();
                        Process.GetCurrentProcess().Kill();
                    }
                    if (Security.MaliciousCheck(array[1]))
                    {
                        MessageBox.Show("Possible malicious activity detected!", OnProgramStart.Name, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                        Process.GetCurrentProcess().Kill();
                    }
                    if (Constants.Breached)
                    {
                        MessageBox.Show("Possible malicious activity detected!", OnProgramStart.Name, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                        Process.GetCurrentProcess().Kill();
                    }
                    Security.End();
                    string text = array[2];
                    if (text != null)
                    {
                        if (text == "success")
                        {
                            return(true);
                        }
                        if (text == "error")
                        {
                            return(false);
                        }
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message, ApplicationSettings.Name, MessageBoxButtons.OK, MessageBoxIcon.Hand);
                    Process.GetCurrentProcess().Kill();
                }
                result = false;
            }
            return(result);
        }