Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- BY FEDERATION | KV CHECKER SOURCE + download || https://mega.nz/#!VkYRwaaT!pMigvdYjnZWHuQI9pDEkslnYBwclWT3k_Z4PSRmd1xI
- ---------------------------------------------
- using DevComponents.DotNetBar;
- using DevComponents.DotNetBar.Controls;
- using DevComponents.DotNetBar.Metro;
- using DevComponents.DotNetBar.Metro.ColorTables;
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Drawing;
- using System.IO;
- using System.Linq;
- using System.Threading;
- using System.Windows.Forms;
- using XRPCLib;
- namespace KV_Validator
- {
- public class Form1 : MetroForm
- {
- private IList<string> Names = (IList<string>) new List<string>();
- private XRPC Jtag = new XRPC();
- private KVC kv = new KVC();
- private IContainer components = (IContainer) null;
- private string[] subFiles;
- private bool isConnected;
- private bool renameCheck;
- private string status;
- private StyleManager styleManager1;
- private ListBox listBox1;
- private GroupPanel groupPanel1;
- private ButtonX buttonX2;
- private ButtonX buttonX1;
- private ProgressBarX progressBarX1;
- private LabelX labelX1;
- private LabelX labelX2;
- private ButtonX buttonX3;
- private ButtonX buttonX4;
- public Form1()
- {
- this.InitializeComponent();
- }
- private void Form1_Load(object sender, EventArgs e)
- {
- this.listBox1.Items.Clear();
- string path = AppDomain.CurrentDomain.BaseDirectory + "KVs\\";
- string[] files = Directory.GetFiles(path);
- foreach (string directory in Directory.GetDirectories(path))
- {
- this.subFiles = Directory.GetFiles(directory);
- foreach (string subFile in this.subFiles)
- {
- if (subFile.EndsWith(".bin") && !subFile.Contains("cpukey"))
- {
- int num1 = directory.LastIndexOf('\\');
- int num2 = num1 > 0 ? subFile.LastIndexOf('\\', num1 - 1) : -1;
- string str = subFile.Substring(num2 + 1);
- this.Names.Add(str);
- this.listBox1.Items.Add((object) str);
- }
- }
- }
- foreach (string str1 in files)
- {
- if (str1.EndsWith(".bin") && !str1.Contains("cpukey"))
- {
- int num1 = str1.LastIndexOf('\\');
- int num2 = num1 > 0 ? str1.LastIndexOf('\\', num1 - 1) : -1;
- string str2 = str1.Substring(num2 + 1);
- this.Names.Add(str2);
- this.listBox1.Items.Add((object) str2);
- }
- }
- }
- private void buttonX1_Click(object sender, EventArgs e)
- {
- if (this.listBox1.Items.Count >= 1)
- {
- this.listBox1.Items.Clear();
- this.buttonX1.Enabled = false;
- this.buttonX2.Enabled = false;
- if (File.Exists(AppDomain.CurrentDomain.BaseDirectory + "KVs\\log.txt"))
- File.Delete(AppDomain.CurrentDomain.BaseDirectory + "KVs\\log.txt");
- ThreadPool.QueueUserWorkItem(new WaitCallback(this.doWork));
- }
- else
- {
- int num = (int) MessageBoxEx.Show("No KV.bin files found at " + AppDomain.CurrentDomain.BaseDirectory + "\\KVs");
- }
- }
- private void buttonX2_Click(object sender, EventArgs e)
- {
- if (this.listBox1.SelectedItem == null)
- {
- int num = (int) MessageBoxEx.Show("No KV was selected", "Error");
- }
- else
- {
- if (this.listBox1.Items.Count < 1)
- return;
- this.buttonX2.Enabled = false;
- this.buttonX1.Enabled = false;
- this.shortWork();
- }
- }
- private string checkNames(string currentItem)
- {
- currentItem = this.listBox1.GetItemText(this.listBox1.SelectedItem);
- if (currentItem.EndsWith(" is Banned"))
- currentItem = currentItem.Substring(0, currentItem.Length - 10);
- if (currentItem.EndsWith(" is Unbanned"))
- currentItem = currentItem.Substring(0, currentItem.Length - 12);
- return currentItem;
- }
- private void doWork(object state)
- {
- // this.Invoke((Delegate) (() => this.progressBarX1.Value = 0));
- foreach (string name in (IEnumerable<string>) this.Names)
- {
- if (!name.Contains("cpukey"))
- {
- this.kv.getStatus(name);
- if (!this.kv.returnStatus())
- {
- this.status = name + " is Unbanned";
- // this.Invoke((Delegate) (() => this.listBox1.Items.Add((object) this.status)));
- // this.Invoke((Delegate) (() => this.listBox1.Refresh()));
- }
- else
- {
- this.status = name + " is Banned";
- // this.Invoke((Delegate) (() => this.listBox1.Items.Add((object) this.status)));
- // this.Invoke((Delegate) (() => this.listBox1.Refresh()));
- }
- // this.Invoke((Delegate) (() => this.progressBarStep()));
- // this.Invoke((Delegate) (() => this.progressBarX1.Refresh()));
- }
- }
- // this.Invoke((Delegate) (() => this.progressBarX1.Value = 100));
- // this.Invoke((Delegate) (() => this.buttonX1.Enabled = true));
- // this.Invoke((Delegate) (() => this.buttonX2.Enabled = true));
- // this.Invoke((Delegate) (() => this.listBox1.SelectedIndex = 0));
- }
- private void listBox1_DrawItem(object sender, DrawItemEventArgs e)
- {
- if (e.Index < 0)
- return;
- if ((e.State & DrawItemState.Selected) == DrawItemState.Selected)
- e = new DrawItemEventArgs(e.Graphics, e.Font, e.Bounds, e.Index, e.State ^ DrawItemState.Selected, e.ForeColor, Color.DarkOrange);
- e.DrawBackground();
- e.Graphics.DrawString(this.listBox1.Items[e.Index].ToString(), e.Font, Brushes.Black, (RectangleF) e.Bounds, StringFormat.GenericDefault);
- e.DrawFocusRectangle();
- }
- private void progressBarStep()
- {
- this.progressBarX1.Step = 100 / this.Names.Count<string>();
- this.progressBarX1.PerformStep();
- this.progressBarX1.Refresh();
- }
- private void shortWork()
- {
- foreach (string name in (IEnumerable<string>) this.Names)
- {
- if (name == this.checkNames(this.listBox1.GetItemText(this.listBox1.SelectedItem)))
- {
- try
- {
- this.progressBarX1.Value = 0;
- this.kv.getStatus(name);
- if (!this.kv.returnStatus())
- {
- this.status = name + " is Unbanned";
- this.listBox1.Items[this.listBox1.SelectedIndex] = (object) this.status;
- }
- else
- {
- this.status = name + " is Banned";
- this.listBox1.Items[this.listBox1.SelectedIndex] = (object) this.status;
- }
- this.listBox1.Refresh();
- this.buttonX2.Enabled = true;
- this.buttonX1.Enabled = true;
- this.progressBarX1.Value = 100;
- }
- catch (Exception ex)
- {
- int num = (int) MessageBoxEx.Show("Sorry, checking the current KV has failed\nCurrent File: " + name + "\n" + (object) ex);
- }
- }
- }
- }
- private void labelX2_Click(object sender, EventArgs e)
- {
- int num1 = (int) MessageBoxEx.Show("Need some Unshared and Unbanned KVs?" + Environment.NewLine + Environment.NewLine + "Message sbmodz on Skype");
- int num2 = (int) MessageBoxEx.Show("PRICES:" + Environment.NewLine + Environment.NewLine + "PAYPAL/GOOGLE WALLET" + Environment.NewLine + "1+ $5 EACH" + Environment.NewLine + "10+ $4 EACH" + Environment.NewLine + "25+ $3.75 EACH" + Environment.NewLine + "50+ $3.50 EACH" + Environment.NewLine + "100+ $3.25 EACH" + Environment.NewLine + Environment.NewLine + "AMAZON:" + Environment.NewLine + "$6.50 EACH");
- }
- private void buttonX3_Click(object sender, EventArgs e)
- {
- if (!this.isConnected)
- {
- this.Jtag.Connect();
- this.isConnected = true;
- }
- if (this.Jtag.activeConnection)
- {
- SaveFileDialog saveFileDialog = new SaveFileDialog();
- saveFileDialog.Title = "Save your Xbox 360 KV.bin file";
- saveFileDialog.Filter = "Binary File (*.bin)|*.bin";
- saveFileDialog.FileName = "KV";
- if (Directory.Exists(AppDomain.CurrentDomain.BaseDirectory + "\\KVs"))
- saveFileDialog.InitialDirectory = AppDomain.CurrentDomain.BaseDirectory + "\\KVs";
- else
- saveFileDialog.InitialDirectory = AppDomain.CurrentDomain.BaseDirectory;
- if (saveFileDialog.ShowDialog() != DialogResult.OK)
- return;
- try
- {
- this.Jtag.xbCon.ReceiveFile(saveFileDialog.FileName, "HDD:\\KV.bin");
- int num1 = saveFileDialog.FileName.LastIndexOf('\\');
- int num2 = num1 > 0 ? saveFileDialog.FileName.LastIndexOf('\\', num1 - 1) : -1;
- string str = saveFileDialog.FileName.Substring(num2 + 1);
- this.kv.getStatus(saveFileDialog.FileName);
- if (!this.kv.returnStatus())
- {
- this.listBox1.Items.Add((object) (str + " is Unbanned"));
- this.listBox1.Refresh();
- }
- else
- {
- if (!this.kv.returnStatus())
- return;
- this.listBox1.Items.Add((object) (str + " is Banned"));
- this.listBox1.Refresh();
- }
- }
- catch (Exception ex)
- {
- int num = (int) MessageBoxEx.Show("Sorry, receiving the KV.bin file has failed\nCheck the file exists\nJRPC2 will block receiving of the file\n" + (object) ex);
- }
- }
- else
- {
- int num3 = (int) MessageBoxEx.Show("Sorry, could not connect to console\nVerify your connection and try again", "Error");
- }
- }
- private void buttonX4_Click(object sender, EventArgs e)
- {
- if (this.listBox1.SelectedItem == null)
- {
- int num1 = (int) MessageBoxEx.Show("No KV was selected", "Error");
- }
- else
- {
- if (!this.isConnected)
- {
- this.Jtag.Connect();
- this.isConnected = true;
- }
- if (this.Jtag.activeConnection)
- {
- string itemText = this.listBox1.GetItemText(this.listBox1.SelectedItem);
- foreach (string name in (IEnumerable<string>) this.Names)
- {
- if (name == this.checkNames(itemText))
- {
- try
- {
- string str = name.Substring(name.LastIndexOf('\\') + 1);
- if (this.renameCheck)
- {
- this.Jtag.xbCon.SendFile(AppDomain.CurrentDomain.BaseDirectory + name, "HDD:\\" + str);
- int num2 = (int) MessageBoxEx.Show("Sent KV Successfully", "Success");
- this.progressBarX1.Value = 100;
- }
- else if (!this.renameCheck)
- {
- this.Jtag.xbCon.SendFile(AppDomain.CurrentDomain.BaseDirectory + name, "HDD:\\KV.bin");
- this.progressBarX1.Value = 100;
- int num2 = (int) MessageBoxEx.Show("Sent KV Successfully", "Success");
- }
- this.progressBarX1.Value = 0;
- }
- catch (Exception ex)
- {
- int num2 = (int) MessageBoxEx.Show("Sorry, sending the KV.bin file has failed\n" + (object) ex);
- }
- }
- }
- }
- else
- {
- int num3 = (int) MessageBoxEx.Show("Sorry, could not connect to console\nVerify your connection and try again", "Error");
- }
- }
- }
- protected override void Dispose(bool disposing)
- {
- if (disposing && this.components != null)
- this.components.Dispose();
- base.Dispose(disposing);
- }
- private void InitializeComponent()
- {
- this.components = (IContainer) new Container();
- ComponentResourceManager componentResourceManager = new ComponentResourceManager(typeof (Form1));
- this.styleManager1 = new StyleManager(this.components);
- this.listBox1 = new ListBox();
- this.groupPanel1 = new GroupPanel();
- this.labelX2 = new LabelX();
- this.buttonX3 = new ButtonX();
- this.buttonX4 = new ButtonX();
- this.buttonX2 = new ButtonX();
- this.buttonX1 = new ButtonX();
- this.progressBarX1 = new ProgressBarX();
- this.labelX1 = new LabelX();
- this.groupPanel1.SuspendLayout();
- this.SuspendLayout();
- this.styleManager1.ManagerStyle = eStyle.Office2016;
- this.styleManager1.MetroColorParameters = new MetroColorGeneratorParameters(Color.FromArgb((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue), Color.Green);
- this.listBox1.BackColor = Color.FromArgb((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue);
- this.listBox1.DrawMode = DrawMode.OwnerDrawFixed;
- this.listBox1.ForeColor = Color.Black;
- this.listBox1.FormattingEnabled = true;
- this.listBox1.HorizontalScrollbar = true;
- this.listBox1.Location = new Point(124, 3);
- this.listBox1.Name = "listBox1";
- this.listBox1.Size = new Size(272, 212);
- this.listBox1.TabIndex = 3;
- this.listBox1.DrawItem += new DrawItemEventHandler(this.listBox1_DrawItem);
- this.groupPanel1.BackColor = Color.FromArgb((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue);
- this.groupPanel1.CanvasColor = Color.FromArgb((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue);
- this.groupPanel1.ColorSchemeStyle = eDotNetBarStyle.StyleManagerControlled;
- this.groupPanel1.Controls.Add((Control) this.labelX2);
- this.groupPanel1.Controls.Add((Control) this.buttonX3);
- this.groupPanel1.Controls.Add((Control) this.buttonX4);
- this.groupPanel1.Controls.Add((Control) this.buttonX2);
- this.groupPanel1.Controls.Add((Control) this.buttonX1);
- this.groupPanel1.Controls.Add((Control) this.progressBarX1);
- this.groupPanel1.Controls.Add((Control) this.listBox1);
- this.groupPanel1.DisabledBackColor = Color.Empty;
- this.groupPanel1.Location = new Point(12, 12);
- this.groupPanel1.Name = "groupPanel1";
- this.groupPanel1.Size = new Size(405, 267);
- this.groupPanel1.Style.BackColor2SchemePart = eColorSchemePart.PanelBackground2;
- this.groupPanel1.Style.BackColorGradientAngle = 90;
- this.groupPanel1.Style.BackColorSchemePart = eColorSchemePart.PanelBackground;
- this.groupPanel1.Style.BorderBottom = eStyleBorderType.Solid;
- this.groupPanel1.Style.BorderBottomWidth = 1;
- this.groupPanel1.Style.BorderColorSchemePart = eColorSchemePart.PanelBorder;
- this.groupPanel1.Style.BorderLeft = eStyleBorderType.Solid;
- this.groupPanel1.Style.BorderLeftWidth = 1;
- this.groupPanel1.Style.BorderRight = eStyleBorderType.Solid;
- this.groupPanel1.Style.BorderRightWidth = 1;
- this.groupPanel1.Style.BorderTop = eStyleBorderType.Solid;
- this.groupPanel1.Style.BorderTopWidth = 1;
- this.groupPanel1.Style.CornerDiameter = 4;
- this.groupPanel1.Style.CornerType = eCornerType.Rounded;
- this.groupPanel1.Style.TextAlignment = eStyleTextAlignment.Center;
- this.groupPanel1.Style.TextColorSchemePart = eColorSchemePart.PanelText;
- this.groupPanel1.Style.TextLineAlignment = eStyleTextAlignment.Near;
- this.groupPanel1.StyleMouseDown.CornerType = eCornerType.Square;
- this.groupPanel1.StyleMouseOver.CornerType = eCornerType.Square;
- this.groupPanel1.TabIndex = 4;
- this.groupPanel1.Text = "KV Checker";
- this.labelX2.BackColor = Color.FromArgb((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue);
- // this.labelX2.BackgroundImage = (Image) componentResourceManager.GetObject("labelX2.BackgroundImage");
- this.labelX2.BackgroundImageLayout = ImageLayout.Zoom;
- this.labelX2.BackgroundStyle.CornerType = eCornerType.Square;
- this.labelX2.ForeColor = Color.Black;
- this.labelX2.ImeMode = ImeMode.NoControl;
- this.labelX2.Location = new Point(3, 75);
- this.labelX2.Name = "labelX2";
- this.labelX2.Size = new Size(115, 67);
- this.labelX2.Style = eDotNetBarStyle.StyleManagerControlled;
- this.labelX2.TabIndex = 9;
- this.labelX2.Click += new EventHandler(this.labelX2_Click);
- this.buttonX3.AccessibleRole = AccessibleRole.PushButton;
- this.buttonX3.ColorTable = eButtonColor.OrangeWithBackground;
- this.buttonX3.Location = new Point(3, 148);
- this.buttonX3.Name = "buttonX3";
- this.buttonX3.Size = new Size(115, 30);
- this.buttonX3.Style = eDotNetBarStyle.StyleManagerControlled;
- this.buttonX3.TabIndex = 8;
- this.buttonX3.Text = "Grab KV from Console";
- this.buttonX3.Click += new EventHandler(this.buttonX3_Click);
- this.buttonX4.AccessibleRole = AccessibleRole.PushButton;
- this.buttonX4.ColorTable = eButtonColor.OrangeWithBackground;
- this.buttonX4.Location = new Point(3, 184);
- this.buttonX4.Name = "buttonX4";
- this.buttonX4.Size = new Size(115, 30);
- this.buttonX4.Style = eDotNetBarStyle.StyleManagerControlled;
- this.buttonX4.TabIndex = 7;
- this.buttonX4.Text = "Send selected KV to Console";
- this.buttonX4.Click += new EventHandler(this.buttonX4_Click);
- this.buttonX2.AccessibleRole = AccessibleRole.PushButton;
- this.buttonX2.ColorTable = eButtonColor.OrangeWithBackground;
- this.buttonX2.Location = new Point(3, 39);
- this.buttonX2.Name = "buttonX2";
- this.buttonX2.Size = new Size(115, 30);
- this.buttonX2.Style = eDotNetBarStyle.StyleManagerControlled;
- this.buttonX2.TabIndex = 6;
- this.buttonX2.Text = "Check selected KV";
- this.buttonX2.Click += new EventHandler(this.buttonX2_Click);
- // this.buttonX1.AccessibleRole = AccessibleRole.PushButton;
- this.buttonX1.ColorTable = eButtonColor.OrangeWithBackground;
- this.buttonX1.Location = new Point(3, 3);
- this.buttonX1.Name = "buttonX1";
- this.buttonX1.Size = new Size(115, 30);
- this.buttonX1.Style = eDotNetBarStyle.StyleManagerControlled;
- this.buttonX1.TabIndex = 5;
- this.buttonX1.Text = "Run Bulk Checker";
- this.buttonX1.Click += new EventHandler(this.buttonX1_Click);
- this.progressBarX1.BackColor = Color.FromArgb((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue);
- this.progressBarX1.BackgroundStyle.CornerType = eCornerType.Square;
- this.progressBarX1.ForeColor = Color.Black;
- this.progressBarX1.Location = new Point(3, 220);
- this.progressBarX1.Name = "progressBarX1";
- this.progressBarX1.Size = new Size(393, 23);
- this.progressBarX1.Style = eDotNetBarStyle.StyleManagerControlled;
- this.progressBarX1.TabIndex = 4;
- this.progressBarX1.Text = "progressBarX1";
- this.labelX1.BackColor = Color.FromArgb((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue);
- this.labelX1.BackgroundStyle.CornerType = eCornerType.Square;
- this.labelX1.ForeColor = Color.Black;
- this.labelX1.Location = new Point(324, 275);
- this.labelX1.Name = "labelX1";
- this.labelX1.Size = new Size(93, 23);
- this.labelX1.Style = eDotNetBarStyle.StyleManagerControlled;
- this.labelX1.TabIndex = 5;
- this.labelX1.Text = "XeDev Michael <3";
- this.AutoScaleDimensions = new SizeF(6f, 13f);
- // this.AutoScaleMode = AutoScaleMode.Font;
- this.ClientSize = new Size(429, 291);
- this.Controls.Add((Control) this.groupPanel1);
- this.Controls.Add((Control) this.labelX1);
- this.DoubleBuffered = true;
- // this.Icon = (Icon) componentResourceManager.GetObject("$this.Icon");
- this.MaximizeBox = false;
- this.MaximumSize = new Size(445, 330);
- this.MinimumSize = new Size(445, 330);
- this.Name = "Form1";
- this.StartPosition = FormStartPosition.CenterParent;
- this.Text = "SbModz KV Validator";
- this.Load += new EventHandler(this.Form1_Load);
- this.groupPanel1.ResumeLayout(false);
- this.ResumeLayout(false);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement