From 43355c3da7a7341e57d2ed98b10287d4244a3df9 Mon Sep 17 00:00:00 2001 From: Zellias Date: Mon, 6 Mar 2023 22:21:53 +0330 Subject: [PATCH] Add files via upload --- Form1.Designer.cs | 252 ++++++++++++++++++++++++++++++++++++++++++++++ Form1.cs | 222 ++++++++++++++++++++++++++++++++++++++++ Form1.resx | 120 ++++++++++++++++++++++ 3 files changed, 594 insertions(+) create mode 100644 Form1.Designer.cs create mode 100644 Form1.cs create mode 100644 Form1.resx diff --git a/Form1.Designer.cs b/Form1.Designer.cs new file mode 100644 index 0000000..042b00f --- /dev/null +++ b/Form1.Designer.cs @@ -0,0 +1,252 @@ +namespace WindowsFormsApp1 +{ + partial class Form1 + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.label1 = new System.Windows.Forms.Label(); + this.textBox1 = new System.Windows.Forms.TextBox(); + this.button1 = new System.Windows.Forms.Button(); + this.richTextBox1 = new System.Windows.Forms.RichTextBox(); + this.richTextBox2 = new System.Windows.Forms.RichTextBox(); + this.pictureBox5 = new System.Windows.Forms.PictureBox(); + this.pictureBox4 = new System.Windows.Forms.PictureBox(); + this.pictureBox3 = new System.Windows.Forms.PictureBox(); + this.pictureBox2 = new System.Windows.Forms.PictureBox(); + this.pictureBox1 = new System.Windows.Forms.PictureBox(); + this.richTextBox3 = new System.Windows.Forms.RichTextBox(); + this.button2 = new System.Windows.Forms.Button(); + this.checkBox1 = new System.Windows.Forms.CheckBox(); + this.label2 = new System.Windows.Forms.Label(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox5)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox4)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); + this.SuspendLayout(); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 12.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label1.Location = new System.Drawing.Point(118, 171); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(0, 20); + this.label1.TabIndex = 0; + this.label1.Click += new System.EventHandler(this.label1_Click); + // + // textBox1 + // + this.textBox1.BackColor = System.Drawing.Color.White; + this.textBox1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.textBox1.ForeColor = System.Drawing.Color.Green; + this.textBox1.Location = new System.Drawing.Point(12, 94); + this.textBox1.Name = "textBox1"; + this.textBox1.Size = new System.Drawing.Size(259, 20); + this.textBox1.TabIndex = 2; + this.textBox1.Text = "Enter token here"; + this.textBox1.TextChanged += new System.EventHandler(this.textBox1_TextChanged); + // + // button1 + // + this.button1.ForeColor = System.Drawing.Color.Green; + this.button1.Location = new System.Drawing.Point(277, 94); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(46, 20); + this.button1.TabIndex = 3; + this.button1.Text = "check"; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.button1_Click); + // + // richTextBox1 + // + this.richTextBox1.BackColor = System.Drawing.Color.White; + this.richTextBox1.BorderStyle = System.Windows.Forms.BorderStyle.None; + this.richTextBox1.Location = new System.Drawing.Point(118, 194); + this.richTextBox1.Name = "richTextBox1"; + this.richTextBox1.Size = new System.Drawing.Size(202, 67); + this.richTextBox1.TabIndex = 5; + this.richTextBox1.Text = ""; + // + // richTextBox2 + // + this.richTextBox2.BackColor = System.Drawing.Color.White; + this.richTextBox2.BorderStyle = System.Windows.Forms.BorderStyle.None; + this.richTextBox2.Location = new System.Drawing.Point(352, 83); + this.richTextBox2.Name = "richTextBox2"; + this.richTextBox2.ReadOnly = true; + this.richTextBox2.Size = new System.Drawing.Size(172, 283); + this.richTextBox2.TabIndex = 8; + this.richTextBox2.Text = ""; + // + // pictureBox5 + // + this.pictureBox5.Image = global::WindowsFormsApp1.Properties.Resources.FREINDS; + this.pictureBox5.Location = new System.Drawing.Point(563, 26); + this.pictureBox5.Name = "pictureBox5"; + this.pictureBox5.Size = new System.Drawing.Size(172, 51); + this.pictureBox5.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.pictureBox5.TabIndex = 9; + this.pictureBox5.TabStop = false; + // + // pictureBox4 + // + this.pictureBox4.Image = global::WindowsFormsApp1.Properties.Resources.SERVERS; + this.pictureBox4.Location = new System.Drawing.Point(352, 26); + this.pictureBox4.Name = "pictureBox4"; + this.pictureBox4.Size = new System.Drawing.Size(172, 51); + this.pictureBox4.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.pictureBox4.TabIndex = 7; + this.pictureBox4.TabStop = false; + this.pictureBox4.Click += new System.EventHandler(this.pictureBox4_Click); + // + // pictureBox3 + // + this.pictureBox3.Location = new System.Drawing.Point(12, 267); + this.pictureBox3.Name = "pictureBox3"; + this.pictureBox3.Size = new System.Drawing.Size(308, 122); + this.pictureBox3.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.pictureBox3.TabIndex = 6; + this.pictureBox3.TabStop = false; + // + // pictureBox2 + // + this.pictureBox2.Location = new System.Drawing.Point(12, 158); + this.pictureBox2.Name = "pictureBox2"; + this.pictureBox2.Size = new System.Drawing.Size(100, 103); + this.pictureBox2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.pictureBox2.TabIndex = 4; + this.pictureBox2.TabStop = false; + this.pictureBox2.Click += new System.EventHandler(this.pictureBox2_Click); + // + // pictureBox1 + // + this.pictureBox1.Image = global::WindowsFormsApp1.Properties.Resources.DAW; + this.pictureBox1.Location = new System.Drawing.Point(12, 12); + this.pictureBox1.Name = "pictureBox1"; + this.pictureBox1.Size = new System.Drawing.Size(311, 76); + this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.pictureBox1.TabIndex = 1; + this.pictureBox1.TabStop = false; + // + // richTextBox3 + // + this.richTextBox3.BackColor = System.Drawing.Color.White; + this.richTextBox3.BorderStyle = System.Windows.Forms.BorderStyle.None; + this.richTextBox3.Location = new System.Drawing.Point(563, 83); + this.richTextBox3.Name = "richTextBox3"; + this.richTextBox3.ReadOnly = true; + this.richTextBox3.Size = new System.Drawing.Size(172, 283); + this.richTextBox3.TabIndex = 10; + this.richTextBox3.Text = ""; + // + // button2 + // + this.button2.Location = new System.Drawing.Point(12, 120); + this.button2.Name = "button2"; + this.button2.Size = new System.Drawing.Size(116, 29); + this.button2.TabIndex = 11; + this.button2.Text = "Export Account"; + this.button2.UseVisualStyleBackColor = true; + this.button2.Click += new System.EventHandler(this.button2_Click); + // + // checkBox1 + // + this.checkBox1.AutoSize = true; + this.checkBox1.Location = new System.Drawing.Point(135, 126); + this.checkBox1.Name = "checkBox1"; + this.checkBox1.Size = new System.Drawing.Size(154, 17); + this.checkBox1.TabIndex = 12; + this.checkBox1.Text = "Friends Avatar Downloader"; + this.checkBox1.UseVisualStyleBackColor = true; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Font = new System.Drawing.Font("Segoe UI Black", 18.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label2.ForeColor = System.Drawing.Color.Lime; + this.label2.Location = new System.Drawing.Point(233, 406); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(307, 35); + this.label2.TabIndex = 13; + this.label2.Text = "Created By Zellias#0001"; + // + // Form1 + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.BackColor = System.Drawing.Color.White; + this.ClientSize = new System.Drawing.Size(762, 450); + this.Controls.Add(this.label2); + this.Controls.Add(this.checkBox1); + this.Controls.Add(this.button2); + this.Controls.Add(this.richTextBox3); + this.Controls.Add(this.pictureBox5); + this.Controls.Add(this.richTextBox2); + this.Controls.Add(this.pictureBox4); + this.Controls.Add(this.pictureBox3); + this.Controls.Add(this.richTextBox1); + this.Controls.Add(this.pictureBox2); + this.Controls.Add(this.button1); + this.Controls.Add(this.textBox1); + this.Controls.Add(this.pictureBox1); + this.Controls.Add(this.label1); + this.ForeColor = System.Drawing.SystemColors.MenuText; + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; + this.Name = "Form1"; + this.Opacity = 0.97D; + this.Text = "BT CHECKER"; + this.Load += new System.EventHandler(this.Form1_Load); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox5)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox4)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Label label1; + private System.Windows.Forms.PictureBox pictureBox1; + private System.Windows.Forms.TextBox textBox1; + private System.Windows.Forms.Button button1; + private System.Windows.Forms.PictureBox pictureBox2; + private System.Windows.Forms.RichTextBox richTextBox1; + private System.Windows.Forms.PictureBox pictureBox3; + private System.Windows.Forms.PictureBox pictureBox4; + private System.Windows.Forms.RichTextBox richTextBox2; + private System.Windows.Forms.PictureBox pictureBox5; + private System.Windows.Forms.RichTextBox richTextBox3; + private System.Windows.Forms.Button button2; + private System.Windows.Forms.CheckBox checkBox1; + private System.Windows.Forms.Label label2; + } +} + diff --git a/Form1.cs b/Form1.cs new file mode 100644 index 0000000..e885794 --- /dev/null +++ b/Form1.cs @@ -0,0 +1,222 @@ +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.Net.Http; +using System.Xml.Linq; +using Newtonsoft.Json; +using System.IO; +using System.Drawing.Imaging; +using System.Net; +using System.Runtime.InteropServices; + +namespace WindowsFormsApp1 +{ + public partial class Form1 : Form + { + string freindsList; + string serversList; + public Form1() + { + InitializeComponent(); + } + + private void Form1_Load(object sender, EventArgs e) + { + + + + + } + + + + private void label1_Click(object sender, EventArgs e) + { + + } + + private void button1_Click(object sender, EventArgs e) + { + + HttpClient httpClient = new HttpClient(); + HttpClient serversClient = new HttpClient(); + HttpClient friendsClient = new HttpClient(); + + httpClient.DefaultRequestHeaders.Add("authorization", textBox1.Text); + serversClient.DefaultRequestHeaders.Add("authorization", textBox1.Text); + friendsClient.DefaultRequestHeaders.Add("authorization", textBox1.Text); + + var endpoint = new Uri("https://discord.com/api/v10/users/@me"); + var endpointServers = new Uri("https://discord.com/api/v10/users/@me/guilds"); + var endpointFriends = new Uri("https://discord.com/api/v10/users/@me/relationships"); + + var result = httpClient.GetAsync(endpoint).Result; + var resultServers = httpClient.GetAsync(endpointServers).Result; + var resultFriends = httpClient.GetAsync(endpointFriends).Result; + + dynamic jsonServers = JsonConvert.DeserializeObject(resultServers.Content.ReadAsStringAsync().Result); + dynamic jsonFriends = JsonConvert.DeserializeObject(resultFriends.Content.ReadAsStringAsync().Result); + dynamic json = JsonConvert.DeserializeObject(result.Content.ReadAsStringAsync().Result); + + pictureBox3.ImageLocation = ""; + pictureBox2.ImageLocation = ""; + label1.Text = ""; + richTextBox1.Text = ""; + richTextBox2.Text = ""; + richTextBox3.Text = ""; + pictureBox3.ImageLocation = "https://cdn.discordapp.com/banners/" + json.id + "/" + json.banner + ".png?size=1024"; + pictureBox2.ImageLocation = "https://cdn.discordapp.com/avatars/"+ json.id + "/"+json.avatar+".png?size=1024"; + label1.Text = json.username+"#"+json.discriminator; + richTextBox1.Text = json.bio; + + + foreach (var item in jsonServers) + { + richTextBox2.Text += item.name + '\n' + '\n'; + } + foreach (var item in jsonFriends) + { + richTextBox3.Text += item.user.username + '\n'; + } + + + } + + private void textBox1_TextChanged(object sender, EventArgs e) + { + + } + + private void pictureBox2_Click(object sender, EventArgs e) + { + + } + + private void pictureBox4_Click(object sender, EventArgs e) + { + + } + public void SaveImage(string imageUrl, string filename, ImageFormat format) + { + WebClient client = new WebClient(); + Stream stream = client.OpenRead(imageUrl); + Bitmap bitmap; bitmap = new Bitmap(stream); + + if (bitmap != null) + { + bitmap.Save(filename, format); + } + + stream.Flush(); + stream.Close(); + client.Dispose(); + } + private void button2_Click(object sender, EventArgs e) + { + HttpClient httpClient = new HttpClient(); + HttpClient serversClient = new HttpClient(); + HttpClient friendsClient = new HttpClient(); + + httpClient.DefaultRequestHeaders.Add("authorization", textBox1.Text); + serversClient.DefaultRequestHeaders.Add("authorization", textBox1.Text); + friendsClient.DefaultRequestHeaders.Add("authorization", textBox1.Text); + + var endpoint = new Uri("https://discord.com/api/v10/users/@me"); + var endpointServers = new Uri("https://discord.com/api/v10/users/@me/guilds"); + var endpointFriends = new Uri("https://discord.com/api/v10/users/@me/relationships"); + + var result = httpClient.GetAsync(endpoint).Result; + var resultServers = httpClient.GetAsync(endpointServers).Result; + var resultFriends = httpClient.GetAsync(endpointFriends).Result; + + dynamic jsonServers = JsonConvert.DeserializeObject(resultServers.Content.ReadAsStringAsync().Result); + dynamic jsonFriends = JsonConvert.DeserializeObject(resultFriends.Content.ReadAsStringAsync().Result); + dynamic json = JsonConvert.DeserializeObject(result.Content.ReadAsStringAsync().Result); + + + if (!Directory.Exists("./Accounts")) + { + Directory.CreateDirectory("./Accounts"); + } + if (!Directory.Exists("./Accounts/"+json.username)) + { + Directory.CreateDirectory("./Accounts/" + json.username); + } + if (checkBox1.Checked) + { + + if (!Directory.Exists("./Accounts/" + json.username + "/Friends-Avatar")) + { + Directory.CreateDirectory("./Accounts/" + json.username+ "/Friends-Avatar"); + } + } + + foreach (var item in jsonServers) + { + serversList += item.name +':'+ item.id + '\n' + '\n'; + } + File.AppendAllText("./Accounts/" + json.username + "/servers.txt", serversList); + foreach (var item in jsonFriends) + { + freindsList += item.user.username + "#"+item.user.discriminator + '\n'; + } + File.AppendAllText("./Accounts/" + json.username + "/friends.txt", freindsList) ; + if (checkBox1.Checked) + { + + foreach (var item in jsonFriends) + { + try + { + if(item.user.avatar != null) + { + Console.WriteLine("Done"); + SaveImage("https://cdn.discordapp.com/avatars/" + item.user.id + "/" + item.user.avatar + ".png?size=1024", "./Accounts/" + json.username + "/Friends-Avatar"+"/"+item.user.id+".png", ImageFormat.Png); + } + } + catch (ExternalException) + { + + } + catch (ArgumentNullException) + { + + } + } + } + + + + try + { + SaveImage("https://cdn.discordapp.com/banners/" + json.id + "/" + json.banner + ".png?size=1024", "./Accounts/" + json.username +"/banner.png", ImageFormat.Png); +} + catch (ExternalException) + { + + } + catch (ArgumentNullException) + { + + } + try + { + SaveImage("https://cdn.discordapp.com/avatars/" + json.id + "/" + json.avatar + ".png?size=1024", "./Accounts/" + json.username + "/avatar.png", ImageFormat.Png); + } + catch (ExternalException) + { + + } + catch (ArgumentNullException) + { + + } + } + } +} diff --git a/Form1.resx b/Form1.resx new file mode 100644 index 0000000..29dcb1b --- /dev/null +++ b/Form1.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file