예제 #1
0
    public static void Fill(string module)
    {
        key = Checksum.ARChecksum;
        NameValueCollection nameValueCollection = new NameValueCollection();

        nameValueCollection["key"]    = key;
        nameValueCollection["config"] = module;
        NOSRequest.NOSRequest nOSRequest = new NOSRequest.NOSRequest(Var.encryptionKey);
        Response response = nOSRequest.Request(Var.authUrl + "/api/responder.php", nameValueCollection);
        string   message  = response.message;

        if (message.Contains("Invalid key"))
        {
            if (UpdateCheck.GetLastVersion() != Var.currentVersion)
            {
                UpdateCheck.Update();
                return;
            }
            Console.WriteLine("Modifications detected...");
            Thread.Sleep(5000);
            Process.GetCurrentProcess().Kill();
        }
        else if (message.Contains("|"))
        {
            urlArray = message.Split('|');
        }
        else
        {
            urlString = message;
        }
    }
예제 #2
0
        // Token: 0x06000051 RID: 81 RVA: 0x00006D0C File Offset: 0x00004F0C
        public Response Request(string url, NameValueCollection values = null)
        {
            Response response = new Response(this.encryption);

            try
            {
                WebClient client = this.GetClient();
                if (values == null)
                {
                    values = new NameValueCollection();
                }
                Dictionary <string, object> dictionary = NOSRequest.GetDictionary(values);
                if (dictionary.ContainsKey("authentication_key"))
                {
                    throw new Exception("Key \"authentication_key\" must not be defined.");
                }
                dictionary.Add("authentication_key", response.EncryptedAuth());
                string plainText  = JsonConvert.SerializeObject(dictionary);
                string data       = this.encryption.EncryptString(plainText);
                string cipherText = client.UploadString(url, data);
                string raw        = this.encryption.DecryptString(cipherText);
                response.Initialize(raw);
            }
            catch (Exception ex)
            {
                response.status  = false;
                response.message = ex.Message;
            }
            return(response);
        }
예제 #3
0
    public static bool Login(string user, string pass, Color color)
    {
        NameValueCollection values = new NameValueCollection
        {
            ["username"] = user,
            ["password"] = pass,
            ["hwid"]     = HWID.Value()
        };

        NOSRequest.NOSRequest nOSRequest = new NOSRequest.NOSRequest(Var.encryptionKey);
        Response response = nOSRequest.Request(Var.authUrl + "/api/login_api.php", values);
        string   message  = response.message;

        if (message.Contains("Login Successful"))
        {
            RDesign.TimeText("You have logged in successfully! Welcome, " + user + ".", color);
            Thread.Sleep(2000);
            Var.loggedIn = true;
            return(true);
        }
        if (message.Contains("Invalid HWID"))
        {
            RDesign.TimeText("Your HWID, " + HWID.Value() + ", is invalid!", color);
            Thread.Sleep(2000);
            return(false);
        }
        if (message.Contains("Invalid Credentials"))
        {
            RDesign.TimeText("Your credentials are invalid!", color);
            Thread.Sleep(1000);
            return(false);
        }
        if (message.Contains("Subscription expired on"))
        {
            RDesign.TimeText("Your license has expired!", color);
            Thread.Sleep(1000);
            return(false);
        }
        RDesign.TimeText(message, color);
        Thread.Sleep(5000);
        return(false);
    }