コード例 #1
0
        /// <inheritdoc />
        public override void Process(BotData data)
        {
            if (!data.GlobalSettings.Captchas.BypassBalanceCheck)
            {
                base.Process(data);
            }

            data.Log(new LogEntry("Solving reCaptcha...", Colors.White));

            string recapResponse = "";

            CaptchaServices.CaptchaService service = null;

            switch (data.GlobalSettings.Captchas.CurrentService)
            {
            case CaptchaService.ImageTypers:
                service = new ImageTyperz(data.GlobalSettings.Captchas.ImageTypToken, data.GlobalSettings.Captchas.Timeout);
                break;

            case CaptchaService.AntiCaptcha:
                service = new AntiCaptcha(data.GlobalSettings.Captchas.AntiCapToken, data.GlobalSettings.Captchas.Timeout);
                break;

            case CaptchaService.DBC:
                service = new DeathByCaptcha(data.GlobalSettings.Captchas.DBCUser, data.GlobalSettings.Captchas.DBCPass, data.GlobalSettings.Captchas.Timeout);
                break;

            case CaptchaService.TwoCaptcha:
                service = new TwoCaptcha(data.GlobalSettings.Captchas.TwoCapToken, data.GlobalSettings.Captchas.Timeout);
                break;

            case CaptchaService.DeCaptcher:
                service = new DeCaptcher(data.GlobalSettings.Captchas.DCUser, data.GlobalSettings.Captchas.DCPass, data.GlobalSettings.Captchas.Timeout);
                break;

            case CaptchaService.AZCaptcha:
                service = new AZCaptcha(data.GlobalSettings.Captchas.AZCapToken, data.GlobalSettings.Captchas.Timeout);
                break;

            case CaptchaService.SolveRecaptcha:
                service = new SolveReCaptcha(data.GlobalSettings.Captchas.SRUserId, data.GlobalSettings.Captchas.SRToken, data.GlobalSettings.Captchas.Timeout);
                break;

            case CaptchaService.CaptchasIO:
                service = new CaptchasIO(data.GlobalSettings.Captchas.CIOToken, data.GlobalSettings.Captchas.Timeout);
                break;

            default:
                throw new Exception("This service cannot solve reCaptchas!");
            }
            recapResponse = service.SolveRecaptcha(siteKey, ReplaceValues(url, data));

            data.Log(recapResponse == "" ? new LogEntry("Couldn't get a reCaptcha response from the service", Colors.Tomato) : new LogEntry("Succesfully got the response: " + recapResponse, Colors.GreenYellow));
            if (VariableName != "")
            {
                data.Log(new LogEntry("Response stored in variable: " + variableName, Colors.White));
                data.Variables.Set(new CVar(variableName, recapResponse));
            }
        }
コード例 #2
0
        private void checkBalanceButton_Click(object sender, RoutedEventArgs e)
        {
            // Save
            IOManager.SaveSettings(Globals.rlSettingsFile, Globals.rlSettings);

            double balance = 0;

            try
            {
                switch (Globals.rlSettings.Captchas.CurrentService)
                {
                case BlockCaptcha.CaptchaService.AntiCaptcha:
                    balance = new AntiCaptcha(Globals.rlSettings.Captchas.AntiCapToken, 0).GetBalance();
                    break;

                case BlockCaptcha.CaptchaService.DBC:
                    balance = new DeathByCaptcha(Globals.rlSettings.Captchas.DBCUser, Globals.rlSettings.Captchas.DBCPass, 0).GetBalance();
                    break;

                case BlockCaptcha.CaptchaService.DeCaptcher:
                    balance = new DeCaptcher(Globals.rlSettings.Captchas.DCUser, Globals.rlSettings.Captchas.DCPass, 0).GetBalance();
                    break;

                case BlockCaptcha.CaptchaService.ImageTypers:
                    balance = new ImageTyperz(Globals.rlSettings.Captchas.ImageTypToken, 0).GetBalance();
                    break;

                case BlockCaptcha.CaptchaService.TwoCaptcha:
                    balance = new TwoCaptcha(Globals.rlSettings.Captchas.TwoCapToken, 0).GetBalance();
                    break;

                case BlockCaptcha.CaptchaService.RuCaptcha:
                    balance = new RuCaptcha(Globals.rlSettings.Captchas.RuCapToken, 0).GetBalance();
                    break;

                case BlockCaptcha.CaptchaService.AZCaptcha:
                    balance = new AZCaptcha(Globals.rlSettings.Captchas.AZCapToken, 0).GetBalance();
                    break;

                case BlockCaptcha.CaptchaService.SolveRecaptcha:
                    balance = new SolveReCaptcha(Globals.rlSettings.Captchas.SRUserId, Globals.rlSettings.Captchas.SRToken, 0).GetBalance();
                    break;

                case BlockCaptcha.CaptchaService.CaptchasIO:
                    balance = new CaptchasIO(Globals.rlSettings.Captchas.CIOToken, 0).GetBalance();
                    break;

                default:
                    balance = 999;
                    break;
                }
            }
            catch { balanceLabel.Content = "WRONG TOKEN / CREDENTIALS"; balanceLabel.Foreground = Globals.GetBrush("ForegroundBad"); return; }

            balanceLabel.Content    = balance;
            balanceLabel.Foreground = balance > 0 ? Globals.GetBrush("ForegroundGood") : Globals.GetBrush("ForegroundBad");
        }
