diff --git a/scr/SCMBot/Dialog.Designer.cs b/scr/SCMBot/Dialog.Designer.cs index fbefca7..54e8358 100644 --- a/scr/SCMBot/Dialog.Designer.cs +++ b/scr/SCMBot/Dialog.Designer.cs @@ -31,17 +31,21 @@ private void InitializeComponent() System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Dialog)); this.okButton = new System.Windows.Forms.Button(); this.codgroupBox = new System.Windows.Forms.GroupBox(); - this.capchgroupBox = new System.Windows.Forms.GroupBox(); - this.label3 = new System.Windows.Forms.Label(); - this.capchaBox = new System.Windows.Forms.TextBox(); - this.capchapicBox = new System.Windows.Forms.PictureBox(); this.label2 = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label(); this.guardBox = new System.Windows.Forms.TextBox(); this.mailcodeBox = new System.Windows.Forms.TextBox(); + this.capchgroupBox = new System.Windows.Forms.GroupBox(); + this.label3 = new System.Windows.Forms.Label(); + this.capchaBox = new System.Windows.Forms.TextBox(); + this.capchapicBox = new System.Windows.Forms.PictureBox(); + this.twoFactorGroup = new System.Windows.Forms.GroupBox(); + this.label5 = new System.Windows.Forms.Label(); + this.factorTextBox = new System.Windows.Forms.TextBox(); this.codgroupBox.SuspendLayout(); this.capchgroupBox.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.capchapicBox)).BeginInit(); + this.twoFactorGroup.SuspendLayout(); this.SuspendLayout(); // // okButton @@ -61,6 +65,26 @@ private void InitializeComponent() this.codgroupBox.Name = "codgroupBox"; this.codgroupBox.TabStop = false; // + // label2 + // + resources.ApplyResources(this.label2, "label2"); + this.label2.Name = "label2"; + // + // label1 + // + resources.ApplyResources(this.label1, "label1"); + this.label1.Name = "label1"; + // + // guardBox + // + resources.ApplyResources(this.guardBox, "guardBox"); + this.guardBox.Name = "guardBox"; + // + // mailcodeBox + // + resources.ApplyResources(this.mailcodeBox, "mailcodeBox"); + this.mailcodeBox.Name = "mailcodeBox"; + // // capchgroupBox // this.capchgroupBox.Controls.Add(this.label3); @@ -87,25 +111,24 @@ private void InitializeComponent() this.capchapicBox.Name = "capchapicBox"; this.capchapicBox.TabStop = false; // - // label2 + // twoFactorGroup // - resources.ApplyResources(this.label2, "label2"); - this.label2.Name = "label2"; + this.twoFactorGroup.Controls.Add(this.label5); + this.twoFactorGroup.Controls.Add(this.factorTextBox); + resources.ApplyResources(this.twoFactorGroup, "twoFactorGroup"); + this.twoFactorGroup.Name = "twoFactorGroup"; + this.twoFactorGroup.TabStop = false; // - // label1 + // label5 // - resources.ApplyResources(this.label1, "label1"); - this.label1.Name = "label1"; - // - // guardBox - // - resources.ApplyResources(this.guardBox, "guardBox"); - this.guardBox.Name = "guardBox"; + resources.ApplyResources(this.label5, "label5"); + this.label5.Name = "label5"; // - // mailcodeBox + // factorTextBox // - resources.ApplyResources(this.mailcodeBox, "mailcodeBox"); - this.mailcodeBox.Name = "mailcodeBox"; + this.factorTextBox.CharacterCasing = System.Windows.Forms.CharacterCasing.Upper; + resources.ApplyResources(this.factorTextBox, "factorTextBox"); + this.factorTextBox.Name = "factorTextBox"; // // Dialog // @@ -114,6 +137,7 @@ private void InitializeComponent() this.Controls.Add(this.capchgroupBox); this.Controls.Add(this.codgroupBox); this.Controls.Add(this.okButton); + this.Controls.Add(this.twoFactorGroup); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; this.Name = "Dialog"; this.codgroupBox.ResumeLayout(false); @@ -121,6 +145,8 @@ private void InitializeComponent() this.capchgroupBox.ResumeLayout(false); this.capchgroupBox.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.capchapicBox)).EndInit(); + this.twoFactorGroup.ResumeLayout(false); + this.twoFactorGroup.PerformLayout(); this.ResumeLayout(false); } @@ -137,5 +163,8 @@ private void InitializeComponent() private System.Windows.Forms.Label label3; private System.Windows.Forms.TextBox capchaBox; private System.Windows.Forms.PictureBox capchapicBox; + private System.Windows.Forms.GroupBox twoFactorGroup; + private System.Windows.Forms.Label label5; + private System.Windows.Forms.TextBox factorTextBox; } } \ No newline at end of file diff --git a/scr/SCMBot/Dialog.cs b/scr/SCMBot/Dialog.cs index b8f51c4..c97d362 100644 --- a/scr/SCMBot/Dialog.cs +++ b/scr/SCMBot/Dialog.cs @@ -18,12 +18,18 @@ public string GuardDesc set { guardBox.Text = value; } } - public string capchaText + public string CapchaText { get { return capchaBox.Text; } set { capchaBox.Text = value; } } + public string TwoFactorCode + { + get { return factorTextBox.Text; } + set { factorTextBox.Text = value; } + } + public bool codgroupEnab { get { return codgroupBox.Enabled; } @@ -36,7 +42,13 @@ public bool capchgroupEnab set { capchgroupBox.Visible = value; } } - public PictureBox capchImg + public bool factorgroupEnab + { + get { return twoFactorGroup.Enabled; } + set { twoFactorGroup.Visible = value; } + } + + public PictureBox capchImg { get { return capchapicBox; } set { capchapicBox = value; } diff --git a/scr/SCMBot/Dialog.resx b/scr/SCMBot/Dialog.resx index d5d56c6..d001b55 100644 --- a/scr/SCMBot/Dialog.resx +++ b/scr/SCMBot/Dialog.resx @@ -143,6 +143,78 @@ 2 + + label2 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + codgroupBox + + + 0 + + + label1 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + codgroupBox + + + 1 + + + guardBox + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + codgroupBox + + + 2 + + + mailcodeBox + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + codgroupBox + + + 3 + + + 12, 12 + + + 227, 77 + + + 23 + + + Enter access code + + + codgroupBox + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 1 + True @@ -242,30 +314,6 @@ 3 - - 12, 12 - - - 227, 77 - - - 23 - - - Enter access code - - - codgroupBox - - - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 1 - True @@ -359,6 +407,82 @@ 0 + + True + + + + NoControl + + + 7, 45 + + + 88, 13 + + + 7 + + + Mobile App Code + + + label5 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + twoFactorGroup + + + 0 + + + 101, 42 + + + 118, 20 + + + 5 + + + factorTextBox + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + twoFactorGroup + + + 1 + + + 12, 12 + + + 227, 93 + + + 26 + + + Two Factor Auth Required + + + twoFactorGroup + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 3 + True @@ -368,7 +492,6 @@ 252, 147 - CenterParent diff --git a/scr/SCMBot/Main.cs b/scr/SCMBot/Main.cs index 5c801d1..655a76b 100644 --- a/scr/SCMBot/Main.cs +++ b/scr/SCMBot/Main.cs @@ -592,13 +592,22 @@ public void Event_Message(object sender, object data, int searchId, flag myflag, AddtoLog(Strings.AlreadyLogged); StatusLabel1.Text = Strings.AlreadyLogged; GetAccInfo((StrParam)data); + + if (relog) + scanItems.UpdateCock(steam_srch.cookieCont); + relog = false; + break; case flag.Login_success: - relog = false; AddtoLog(Strings.LoginSucc); StatusLabel1.Text = Strings.LoginSucc; GetAccInfo((StrParam)data); + + if (relog) + scanItems.UpdateCock(steam_srch.cookieCont); + relog = false; + break; case flag.Login_cancel: diff --git a/scr/SCMBot/SteamSite.cs b/scr/SCMBot/SteamSite.cs index b873f61..e52152e 100644 --- a/scr/SCMBot/SteamSite.cs +++ b/scr/SCMBot/SteamSite.cs @@ -409,10 +409,10 @@ private void loginThread_DoWork(object sender, DoWorkEventArgs e) if (accInfo != null) { + Logged = true; doMessage(flag.Already_logged, 0, accInfo, true); doMessage(flag.Rep_progress, 0, "100", true); LoginProcess = false; - Logged = true; return; } @@ -421,6 +421,7 @@ private void loginThread_DoWork(object sender, DoWorkEventArgs e) string capchaId = string.Empty; string capchaTxt = string.Empty; string mailId = string.Empty; + string twoFactorCode = string.Empty; //Login cycle @@ -449,7 +450,7 @@ private void loginThread_DoWork(object sender, DoWorkEventArgs e) string finalpass = EncryptPassword(Password, rRSA.Module, rRSA.Exponent); string MainReq = string.Format(loginReq, finalpass, UserName, mailCode, guardDesc, capchaId, - capchaTxt, mailId, rRSA.TimeStamp); + capchaTxt, mailId, rRSA.TimeStamp, twoFactorCode); string BodyResp = SendPost(MainReq, _dologin, _ref, true); LoginProgr("60"); @@ -479,30 +480,41 @@ private void loginThread_DoWork(object sender, DoWorkEventArgs e) //Verifying humanity, loading capcha guardCheckForm.capchgroupEnab = true; guardCheckForm.codgroupEnab = false; + guardCheckForm.factorgroupEnab = false; string newcap = _capcha + rProcess.Captcha_Id; Main.loadImg(newcap, guardCheckForm.capchImg, false, false); } else - if (rProcess.isEmail) + if (rProcess.isTwoFactor) { - //Steam guard wants email code + //Steam wants two factor code guardCheckForm.capchgroupEnab = false; - guardCheckForm.codgroupEnab = true; + guardCheckForm.codgroupEnab = false; + guardCheckForm.factorgroupEnab = true; } else - { - //Whoops! - goto begin; - } + if (rProcess.isEmail) + { + //Steam guard wants email code + guardCheckForm.capchgroupEnab = false; + guardCheckForm.codgroupEnab = true; + guardCheckForm.factorgroupEnab = false; + } + else + { + //Whoops! + goto begin; + } //Re-assign main request values if (guardCheckForm.ShowDialog() == DialogResult.OK) { mailCode = guardCheckForm.MailCode; guardDesc = guardCheckForm.GuardDesc; + twoFactorCode = guardCheckForm.TwoFactorCode; capchaId = rProcess.Captcha_Id; - capchaTxt = guardCheckForm.capchaText; + capchaTxt = guardCheckForm.CapchaText; mailId = rProcess.Email_Id; guardCheckForm.Dispose(); } @@ -534,11 +546,10 @@ private void loginThread_DoWork(object sender, DoWorkEventArgs e) //Okay var accInfo2 = GetNameBalance(cookieCont); + Logged = true; doMessage(flag.Login_success, 0, accInfo2, true); LoginProgr("100"); - - Logged = true; Main.AddtoLog("Login Success"); } else diff --git a/scr/SCMBot/SteamUtils.cs b/scr/SCMBot/SteamUtils.cs index 812f15c..2b74ff2 100644 --- a/scr/SCMBot/SteamUtils.cs +++ b/scr/SCMBot/SteamUtils.cs @@ -45,7 +45,7 @@ public partial class SteamSite const string _lang_req = "language={0}&sessionid={1}"; //Request fix for 02/05/15 - const string loginReq = "password={0}&username={1}&twofactorcode=&emailauth={2}&loginfriendlyname={3}&captchagid={4}&captcha_text={5}&emailsteamid={6}&rsatimestamp={7}&remember_login=true"; + const string loginReq = "password={0}&username={1}&twofactorcode={8}&emailauth={2}&loginfriendlyname={3}&captchagid={4}&captcha_text={5}&emailsteamid={6}&rsatimestamp={7}&remember_login=true"; //Currency FIX //1 = USD, 2 = GBP, 3 = EUR, 5 = RUB @@ -210,6 +210,9 @@ public class RespProcess [JsonProperty("bad_captcha")] public bool isBadCap { get; set; } + + [JsonProperty("requires_twofactor")] + public bool isTwoFactor { get; set; } } public class RespFinal