-
Notifications
You must be signed in to change notification settings - Fork 0
/
HWID Spoofer.cs
540 lines (438 loc) · 17.4 KB
/
HWID Spoofer.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;
using System.Security.Permissions;
using System.Management;
using Microsoft.Win32;
using System.Net.NetworkInformation;
using System.Text.RegularExpressions;
using System.Net.Mail;
using System.Net;
using System.IO;
using System.Diagnostics;
/*kode hex warna paling kiri : #6d96ed
' kode hex warna tangah : #7279ed
' kode hex warna paling kanan : #c330f8 */
namespace animated_rain_loading
{
/// <summary>
/// <!-- ============================================================= -->
///<!-- I will still be a beginner -->
///<!-- This program was developed by tobel -->
///<!-- Website : http://tobelsoft.my.id -->
///<!-- Whatsapp : https://wa.me/+14127755084 -->
///<!-- Facebook : https://facebook.com/fiko.tobel -->
///<!-- Instagram : https://www.instagram.com/fikotobel_ -->
///<!-- GitHub : https://github.com/fiko942 -->
///<!-- ============================================================= -->
/// </summary>
public partial class HWID_Spoofer : Form
{
//menambahkan fungsi moving form without border
int mov;
int movY;
int movX;
//----------------------------------------------
[DllImport("Gdi32.dll", EntryPoint = "CreateRoundRectRgn")]
private static extern IntPtr CreateRoundRectRgn(
int left,
int top,
int right,
int bottom,
int width,
int height
);
int[] rainSpeeds = { 4, 6, 8, 3, 5, 6, 7, 4 };
public class Adapter
{
public ManagementObject adapter;
public string adaptername;
public string customname;
public int devnum;
public Adapter(ManagementObject a, string aname, string cname, int n)
{
this.adapter = a;
this.adaptername = aname;
this.customname = cname;
this.devnum = n;
}
public Adapter(NetworkInterface i) : this(i.Description) { }
public Adapter(string aname)
{
this.adaptername = aname;
var searcher = new ManagementObjectSearcher("select * from win32_networkadapter where Name='" + adaptername + "'");
var found = searcher.Get();
this.adapter = found.Cast<ManagementObject>().FirstOrDefault();
try
{
var match = Regex.Match(adapter.Path.RelativePath, "\\\"(\\d+)\\\"$");
this.devnum = int.Parse(match.Groups[1].Value);
}
catch
{
return;
}
this.customname = NetworkInterface.GetAllNetworkInterfaces().Where(
i => i.Description == adaptername
).Select(
i => " (" + i.Name + ")"
).FirstOrDefault();
}
public NetworkInterface ManagedAdapter
{
get
{
return NetworkInterface.GetAllNetworkInterfaces().Where(
nic => nic.Description == this.adaptername
).FirstOrDefault();
}
}
public string Mac
{
get
{
try
{
return BitConverter.ToString(this.ManagedAdapter.GetPhysicalAddress().GetAddressBytes()).Replace("-", "").ToUpper();
}
catch { return null; }
}
}
public string RegistryKey
{
get
{
return String.Format(@"SYSTEM\ControlSet001\Control\Class\{{4D36E972-E325-11CE-BFC1-08002BE10318}}\{0:D4}", this.devnum);
}
}
public string RegistryMac
{
get
{
try
{
using (RegistryKey regkey = Registry.LocalMachine.OpenSubKey(this.RegistryKey, false))
{
return regkey.GetValue("NetworkAddress").ToString();
}
}
catch
{
return null;
}
}
}
public bool SetRegistryMac(string value)
{
bool shouldReenable = false;
try
{
if (value.Length > 0 && !Adapter.IsValidMac(value, false))
throw new Exception(value + " bukan alamat mac yang valid");
using (RegistryKey regkey = Registry.LocalMachine.OpenSubKey(this.RegistryKey, true))
{
if (regkey == null)
throw new Exception("Gagal membuka registry key");
if (regkey.GetValue("AdapterModel") as string != this.adaptername
&& regkey.GetValue("DriverDesc") as string != this.adaptername)
throw new Exception("Adapter tidak ditemukan di registry");
string question = value.Length > 0 ?
"Yakin ingin mengubah alamat MAC adaptor {0} dari {1} menjadi {2} ?" :
"Yakin ingin mengembalikan custom alamat MAC dari adaptor {0} ?";
DialogResult proceed = MessageBox.Show(
String.Format(question, this.ToString(), this.Mac, value),
"HWID Spoofer", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (proceed != DialogResult.Yes)
return false;
var result = (uint)adapter.InvokeMethod("Disable", null);
if (result != 0)
throw new Exception("Gagal menonaktifkan adapter");
shouldReenable = true;
if (value.Length > 0)
regkey.SetValue("NetworkAddress", value, RegistryValueKind.String);
else
regkey.DeleteValue("NetworkAddress");
return true;
}
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
return false;
}
finally
{
if (shouldReenable)
{
uint result = (uint)adapter.InvokeMethod("Enable", null);
if (result != 0)
MessageBox.Show("Gagal mengaktifkan ulang adapter");
}
}
}
public override string ToString()
{
return this.adaptername + this.customname;
}
public static string GetNewMac()
{
System.Random r = new System.Random();
byte[] bytes = new byte[6];
r.NextBytes(bytes);
bytes[0] = (byte)(bytes[0] | 0x02);
bytes[0] = (byte)(bytes[0] & 0xfe);
return MacToString(bytes);
}
public static bool IsValidMac(string mac, bool actual)
{
if (mac.Length != 12)
return false;
if (mac != mac.ToUpper())
return false;
if (!Regex.IsMatch(mac, "^[0-9A-F]*$"))
return false;
if (actual)
return true;
char c = mac[1];
return (c == '2' || c == '6' || c == 'A' || c == 'E');
}
public static bool IsValidMac(byte[] bytes, bool actual)
{
return IsValidMac(Adapter.MacToString(bytes), actual);
}
public static string MacToString(byte[] bytes)
{
return BitConverter.ToString(bytes).Replace("-", "").ToUpper();
}
}
public HWID_Spoofer()
{
InitializeComponent();
//menambahkan fungsi draw border
Region = System.Drawing.Region.FromHrgn(CreateRoundRectRgn(0, 0, Width, Height, 7, 7));
//menambahkan fungsi konfirmasi exit
this.Closing += new System.ComponentModel.CancelEventHandler(this.FormClosingEventCancle_Closing);
}
private void HWID_Spoofer_Load(object sender, EventArgs e)
{
CheckForIllegalCrossThreadCalls = false;
guna2ShadowForm1.SetShadowForm(this);
guna2AnimateWindow1.SetAnimateWindow(this);
foreach (NetworkInterface adapter in NetworkInterface.GetAllNetworkInterfaces().Where(
a => Adapter.IsValidMac(a.GetPhysicalAddress().GetAddressBytes(), true)
).OrderByDescending(a => a.Speed))
{
AdaptersComboBox.Items.Add(new Adapter(adapter));
}
AdaptersComboBox.SelectedIndex = 0;
}
private void UpdateAddresses()
{
Adapter a = AdaptersComboBox.SelectedItem as Adapter;
this.CurrentMacTextBox.Text = a.RegistryMac;
this.label1.Text = "Active MAC address : " + a.Mac;
}
private void AdaptersComboBox_SelectedIndexChanged(object sender, EventArgs e)
{
UpdateAddresses();
}
private void RandomButton_Click(object sender, EventArgs e)
{
CurrentMacTextBox.Text = Adapter.GetNewMac();
}
private void ClearButton_Click(object sender, EventArgs e)
{
SetRegistryMac("");
}
private void SetRegistryMac(string mac)
{
Adapter a = AdaptersComboBox.SelectedItem as Adapter;
if (a.SetRegistryMac(mac))
{
System.Threading.Thread.Sleep(100);
UpdateAddresses();
MessageBox.Show("Berhasil mengubah alamat MAC", "HWID Spoofer", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
private void RereadButton_Click(object sender, EventArgs e)
{
UpdateAddresses();
}
private void CurrentMacTextBox_TextChanged(object sender, EventArgs e)
{
this.guna2GradientButton1.Enabled = Adapter.IsValidMac(this.CurrentMacTextBox.Text, false);
}
private void Button2_Click(object sender, EventArgs e)
{
UpdateAddresses();
}
private void guna2Button1_Click(object sender, EventArgs e)
{
CurrentMacTextBox.Text = Adapter.GetNewMac();
}
private void guna2Button2_Click(object sender, EventArgs e)
{
if (!Adapter.IsValidMac(CurrentMacTextBox.Text, false))
{
MessageBox.Show("Alamat MAC tidak valid", "HWID Spoofer", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
SetRegistryMac(CurrentMacTextBox.Text);
}
private void FormClosingEventCancle_Closing(object sender, System.ComponentModel.CancelEventArgs e)
{
//jika ditekan close dimanapun maka akan menampilkan konfirmasi penutupan aplikasi
DialogResult dr = MessageBox.Show("Are you sure to close this program now ?", "HWID Spoofer | TobelSoft", MessageBoxButtons.YesNo);
if (dr == DialogResult.No)
//jika tombol yes ditekan maka akan membatalkan penutupan aplikasi
e.Cancel = true;
else
//jika tombol no ditekan maka akan menutup aplikasi
Application.Exit();
}
private void panel1_MouseDown(object sender, MouseEventArgs e)
{
mov = 1;
movX = e.X;
movY = e.Y;
}
private void panel1_MouseMove(object sender, MouseEventArgs e)
{
if (mov == 1)
{
this.SetDesktopLocation(MousePosition.X - movX, MousePosition.Y - movY);
}
}
private void panel1_MouseUp(object sender, MouseEventArgs e)
{
mov = 0;
}
private void pictureBox2_Click(object sender, EventArgs e)
{
this.WindowState = FormWindowState.Minimized;
}
private void pictureBox1_Click(object sender, EventArgs e)
{
this.Close();
}
private void label1_MouseDown(object sender, MouseEventArgs e)
{
mov = 1;
movX = e.X;
movY = e.Y;
}
private void label1_MouseMove(object sender, MouseEventArgs e)
{
if (mov == 1)
{
this.SetDesktopLocation(MousePosition.X - movX, MousePosition.Y - movY);
}
}
private void label1_MouseUp(object sender, MouseEventArgs e)
{
mov = 0;
}
private void pictureBox3_MouseDown(object sender, MouseEventArgs e)
{
mov = 1;
movX = e.X;
movY = e.Y;
}
private void pictureBox3_MouseMove(object sender, MouseEventArgs e)
{
if (mov == 1)
{
this.SetDesktopLocation(MousePosition.X - movX, MousePosition.Y - movY);
}
}
private void pictureBox3_MouseUp(object sender, MouseEventArgs e)
{
mov = 0;
}
private void pictureBox4_Click(object sender, EventArgs e)
{
System.Diagnostics.Process.Start("https://tobelsoft.my.id");
}
private void Button2_Click_1(object sender, System.EventArgs e)
{
UpdateAddresses();
}
private void buttonGenerate_Click(object sender, System.EventArgs e)
{
CurrentMacTextBox.Text = Adapter.GetNewMac();
}
private void ClearButton_Click_1(object sender, System.EventArgs e)
{
SetRegistryMac("");
}
private void UpdateButton_Click(object sender, System.EventArgs e)
{
if (!Adapter.IsValidMac(CurrentMacTextBox.Text, false))
{
MessageBox.Show("Alamat MAC tidak valid", "HWID Spoofer", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
SetRegistryMac(CurrentMacTextBox.Text);
}
private void guna2ControlBox1_Click(object sender, System.EventArgs e)
{
}
private void guna2GradientButton1_Click(object sender, System.EventArgs e)
{
SetRegistryMac("");
}
private void guna2GradientButton2_Click(object sender, System.EventArgs e)
{
if (!Adapter.IsValidMac(CurrentMacTextBox.Text, false))
{
MessageBox.Show("Alamat MAC tidak valid", "HWID Spoofer", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
SetRegistryMac(CurrentMacTextBox.Text);
}
private void guna2GradientButton2_Click_1(object sender, System.EventArgs e)
{
CurrentMacTextBox.Text = Adapter.GetNewMac();
}
private void CurrentMacTextBox_TextChanged_1(object sender, System.EventArgs e)
{
}
private void guna2GradientButton2_Click_2(object sender, System.EventArgs e)
{
UpdateAddresses();
}
private void guna2GradientPanel4_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
{
}
private void guna2GradientPanel1_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
{
}
private void guna2GradientButton3_Click(object sender, System.EventArgs e)
{
}
private void guna2GradientButton4_Click(object sender, System.EventArgs e)
{
}
private void guna2GradientButton6_Click(object sender, System.EventArgs e)
{
}
private void guna2GradientButton5_Click_1(object sender, System.EventArgs e)
{
}
private void pnlCheat_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
{
}
private void send_DoWork(object sender, DoWorkEventArgs e)
{
}
private void controller_Tick(object sender, EventArgs e)
{
}
}
}