コード例 #3
0
        /// <inheritdoc />
        public override void Process(BotData data)
        {
            if (!data.GlobalSettings.Captchas.BypassBalanceCheck)
            {
                base.Process(data);
            }

            var localUrl = ReplaceValues(url, data);

            data.Log(new LogEntry("Downloading image...", Colors.White));

            // Download captcha
            var captchaFile = string.Format("Captchas/captcha{0}.jpg", data.BotNumber);

            if (base64)
            {
                var bytes = Convert.FromBase64String(localUrl);
                using (var imageFile = new FileStream(captchaFile, FileMode.Create))
                {
                    imageFile.Write(bytes, 0, bytes.Length);
                    imageFile.Flush();
                }
            }
            else if (sendScreenshot && data.Screenshots.Count > 0)
            {
                Bitmap image = new Bitmap(data.Screenshots.Last());
                image.Save(captchaFile);
            }
            else
            {
                try
                {
                    DownloadRemoteImageFile(captchaFile, data, localUrl);
                }
                catch (Exception ex) { data.Log(new LogEntry(ex.Message, Colors.Tomato)); throw; }
            }

            string response = "";

            CaptchaServices.CaptchaService service = null;
            var bitmap = new Bitmap(captchaFile);

            try
            {
                switch (data.GlobalSettings.Captchas.CurrentService)
                {
                case CaptchaService.ImageTypers:
                    service = new ImageTyperz(data.GlobalSettings.Captchas.ImageTypToken, data.GlobalSettings.Captchas.Timeout);
                    break;

                case CaptchaService.AntiCaptcha:
                    service = new AntiCaptcha(data.GlobalSettings.Captchas.AntiCapToken, data.GlobalSettings.Captchas.Timeout);
                    break;

                case CaptchaService.DBC:
                    service = new DeathByCaptcha(data.GlobalSettings.Captchas.DBCUser, data.GlobalSettings.Captchas.DBCPass, data.GlobalSettings.Captchas.Timeout);
                    break;

                case CaptchaService.TwoCaptcha:
                    service = new TwoCaptcha(data.GlobalSettings.Captchas.TwoCapToken, data.GlobalSettings.Captchas.Timeout);
                    break;

                case CaptchaService.RuCaptcha:
                    service = new RuCaptcha(data.GlobalSettings.Captchas.RuCapToken, data.GlobalSettings.Captchas.Timeout);
                    break;

                case CaptchaService.DeCaptcher:
                    service = new DeCaptcher(data.GlobalSettings.Captchas.DCUser, data.GlobalSettings.Captchas.DCPass, data.GlobalSettings.Captchas.Timeout);
                    break;

                case CaptchaService.AZCaptcha:
                    service = new AZCaptcha(data.GlobalSettings.Captchas.AZCapToken, data.GlobalSettings.Captchas.Timeout);
                    break;

                case CaptchaService.CaptchasIO:
                    service = new CaptchasIO(data.GlobalSettings.Captchas.CIOToken, data.GlobalSettings.Captchas.Timeout);
                    break;

                default:
                    throw new Exception("This service cannot solve normal captchas!");
                }
                response = service.SolveCaptcha(bitmap);
            }
            catch (Exception ex) { data.Log(new LogEntry(ex.Message, Colors.Tomato)); throw; }
            finally { bitmap.Dispose(); }

            data.CaptchaService = service;
            data.Log(response == "" ? new LogEntry("Couldn't get a response from the service", Colors.Tomato) : new LogEntry("Succesfully got the response: " + response, Colors.GreenYellow));

            if (VariableName != "")
            {
                data.Log(new LogEntry("Response stored in variable: " + variableName, Colors.White));
                data.Variables.Set(new CVar(variableName, response));
            }
        }