diff --git a/.vs/DiceBot/v15/.suo b/.vs/DiceBot/v15/.suo index c5d9cb08..eb5631ac 100644 Binary files a/.vs/DiceBot/v15/.suo and b/.vs/DiceBot/v15/.suo differ diff --git a/DiceBot/Bitvest.cs b/DiceBot/Bitvest.cs index 96943a85..8fc3f17f 100644 --- a/DiceBot/Bitvest.cs +++ b/DiceBot/Bitvest.cs @@ -53,7 +53,7 @@ string RandomSeed() { string s = ""; string chars = "0123456789abcdef"; - while (s.Length<20) + while (s.Length<60) { s += chars[R.Next(0, chars.Length)]; } @@ -381,6 +381,7 @@ public override void Login(string Username, string Password, string otp) Parent.updateLosses(losses); //Parent.updateDeposit(tmpblogin.account.address); lastupdate = DateTime.Now; + seed = tmpblogin.last_user_seed; ispd = true; pw = Password; new Thread(new ThreadStart(GetBalanceThread)).Start(); @@ -550,20 +551,20 @@ public override void SetClientSeed(string Seed) public override bool ReadyToBet() { decimal weight = 1; - switch (Currency.ToLower()) + if (Currency.ToLower() == "bitcoins") { - case "bitcoins":weight = decimal.Parse(Weights.BTC, System.Globalization.NumberFormatInfo.InvariantInfo);break; - case "tokens": weight = decimal.Parse(Weights.TOK, System.Globalization.NumberFormatInfo.InvariantInfo); break; - case "litecoins": weight = decimal.Parse(Weights.LTC, System.Globalization.NumberFormatInfo.InvariantInfo); break; - case "ethers": weight = decimal.Parse(Weights.ETH, System.Globalization.NumberFormatInfo.InvariantInfo); break; - case "dogecoins": weight = decimal.Parse(Weights.DOGE, System.Globalization.NumberFormatInfo.InvariantInfo); break; - case "bcash": weight = decimal.Parse(Weights.BCH, System.Globalization.NumberFormatInfo.InvariantInfo); break; - - default: weight = decimal.Parse(Weights.BTC, System.Globalization.NumberFormatInfo.InvariantInfo); break; + switch (Currency.ToLower()) + { + case "bitcoins": weight = decimal.Parse(Weights.BTC, System.Globalization.NumberFormatInfo.InvariantInfo); break; + case "tokens": weight = decimal.Parse(Weights.TOK, System.Globalization.NumberFormatInfo.InvariantInfo); break; + case "litecoins": weight = decimal.Parse(Weights.LTC, System.Globalization.NumberFormatInfo.InvariantInfo); break; + case "ethers": weight = decimal.Parse(Weights.ETH, System.Globalization.NumberFormatInfo.InvariantInfo); break; + case "dogecoins": weight = decimal.Parse(Weights.DOGE, System.Globalization.NumberFormatInfo.InvariantInfo); break; + case "bcash": weight = decimal.Parse(Weights.BCH, System.Globalization.NumberFormatInfo.InvariantInfo); break; + + default: weight = decimal.Parse(Weights.BTC, System.Globalization.NumberFormatInfo.InvariantInfo); break; + } } - - - for (int i = Limits.Length-1; i>=0;i--) { if (i == Limits.Length-1 && (amount*weight)>=(decimal)Limits[i]*0.00000001m) @@ -762,6 +763,7 @@ public class bitvestLoginBase public bitvesttip tip { get; set; } public bitvestCurWeight currency_weight { get; set; } public double[] rate_limits { get; set; } + public string last_user_seed { get; set; } } public class bitvestCurWeight { diff --git a/DiceBot/Cloudflare.cs b/DiceBot/Cloudflare.cs index ca02de20..38814634 100644 --- a/DiceBot/Cloudflare.cs +++ b/DiceBot/Cloudflare.cs @@ -19,7 +19,12 @@ public static bool doCFThing(string Response, HttpClient Client, HttpClientHandl string s1 = Response;//new StreamReader(Response.GetResponseStream()).ReadToEnd(); string Script = ""; + string jschl_tk = s1.Substring(s1.IndexOf("cf_chl_jschl_tk__=")+ "cf_chl_jschl_tk__=".Length); + jschl_tk = jschl_tk.Substring(0, jschl_tk.IndexOf("\"")); + string r = s1.Substring(s1.IndexOf("name=\"r\" value=\"")+ "name=\"r\" value=\"".Length); + r = r.Substring(0, r.IndexOf("\"")); string jschl_vc = s1.Substring(s1.IndexOf("jschl_vc")); + jschl_vc = jschl_vc.Substring(jschl_vc.IndexOf("value=\"") + "value=\"".Length); jschl_vc = jschl_vc.Substring(0, jschl_vc.IndexOf("\"")); string pass = s1.Substring(s1.IndexOf("\"pass\"")); @@ -27,10 +32,19 @@ public static bool doCFThing(string Response, HttpClient Client, HttpClientHandl pass = pass.Substring(0, pass.IndexOf("\"")); //do the CF bypass thing and get the headers - Script = s1.Substring(s1.IndexOf("var s,t,o,p,b,r,e,a,k,i,n,g,f,") + "var s,t,o,p,b,r,e,a,k,i,n,g,f, ".Length); - string Script1 = "var " + Script.Substring(0, Script.IndexOf(";") + 1); + Script = s1.Substring(s1.IndexOf("var s,t,o,p,b,r,e,a,k,i,n,g,f,")); + string Script1 = Script.Substring(0, Script.IndexOf(";") + 1); + Script = Script.Substring("var s,t,o,p,b,r,e,a,k,i,n,g,f, ".Length); string varName = Script.Substring(0, Script.IndexOf("=")); string varNamep2 = Script.Substring(Script.IndexOf("\"") + 1); + string Script3 = Script.Substring(Script.IndexOf(";") + 1); + Script3 = Script3.Substring(0, Script3.IndexOf("t = document")); + Script1 += Script3; + string kkkk = Script.Substring(Script.IndexOf("k = '")+ "k = '".Length); + kkkk = kkkk.Substring(0, kkkk.IndexOf("';")); + string kvalue = s1.Substring(s1.IndexOf($"id=\"{kkkk}\">")+ $"id=\"{kkkk}\">".Length); + kvalue = "var innr = " + kvalue.Substring(0, kvalue.IndexOf("<"))+";"; + Script1 += kvalue; varName += "." + varNamep2.Substring(0, varNamep2.IndexOf("\"")); Script1 += Script.Substring(Script.IndexOf(varName)); Script1 = Script1.Substring(0, Script1.IndexOf("f.submit()")); @@ -38,12 +52,31 @@ public static bool doCFThing(string Response, HttpClient Client, HttpClientHandl Script1 = Script1.Replace("a.value", "var answer"); if (Script1.Contains("f.action += location.hash;")|| Script1.Contains("f.action+=location.hash;")) Script1 = Script1.Replace("f.action += location.hash;", "").Replace("f.action+=location.hash;", ""); + Script1 = Script1.Replace("(function(p){return eval((true+\"\")[0]+\".ch\"+(false+\"\")[1]+(true+\"\")[1]+Function(\"return escape\")()((\"\")[\"italics\"]())[2]+\"o\"+(undefined+\"\")[2]+(true+\"\")[3]+\"A\"+(true+\"\")[0]+\"(\"+p+\")\")}",$"(function(p){{ return eval(\"{URI}\".charCodeAt(p)) }}"); + Script1 = Script1.Replace("function(p){var p = eval(eval(e(\"ZG9jdW1l\")+(undefined+\"\")[1]+(true+\"\")[0]+(+(+!+[]+[+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+[!+[]+!+[]]+[+[]])+[])[+!+[]]+g(103)+(true+\"\")[3]+(true+\"\")[0]+\"Element\"+g(66)+(NaN+[Infinity])[10]+\"Id(\"+g(107)+\").\"+e(\"aW5uZXJIVE1M\"))); return +(p)}();", + "function(p){var p = eval(eval(innr));return +(p)}();"); + + JSC.Run(Script1); string answer = JSC.GetParameter("answer").ToString(); try { - HttpResponseMessage Resp = Client.GetAsync("cdn-cgi/l/chk_jschl?jschl_vc=" + jschl_vc + "&pass=" + pass.Replace("+", "%2B").Replace("-", "%2D") + "&jschl_answer=" + answer).Result; + List> pairs = new List>(); + pairs.Add(new KeyValuePair("r", r)); + pairs.Add(new KeyValuePair("jschl_vc", jschl_vc)); + pairs.Add(new KeyValuePair("pass",pass )); + pairs.Add(new KeyValuePair("jschl_answer",answer )); + FormUrlEncodedContent Content = new FormUrlEncodedContent(pairs); + string url = $"https://{URI}/?__cf_chl_jschl_tk__={jschl_tk}"; + Content.Headers.Add("Origin", "https://wolf.bet"); + //Content.Headers.Add("Referer", "https://wolf.bet/"); + Content.Headers.Add("sec-fetch-mode", "navigate"); + Content.Headers.Add("sec-fetch-site", "same-origin"); + //Content.Headers.Add("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9"); + Content.Headers.Remove("content-type"); + Content.Headers.Add("content-type", "application/x-www-form-urlencoded"); + HttpResponseMessage Resp = Client.PostAsync(url, Content).Result; bool Found = false; diff --git a/DiceBot/DiceSite.cs b/DiceBot/DiceSite.cs index f729f2ab..c0b0be33 100644 --- a/DiceBot/DiceSite.cs +++ b/DiceBot/DiceSite.cs @@ -333,4 +333,47 @@ public class RequireCaptchaEventArgs:EventArgs public string ResponseValue { get; set; } public string Domain { get; set; } } + + public class Random + { + RandomNumberGenerator r = RandomNumberGenerator.Create(); + const string chars = "QWERTYUIOPASDFGHJKLZXCVBNMqwertyuiopasdfghjklzxcvbnm"; + public virtual uint Next(uint max) + { + byte[] bytes = new byte[4]; + r.GetBytes(bytes); + uint result = BitConverter.ToUInt32(bytes, 0); + return (result % max); + } + public virtual uint Next(uint min, uint max) + { + uint result = Next(max-min); + return (min+result); + } + public virtual int Next(int min, int max) + { + return min + Next(max - min); + } + public virtual int Next(int max) + { + byte[] bytes = new byte[4]; + r.GetBytes(bytes); + int result = BitConverter.ToInt32(bytes, 0); + return (Math.Abs(result % max)); + } + public virtual int Next() + { + + return Next(int.MaxValue); + } + public string RandomString(int length) + { + string x = ""; + while(x.Length>0) + { + x += chars[Next(0, chars.Length)]; + } + return x; + } + } } diff --git a/DiceBot/NitroDice.cs b/DiceBot/NitroDice.cs index 5ab79854..a2709782 100644 --- a/DiceBot/NitroDice.cs +++ b/DiceBot/NitroDice.cs @@ -207,7 +207,7 @@ protected override void internalPlaceBet(bool High, decimal amount, decimal chan this.High = High; new Thread(new ParameterizedThreadStart(placebetthread)).Start(new PlaceBetObj(High, amount, chance, BetGuid)); } - + long nonce = -1; public static new decimal sGetLucky(string server, string client, long nonce) { SHA512 betgenerator = SHA512.Create(); @@ -259,7 +259,13 @@ public static new decimal sGetLucky(string server, string client, long nonce) string hexres = ""; for (int i =0; i(Response); + + if (BetResult.info == null) { + if (nonce == -1) + nonce = BetResult.index; + else if (nonce != BetResult.index - 1) + { + Parent.DumpLog("123 NONCE SKIPPED!!!!!! 12345!!!!", -1); + } + nonce = BetResult.index; Bet tmp = new Bet { Amount = amount, @@ -309,7 +325,7 @@ void placebetthread(object bet) serverhash = lastHash, Guid = tmp5.Guid, high = High, - Id = BetResult.n.ToString(), + Id = BetResult.no.ToString(), nonce = BetResult.index, Roll = BetResult.n / 10000m, serverseed = BetResult.sseed, diff --git a/DiceBot/PD.cs b/DiceBot/PD.cs index b43791ed..253698a3 100644 --- a/DiceBot/PD.cs +++ b/DiceBot/PD.cs @@ -21,7 +21,7 @@ public class PD : DiceSite protected string RolName = "primediceRoll"; protected string GameName = "CasinoGamePrimedice"; protected string StatGameName = "primedice"; - public static string[] sCurrencies = new string[] { "Btc", "Ltc","Eth","Doge","Bch", "XRP" }; + public static string[] sCurrencies = new string[] { "Btc", "Ltc","Eth","Doge","Bch", "XRP","TRX" }; GraphQL.Client.GraphQLClient GQLClient; string accesstoken = ""; DateTime LastSeedReset = new DateTime(); @@ -52,6 +52,7 @@ public PD(cDiceBot Parent) SiteURL = "https://primedice.com/?c=Seuntjie"; if (File.Exists("fast") || File.Exists("fast.txt")) getid = false; + } string userid = ""; diff --git a/DiceBot/Properties/AssemblyInfo.cs b/DiceBot/Properties/AssemblyInfo.cs index c34d18ef..dfe5cf6e 100644 --- a/DiceBot/Properties/AssemblyInfo.cs +++ b/DiceBot/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("3.4.4.0")] -[assembly: AssemblyFileVersion("3.4.4.0")] +[assembly: AssemblyVersion("3.4.6.0")] +[assembly: AssemblyFileVersion("3.4.6.0")] diff --git a/DiceBot/Stake.cs b/DiceBot/Stake.cs index a977a445..bb0d363b 100644 --- a/DiceBot/Stake.cs +++ b/DiceBot/Stake.cs @@ -13,7 +13,7 @@ namespace DiceBot class Stake: PD { - public static new string[] sCurrencies = new string[] { "Btc", "Eth", "Ltc","Doge", "Bch","Xrp" }; + public static new string[] sCurrencies = new string[] { "Btc", "Eth", "Ltc","Doge", "Bch","Xrp","Trx" }; public Stake(cDiceBot Parent):base(Parent)/*:base(Parent)*/ { diff --git a/DiceBot/WolfBet.cs b/DiceBot/WolfBet.cs index ddabdffd..f016ef99 100644 --- a/DiceBot/WolfBet.cs +++ b/DiceBot/WolfBet.cs @@ -18,7 +18,7 @@ class WolfBet : DiceSite string accesstoken = ""; public bool ispd = false; DateTime lastupdate = new DateTime(); - HttpClient Client;// = new HttpClient { BaseAddress = new Uri("https://api.primedice.com/api/") }; + HttpClient Client; HttpClientHandler ClientHandlr; public static string[] cCurrencies = new string[] { "btc", "eth", "ltc", "trx", "bch","doge" }; string URL = "https://wolf.bet"; @@ -74,9 +74,41 @@ public override void Login(string Username, string Password, string twofa) Client = new HttpClient(ClientHandlr) { BaseAddress = new Uri(URL+"/api/v1/") }; Client.DefaultRequestHeaders.AcceptEncoding.Add(new System.Net.Http.Headers.StringWithQualityHeaderValue("gzip")); Client.DefaultRequestHeaders.AcceptEncoding.Add(new System.Net.Http.Headers.StringWithQualityHeaderValue("deflate")); - Client.DefaultRequestHeaders.Add("UserAgent", Parent.UserAgent); + Client.DefaultRequestHeaders.Add("UserAgent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36"); + Client.DefaultRequestHeaders.Add("Origin", "https://wolf.bet"); + Client.DefaultRequestHeaders.Add("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9"); try { + + HttpResponseMessage resp1 = Client.GetAsync("").Result; + string s1 = ""; + if (resp1.IsSuccessStatusCode) + { + s1 = resp1.Content.ReadAsStringAsync().Result; + //Parent.DumpLog("BE login 2.1", 7); + } + else + { + //Parent.DumpLog("BE login 2.2", 7); + if (resp1.StatusCode == HttpStatusCode.ServiceUnavailable) + { + s1 = resp1.Content.ReadAsStringAsync().Result; + //cflevel = 0; + System.Threading.Tasks.Task.Factory.StartNew(() => + { + System.Windows.Forms.MessageBox.Show($"{Name} has their cloudflare protection on HIGH\n\nThis will cause a slight delay in logging in. Please allow up to a minute."); + }); + if (!Cloudflare.doCFThing(s1, Client, ClientHandlr, 0, URL.Replace("https://",""))) + { + + finishedlogin(false); + return; + } + + } + //Parent.DumpLog("BE login 2.3", 7); + } + Client.DefaultRequestHeaders.Add("X-Requested-With", "XMLHttpRequest"); string mfa = twofa==""?"": $",\"code\":\"{twofa}\""; string LoginString = $"{{\"login\":\"{Username}\",\"password\":\"{Password}\"{mfa}}}"; HttpContent cont = new StringContent(LoginString); @@ -265,7 +297,7 @@ private void placebetthread(object obj) PlaceBetObj tmp5 = obj as PlaceBetObj; WolfPlaceBet tmp = new WolfPlaceBet { - amount = tmp5.Amount.ToString(System.Globalization.NumberFormatInfo.InvariantInfo), + amount = tmp5.Amount.ToString("0.00000000",System.Globalization.NumberFormatInfo.InvariantInfo), currency = Currency, rule = tmp5.High ? "over" : "under", multiplier = ((100m - edge) / tmp5.Chance).ToString("0.####",System.Globalization.NumberFormatInfo.InvariantInfo), @@ -290,7 +322,7 @@ private void placebetthread(object obj) Bet tmpRsult = new Bet() { Amount = decimal.Parse(result.bet.amount, System.Globalization.NumberFormatInfo.InvariantInfo), - Chance = (100m - edge) / (decimal.Parse(result.bet.multiplier, System.Globalization.NumberFormatInfo.InvariantInfo)), + Chance = decimal.Parse(result.bet.bet_value, System.Globalization.NumberFormatInfo.InvariantInfo), clientseed = result.bet.user_seed, date = DateTime.Now, Currency = Currency,