Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Created by Chris Harris (Chris7S)
- //Created using Visual Studio 2012 (C#)
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- using System.IO;
- using System.Net;
- using System.Runtime.InteropServices;
- namespace Keyvault_Checker
- {
- public partial class Form1 : Form
- {
- private string user = "chrisse7ensins@live.com";
- private string pass = "se7ensinner123";
- public int myInt = 0;
- const int FEATURE_DISABLE_NAVIGATION_SOUNDS = 21;
- const int SET_FEATURE_ON_PROCESS = 0x00000002;
- [DllImport("urlmon.dll")]
- [PreserveSig]
- [return: MarshalAs(UnmanagedType.Error)]
- static extern int CoInternetSetFeatureEnabled(
- int FeatureEntry,
- [MarshalAs(UnmanagedType.U4)] int dwFlags,
- bool fEnable);
- public Form1()
- {
- InitializeComponent();
- }
- static void disableClickSounds()
- {
- CoInternetSetFeatureEnabled(
- FEATURE_DISABLE_NAVIGATION_SOUNDS,
- SET_FEATURE_ON_PROCESS,
- true);
- }
- static void enableClickSounds()
- {
- CoInternetSetFeatureEnabled(
- FEATURE_DISABLE_NAVIGATION_SOUNDS,
- SET_FEATURE_ON_PROCESS,
- false);
- }
- private void Form1_Load(object sender, EventArgs e)
- {
- this.Text = "Keyvault Checker - v" + Application.ProductVersion;
- disableClickSounds();
- wbXboxLive.Navigate("https://login.live.com/login.srf?wa=wsignin1.0&rpsnv=12&ct=1390286445&rver=6.4.6456.0&wp=MBI_SSL&wreply=https:%2F%2Flive.xbox.com:443%2Fxweb%2Flive%2Fpassport%2FsetCookies.ashx%3Frru%3Dhttps%253a%252f%252flive.xbox.com%252fen-US%252fAccount%252fSignin%253freturnUrl%253dhttps%253a%252f%252fenforcement.xbox.com%252fHome%252fMsaCallback&lc=1033&id=66262&cbcxt=0");
- }
- private void closeToolStripMenuItem_Click(object sender, EventArgs e)
- {
- Application.Exit();
- }
- private void button1_Click(object sender, EventArgs e)
- {
- OpenFileDialog openFileDialog1 = new OpenFileDialog();
- openFileDialog1.Filter = "Bin Files (.bin)|*.bin|All Files (*.*)|*.*";
- openFileDialog1.FilterIndex = 1;
- openFileDialog1.Title = "Open Keyvault";
- openFileDialog1.FileName = "KV.bin";
- if (openFileDialog1.ShowDialog() == DialogResult.OK)
- {
- try
- {
- BinaryReader br = new BinaryReader(new MemoryStream(File.ReadAllBytes(openFileDialog1.FileName)));
- br.BaseStream.Position = 0xB0;
- byte[] array = br.ReadBytes(0xC);
- long value0 = long.Parse(ASCIIEncoding.ASCII.GetString(array));
- string value1 = value0.ToString();
- label1.Text = "Console Serial Number - " + value1;
- textBox2.Text = value1;
- textBox1.Text = openFileDialog1.FileName;
- label2.Enabled = true;
- progressBar1.Enabled = true;
- comboBox1.Enabled = true;
- toolStripStatusLabel2.Text = "Keyvault Opened Successfully";
- if (textBox2.TextLength == 11)
- {
- label1.Text = "Console Serial Number - 0" + value1;
- textBox2.Text = "Console Serial Number - 0" + value1;
- }
- else
- {
- label1.Text = "Console Serial Number - " + value1;
- }
- }
- catch
- {
- MessageBox.Show("An error has occurred. Please try again!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
- }
- }
- }
- private void openKeyvaultToolStripMenuItem_Click(object sender, EventArgs e)
- {
- OpenFileDialog openFileDialog1 = new OpenFileDialog();
- openFileDialog1.Filter = "Bin Files (.bin)|*.bin|All Files (*.*)|*.*";
- openFileDialog1.FilterIndex = 1;
- openFileDialog1.Title = "Open Keyvault";
- openFileDialog1.FileName = "KV.bin";
- if (openFileDialog1.ShowDialog() == DialogResult.OK)
- {
- try
- {
- BinaryReader br = new BinaryReader(new MemoryStream(File.ReadAllBytes(openFileDialog1.FileName)));
- br.BaseStream.Position = 0xB0;
- byte[] array = br.ReadBytes(0xC);
- long value0 = long.Parse(ASCIIEncoding.ASCII.GetString(array));
- string value1 = value0.ToString();
- textBox2.Text = value1;
- textBox1.Text = openFileDialog1.FileName;
- label2.Enabled = true;
- progressBar1.Enabled = true;
- comboBox1.Enabled = true;
- toolStripStatusLabel2.Text = "Keyvault Opened Successfully";
- if (textBox2.TextLength == 11)
- {
- label1.Text = "Console Serial Number - 0" + value1;
- textBox2.Text = "Console Serial Number - 0" + value1;
- }
- else
- {
- label1.Text = "Console Serial Number - " + value1;
- }
- }
- catch
- {
- MessageBox.Show("An error has occurred. Please try again!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
- }
- }
- }
- private void button2_Click(object sender, EventArgs e)
- {
- timer1.Start();
- wbXboxLive.Document.GetElementById("i0116").SetAttribute("value", user);
- wbXboxLive.Document.GetElementById("i0118").SetAttribute("value", pass);
- wbXboxLive.Document.GetElementById("idSIButton9").InvokeMember("click");
- }
- private void timer1_Tick(object sender, EventArgs e)
- {
- progressBar1.Increment(+1);
- label2.Text = progressBar1.Value + "%";
- if (progressBar1.Value == 1)
- {
- toolStripStatusLabel2.Text = "Connecting to Xbox Live Server...";
- }
- else if (progressBar1.Value == 20)
- {
- wbXboxLive.Navigate("https://enforcement.xbox.com/Home/ConsoleCheck?Length=4");
- }
- else if (progressBar1.Value == 40)
- {
- toolStripStatusLabel2.Text = "Checking Keyvault for Flags...";
- if (comboBox1.Text == "Select Console Type")
- {
- MessageBox.Show("Please Select a Console Type", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
- }
- else if (comboBox1.Text == "original Xbox 360")
- {
- wbXboxLive.Document.GetElementById("e_selectConsole").SetAttribute("option", "Xbox360");
- }
- else if (comboBox1.Text == "Xbox 360 S")
- {
- wbXboxLive.Document.GetElementById("e_selectConsole").SetAttribute("value", "Xbox360S");
- }
- else if (comboBox1.Text == "Xbox 360 E")
- {
- wbXboxLive.Document.GetElementById("e_selectConsole").SetAttribute("option", "Xbox360E");
- }
- wbXboxLive.Document.GetElementById("e_serialNo").SetAttribute("value", textBox2.Text);
- }
- else if (progressBar1.Value == 60)
- {
- toolStripStatusLabel2.Text = "Returning Keyvault Results...";
- wbXboxLive.Document.GetElementById("e_iReadTou").InvokeMember("click");
- wbXboxLive.Document.GetElementById("e_lookupConsole").InvokeMember("click");
- progressBar1.Increment(+2);
- }
- else if (progressBar1.Value == 80)
- {
- textBox3.Text = wbXboxLive.Document.GetElementById("e_msgbarText").InnerHtml.ToString();
- progressBar1.Increment(+3);
- }
- else if (progressBar1.Value == 100)
- {
- if (textBox3.Text.Contains("No enforcement action found."))
- {
- toolStripStatusLabel2.ForeColor = System.Drawing.Color.Green;
- toolStripStatusLabel2.Text = "Keyvault Unbanned";
- timer1.Stop();
- checkBox1.Enabled = true;
- checkBox1.Visible = true;
- }
- else if (textBox3.Text.Contains("Console check limit exceeded."))
- {
- toolStripStatusLabel2.ForeColor = System.Drawing.Color.Red;
- toolStripStatusLabel2.Text = "Console check limit exceeded. Try again later.";
- timer1.Stop();
- checkBox1.Enabled = true;
- checkBox1.Visible = true;
- }
- else if (textBox3.Text.Contains("Our records indicate this console has been banned"))
- {
- toolStripStatusLabel2.ForeColor = System.Drawing.Color.Red;
- toolStripStatusLabel2.Text = "Keyvault Banned";
- timer1.Stop();
- checkBox1.Enabled = true;
- checkBox1.Visible = true;
- }
- }
- }
- private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
- {
- if (comboBox1.Text == "Select Console Type")
- {
- //Do nothing.
- }
- else
- {
- button2.Enabled = true;
- }
- }
- private void Form1_FormClosing(object sender, FormClosingEventArgs e)
- {
- enableClickSounds();
- }
- private void checkBox1_CheckedChanged(object sender, EventArgs e)
- {
- if (checkBox1.Checked == true)
- {
- comboBox1.Enabled = false;
- comboBox1.Text = "Select Console Type";
- textBox1.Text = "";
- button2.Enabled = false;
- checkBox1.Enabled = false;
- checkBox1.Visible = false;
- label1.Text = "Console Serial Number - -N/A- ";
- progressBar1.Value = 0;
- label2.Text = progressBar1.Value + "%";
- toolStripStatusLabel2.Text = "Idle";
- }
- }
- private void toolStripButton1_Click(object sender, EventArgs e)
- {
- MessageBox.Show("Keyvault Checker v" + Application.ProductVersion + "\n \n" + "Created by Chris Harris (Chris 7S)", "About Keyvault Checker", MessageBoxButtons.OK, MessageBoxIcon.Information);
- }
- private void toolStripButton2_Click(object sender, EventArgs e)
- {
- System.Diagnostics.Process.Start("http://www.youtube.com/InModWeTrust360");
- }
- private void toolStripButton3_Click(object sender, EventArgs e)
- {
- System.Diagnostics.Process.Start("http://www.facebook.com/InModWeTrust360");
- }
- private void toolStripButton4_Click(object sender, EventArgs e)
- {
- System.Diagnostics.Process.Start("http://www.twitter.com/InModWeTrust360");
- }
- private void toolStripButton5_Click(object sender, EventArgs e)
- {
- System.Diagnostics.Process.Start("http://www.instagram.com/InModWeTrust360");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement