-
Notifications
You must be signed in to change notification settings - Fork 0
/
Form1.cs
1067 lines (933 loc) · 43 KB
/
Form1.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
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
using cw;
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.Numerics;
using System.Text;
using System.Threading;
using System.Windows.Forms;
namespace CW_Beach
{
public partial class MainForm : Form
{
private Thread rapidFireT;
private Thread instaKillT;
private Thread namePlayerT;
private Thread currentWeaponT;
private Thread tpZombiT;
private Thread freeze0T;
private Thread freeze1T;
private Thread freeze2T;
private Thread freeze3T;
//-----------------------------------------------------------------------------------------------------------------------
public IntPtr PlayerCompPtr, PlayerPedPtr, ZMGlobalBase, ZMBotBase, ZMBotListBase;
public string currentVersion = "Change adress if CW is not 1.25.4";
public int gamePID = 0;
public IntPtr hProc;
public IntPtr baseAddress = IntPtr.Zero;
public Process gameProc;
public Color defaultColor = Color.Black;
public bool isrunning = false;
public bool ammoFrozen;
public bool uneFois = true;
public Single playerSpeed = -1f;
public Vector3 frozenPlayerPos = Vector3.Zero;
public Vector3 lastKnownPlayerPos = Vector3.Zero;
public Vector3 updatedPlayerPos = Vector3.Zero;
public Vector3 zombieTpPos;
public int[] ammoVals = new int[6];
public int[] maxAmmoVals = new int[6];
public Single TimesModifier = 1.0f;
public void consoleOut(string str)
{
logsText.Invoke(new MethodInvoker(delegate
{
logsText.AppendText(str);
logsText.AppendText(Environment.NewLine);
}));
}
public void UpdateTextBox(TextBox textbox, string str)
{
textbox.Invoke(new MethodInvoker(delegate
{
textbox.Clear();
textbox.AppendText(str);
}));
}
public void UpdateLabel(Label label, string text, string color = "Black")
{
if (this.InvokeRequired)
{
label.Invoke((MethodInvoker)delegate ()
{
label.Text = text;
label.ForeColor = Color.FromName(color);
});
return;
}
label.Text = text;
label.ForeColor = Color.FromName(color);
}
private void godmodCheck_CheckedChanged(object sender, EventArgs e)
{
if (godmodCheck.Checked)
{
consoleOut("GODMOD ON");
}
else
{
consoleOut("GODMOD OFF");
}
}
private void attachButton_Click(object sender, EventArgs e)
{
isrunning = !isrunning;
if (isrunning)
{
attachButton.Text = "RUNNING";
attachButton.ForeColor = Color.Green;
}
else
{
attachButton.Text = "STOPPED";
attachButton.ForeColor = Color.Red;
}
changeAdressButton.Enabled = false;
playerBaseTextBox.Enabled = false;
xpScaleTextBox.Enabled = false;
cmdBufferTextBox.Enabled = false;
}
public MainForm()
{
InitializeComponent();
}
private void rapifFirecheck_CheckedChanged(object sender, EventArgs e)
{
if (rapifFirecheck.Checked)
{
rapidFireT = new Thread(RapidFire) { IsBackground = true };
rapidFireT.Start();
}
else
{
rapidFireT.Abort();
}
}
private void moveSpeedTrackBar_Scroll(object sender, EventArgs e)
{
moveSpeedLabel.Text = moveSpeedTrackBar.Value.ToString();
playerSpeed = moveSpeedTrackBar.Value;
cwapi.WriteProcessMemory(hProc, PlayerCompPtr + AdressOffset.PC_RunSpeed, Convert.ToSingle(playerSpeed), 4, out _);
}
private void instaKillCheck_CheckedChanged(object sender, EventArgs e)
{
if (instaKillCheck.Checked)
{
instaKillT = new Thread(InstaKill) { IsBackground = true };
instaKillT.Start();
}
else
{
instaKillT.Abort();
}
}
private void MainForm_Load(object sender, EventArgs e)
{
consoleOut(currentVersion);
consoleOut("Press \"ok\" for unlock attach.");
tpZombiT = new Thread(TpZombie) { IsBackground = true };
tpZombiT.Start();
if (!backgroundWorker1.IsBusy) backgroundWorker1.RunWorkerAsync();
playerBaseTextBox.Text = "0x" + AdressOffset.PlayerBase.ToInt64().ToString("X");
cmdBufferTextBox.Text = "0x" + AdressOffset.CMDBufferBase.ToInt64().ToString("X");
xpScaleTextBox.Text = "0x" + AdressOffset.XPScaleBase.ToInt64().ToString("X");
}
private void thermalScopeCheck_CheckedChanged(object sender, EventArgs e)
{
if (thermalScopeCheck.Checked)
{
cwapi.WriteProcessMemory(hProc, PlayerCompPtr + AdressOffset.PC_InfraredVision, 0x10, 1, out _);
logsText.AppendText("THERMAL SCOPE ON (reset if escaping)");
logsText.AppendText(Environment.NewLine);
}
else
{
cwapi.WriteProcessMemory(hProc, PlayerCompPtr + AdressOffset.PC_InfraredVision, 0x0, 1, out _);
logsText.AppendText("THERMAL SCOPE OFF");
logsText.AppendText(Environment.NewLine);
}
}
private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
{
int c = 0;
bool verif = false;
while (true)
{
try
{
if (godmodCheck.Enabled && !isrunning)
{
godmodCheck.Enabled = false;
munInfCheck.Enabled = false;
moneyInfCheck.Enabled = false;
rapifFirecheck.Enabled = false;
instaKillCheck.Enabled = false;
moveSpeedTrackBar.Enabled = false;
thermalScopeCheck.Enabled = false;
tpZombiCheck.Enabled = false;
changeWeaponButton.Enabled = false;
godmodeAllCheck.Enabled = false;
munitionInfAllCheck.Enabled = false;
tpZombieSavePointCheck.Enabled = false;
infMoneyAllCheck.Enabled = false;
changeWPP2.Enabled = false;
changeWPP3.Enabled = false;
changeWPP4.Enabled = false;
critKillCheck.Enabled = false;
allCritKill.Enabled = false;
autoFireCheck.Enabled = false;
freeze0Check.Enabled = false;
freeze1Check.Enabled = false;
freeze2Check.Enabled = false;
freeze3Check.Enabled = false;
cmdBufferInput.Enabled = false;
cmdBufferBtn.Enabled = false;
kick2.Enabled = false;
Kick3.Enabled = false;
Kick4.Enabled = false;
//activeXPCheck.Enabled = false;
godmodCheck.Checked = false;
munInfCheck.Checked = false;
moneyInfCheck.Checked = false;
rapifFirecheck.Checked = false;
instaKillCheck.Checked = false;
moveSpeedTrackBar.Value = 1;
thermalScopeCheck.Checked = false;
tpZombiCheck.Checked = false;
godmodeAllCheck.Checked = false;
munitionInfAllCheck.Checked = false;
tpZombieSavePointCheck.Checked = false;
infMoneyAllCheck.Checked = false;
critKillCheck.Checked = false;
allCritKill.Checked = false;
autoFireCheck.Checked = false;
freeze0Check.Checked = false;
freeze1Check.Checked = false;
freeze2Check.Checked = false;
freeze3Check.Checked = false;
//activeXPCheck.Checked = false;
}
if (!isrunning)
{
Thread.Sleep(100);
continue;
}
var gameProcs = Process.GetProcessesByName("BlackOpsColdWar");
// if there aren't any processes, update the game message label and do nothing
if (gameProcs.Length < 1)
{
consoleOut("GAME NOT RUNNING !");
Thread.Sleep(100);
continue;
}
// get first process from the gameProcs array
gameProc = gameProcs[0];
gamePID = gameProc.Id;
if (gamePID < 1)
{
consoleOut("Game is not running");
Thread.Sleep(100);
continue;
}
// opens the process or something, not 100% still learning all this terminology
hProc = cwapi.OpenProcess(cwapi.ProcessAccessFlags.All, false, gameProc.Id);
// if the base address isn't uptodate, update it
if (baseAddress != cwapi.GetModuleBaseAddress(gameProc, "BlackOpsColdWar.exe"))
{
baseAddress = cwapi.GetModuleBaseAddress(gameProc, "BlackOpsColdWar.exe");
c++;
consoleOut($"Adresse catch ({c}/6)");
}
// cache the base addresses for these various pointers
if (PlayerCompPtr != cwapi.FindDMAAddy(hProc, (IntPtr)(baseAddress.ToInt64() + AdressOffset.PlayerBase.ToInt64()), new int[] { 0 }))
{
PlayerCompPtr = cwapi.FindDMAAddy(hProc, (IntPtr)(baseAddress.ToInt64() + AdressOffset.PlayerBase.ToInt64()), new int[] { 0 });
c++;
consoleOut($"Adresse catch ({c}/6)");
}
if (PlayerPedPtr != cwapi.FindDMAAddy(hProc, (IntPtr)(baseAddress.ToInt64() + AdressOffset.PlayerBase.ToInt64() + 0x8), new int[] { 0 }))
{
PlayerPedPtr = cwapi.FindDMAAddy(hProc, (IntPtr)(baseAddress.ToInt64() + AdressOffset.PlayerBase.ToInt64() + 0x8), new int[] { 0 });
c++;
consoleOut($"Adresse catch ({c}/6)");
}
if (ZMGlobalBase != cwapi.FindDMAAddy(hProc, (IntPtr)(baseAddress.ToInt64() + AdressOffset.PlayerBase.ToInt64() + 0x60), new int[] { 0 }))
{
ZMGlobalBase = cwapi.FindDMAAddy(hProc, (IntPtr)(baseAddress.ToInt64() + AdressOffset.PlayerBase.ToInt64() + 0x60), new int[] { 0 });
c++;
consoleOut($"Adresse catch ({c}/6)");
}
if (ZMBotBase != cwapi.FindDMAAddy(hProc, (IntPtr)(baseAddress.ToInt64() + AdressOffset.PlayerBase.ToInt64() + 0x68), new int[] { 0 }))
{
ZMBotBase = cwapi.FindDMAAddy(hProc, (IntPtr)(baseAddress.ToInt64() + AdressOffset.PlayerBase.ToInt64()) + 0x68, new int[] { 0 });
c++;
consoleOut($"Adresse catch ({c}/6)");
}
if (ZMBotBase != (IntPtr)0x0 && ZMBotBase != (IntPtr)0x68 && ZMBotListBase != cwapi.FindDMAAddy(hProc, ZMBotBase + AdressOffset.ZM_Bot_List_Offset, new int[] { 0 }))
{
ZMBotListBase = cwapi.FindDMAAddy(hProc, ZMBotBase + AdressOffset.ZM_Bot_List_Offset, new int[] { 0 });
c++;
consoleOut($"Adresse catch ({c}/6)");
}
if (!verif && c != 6)
{
verif = true;
consoleOut("CARE ALL FEATURE DON'T WORK!!!");
}
if (godmodeAllCheck.Checked | godmodCheck.Checked)
{
if (godmodCheck.Checked)
{
cwapi.WriteProcessMemory(hProc, PlayerCompPtr + AdressOffset.PC_GodMode, 0xA0, 1, out _);
}
if (godmodeAllCheck.Checked)
{
for (int i = 0; i < 4; i++)
{
cwapi.WriteProcessMemory(hProc, PlayerCompPtr + (AdressOffset.PC_ArraySize_Offset * i) + AdressOffset.PC_GodMode, 0xA0, 1, out _);
}
}
}
else
{
for (int i = 0; i < 4; i++)
{
cwapi.WriteProcessMemory(hProc, PlayerCompPtr + (AdressOffset.PC_ArraySize_Offset * i) + AdressOffset.PC_GodMode, 0x20, 1, out _);
}
}
if (critKillCheck.Checked | allCritKill.Checked)
{
if (critKillCheck.Checked)
{
cwapi.WriteProcessMemory(hProc, PlayerCompPtr + AdressOffset.CritKill8, -1, 1, out _);
}
if (allCritKill.Checked)
{
for (int i = 0; i < 4; i++)
{
cwapi.WriteProcessMemory(hProc, PlayerCompPtr + (AdressOffset.PC_ArraySize_Offset * i) + AdressOffset.CritKill8, -1, 1, out _);
}
}
}
else
{
for (int i = 0; i < 4; i++)
{
cwapi.WriteProcessMemory(hProc, PlayerCompPtr + (AdressOffset.PC_ArraySize_Offset * i) + AdressOffset.CritKill8, 0, 1, out _);
}
}
if (munInfCheck.Checked)
{
for (int i = 1; i < 6; i++)
{
cwapi.WriteProcessMemory(hProc, PlayerCompPtr + AdressOffset.PC_Ammo + (i * 0x4), 100, 4, out _);
}
}
if (munitionInfAllCheck.Checked)
{
for (int i = 0; i < 4; i++)
{
for (int j = 1; j < 6; j++)
{
cwapi.WriteProcessMemory(hProc, PlayerCompPtr + (AdressOffset.PC_ArraySize_Offset * i) + AdressOffset.PC_Ammo + (j * 0x4), 100, 4, out _);
}
}
}
if (infMoneyAllCheck.Checked)
{
for (int i = 0; i < 4; i++)
{
cwapi.WriteProcessMemory(hProc, PlayerCompPtr + (AdressOffset.PC_ArraySize_Offset * i) + AdressOffset.PC_Points, 8000000, 4, out _);
}
}
if (moneyInfCheck.Checked)
{
cwapi.WriteProcessMemory(hProc, PlayerCompPtr + AdressOffset.PC_Points, 8000000, 4, out _);
}
if (autoFireCheck.Checked)
{
cwapi.WriteProcessMemory(hProc, PlayerCompPtr + AdressOffset.PC_autoFire, 1, 1, out _);
}
if (uneFois)
{
namePlayerT = new Thread(StatPlayerGrab) { IsBackground = true };
namePlayerT.Start();
currentWeaponT = new Thread(CurrentWeapon) { IsBackground = true };
currentWeaponT.Start();
uneFois = false;
}
if (!godmodCheck.Enabled)
{
godmodCheck.Enabled = true;
munInfCheck.Enabled = true;
moneyInfCheck.Enabled = true;
rapifFirecheck.Enabled = true;
instaKillCheck.Enabled = true;
moveSpeedTrackBar.Enabled = true;
thermalScopeCheck.Enabled = true;
tpZombiCheck.Enabled = true;
changeWeaponButton.Enabled = true;
godmodeAllCheck.Enabled = true;
munitionInfAllCheck.Enabled = true;
tpZombieSavePointCheck.Enabled = true;
infMoneyAllCheck.Enabled = true;
changeWPP2.Enabled = true;
changeWPP3.Enabled = true;
changeWPP4.Enabled = true;
critKillCheck.Enabled = true;
allCritKill.Enabled = true;
autoFireCheck.Enabled = true;
//activeXPCheck.Enabled = true;
cmdBufferInput.Enabled = true;
cmdBufferBtn.Enabled = true;
kick2.Enabled = true;
Kick3.Enabled = true;
Kick4.Enabled = true;
freeze0Check.Enabled = true;
freeze1Check.Enabled = true;
freeze2Check.Enabled = true;
freeze3Check.Enabled = true;
}
}
catch (Exception err)
{
consoleOut(err.Message);
}
Thread.Sleep(40);
}
}
private void tpZombiCheck_CheckedChanged(object sender, EventArgs e)
{
if (tpZombiCheck.Checked)
{
tpZombieSavePointCheck.Checked = false;
}
}
private void tpZombieSavePointCheck_CheckedChanged(object sender, EventArgs e)
{
if (tpZombieSavePointCheck.Checked)
{
tpZombiCheck.Checked = false;
}
}
private void xpPlayerBar_Scroll(object sender, EventArgs e)
{
/*byte[] tBuff = new byte[4];
Buffer.BlockCopy(BitConverter.GetBytes((float)xpPlayerBar.Value), 0, tBuff, 0, 4);
xpPlayerLabel.Text = BitConverter.ToSingle(tBuff, 0).ToString();
cwapi.WriteProcessMemory(hProc, (IntPtr)(baseAddress.ToInt64() + XPScaleBase.ToInt64()) + PlayerXP, tBuff, 4, out _);
cwapi.WriteProcessMemory(hProc, (IntPtr)(baseAddress.ToInt64() + XPScaleBase.ToInt64()) + PlayerXP2, tBuff, 4, out _);
cwapi.ReadProcessMemory(hProc, (IntPtr)(baseAddress.ToInt64() + XPScaleBase.ToInt64()) + PlayerXP, tBuff, 4, out _);
xpWeaponLabel.Text = BitConverter.ToSingle(tBuff, 0).ToString();*/
}
private void xpWeaponBar_Scroll(object sender, EventArgs e)
{
/*byte[] tBuff = new byte[4];
Buffer.BlockCopy(BitConverter.GetBytes((float)xpWeaponBar.Value), 0, tBuff, 0, 4);
cwapi.WriteProcessMemory(hProc, (IntPtr)(baseAddress.ToInt64() + XPScaleBase.ToInt64()) + WeaponXP, tBuff, 4, out _);
cwapi.ReadProcessMemory(hProc, (IntPtr)(baseAddress.ToInt64() + XPScaleBase.ToInt64()) + WeaponXP, tBuff, 4, out _);
xpWeaponLabel.Text = BitConverter.ToSingle(tBuff, 0).ToString();*/
}
private void setWeaponText_KeyPress(object sender, KeyPressEventArgs e)
{
if (!char.IsControl(e.KeyChar) && !char.IsDigit(e.KeyChar) && (e.KeyChar != '-'))
{
e.Handled = true;
}
}
private void button1_Click(object sender, EventArgs e)
{
Process.Start("https://www.unknowncheats.me/forum/3265024-post2151.html");
}
private void godmodeAllCheck_CheckedChanged(object sender, EventArgs e)
{
if (godmodeAllCheck.Checked)
{
consoleOut("GODMOD ALL ON");
}
else
{
consoleOut("GODMOD ALL OFF");
}
}
private void xpWeaponLabel_Click(object sender, EventArgs e)
{
}
private void groupBox6_Enter(object sender, EventArgs e)
{
}
private void player3_Click(object sender, EventArgs e)
{
}
private void changeWPP2_Click(object sender, EventArgs e)
{
long x = long.Parse(wpP2Text.Text);
cwapi.WriteProcessMemory(hProc, PlayerCompPtr + AdressOffset.PC_ArraySize_Offset + AdressOffset.PC_SetWeaponID, x, 8, out _);
}
private void changeWPP3_Click(object sender, EventArgs e)
{
long x = long.Parse(wpP3Text.Text);
cwapi.WriteProcessMemory(hProc, PlayerCompPtr + (AdressOffset.PC_ArraySize_Offset * 2) + AdressOffset.PC_SetWeaponID, x, 8, out _);
}
private void changeWPP4_Click(object sender, EventArgs e)
{
long x = long.Parse(wpP4Text.Text);
cwapi.WriteProcessMemory(hProc, PlayerCompPtr + (AdressOffset.PC_ArraySize_Offset * 3) + AdressOffset.PC_SetWeaponID, x, 8, out _);
}
private void changeWeaponButton_Click(object sender, EventArgs e)
{
long x = long.Parse(setWeaponText.Text);
cwapi.WriteProcessMemory(hProc, PlayerCompPtr + AdressOffset.PC_SetWeaponID, x, 8, out _);
}
private void autoFireCheck_CheckedChanged(object sender, EventArgs e)
{
}
private void distanceTPBar_Scroll(object sender, EventArgs e)
{
distanceTPLabel.Text = distanceTPBar.Value.ToString();
}
private void critKillCheck_CheckedChanged(object sender, EventArgs e)
{
}
private void kick2_Click(object sender, EventArgs e)
{
CmdBufferExec("clientkick 1");
}
private void killLobbyBtn_Click(object sender, EventArgs e)
{
attachGame();
CmdBufferExec("xstoppartykeeptogether");
CmdBufferExec("hostmigration_start");
CmdBufferExec("killserver");
CmdBufferExec("disconnect");
}
private void Kick3_Click(object sender, EventArgs e)
{
CmdBufferExec("clientkick 2");
}
private void Kick4_Click(object sender, EventArgs e)
{
CmdBufferExec("clientkick 3");
}
private void instantSartBtn_Click(object sender, EventArgs e)
{
attachGame();
for (int i = 0; i < 3; i++)
{
CmdBufferExec("LobbyLaunchGame");
}
}
private void cmdBufferBtn_Click(object sender, EventArgs e)
{
CmdBufferExec(cmdBufferInput.Text);
}
private void freeze0Check_CheckedChanged(object sender, EventArgs e)
{
if (freeze0Check.Checked)
{
freeze0T = new Thread(freezePlayer) { IsBackground = true };
freeze0T.Start(0);
}
else
{
freeze0T.Abort();
}
}
private void freeze1Check_CheckedChanged(object sender, EventArgs e)
{
if (freeze1Check.Checked)
{
freeze1T = new Thread(freezePlayer) { IsBackground = true };
freeze1T.Start(1);
}
else
{
freeze1T.Abort();
}
}
private void freeze2Check_CheckedChanged(object sender, EventArgs e)
{
if (freeze2Check.Checked)
{
freeze2T = new Thread(freezePlayer) { IsBackground = true };
freeze2T.Start(2);
}
else
{
freeze2T.Abort();
}
}
private void freeze3Check_CheckedChanged(object sender, EventArgs e)
{
if (freeze3Check.Checked)
{
freeze3T = new Thread(freezePlayer) { IsBackground = true };
freeze3T.Start(3);
}
else
{
freeze3T.Abort();
}
}
private void topMostButton_CheckedChanged(object sender, EventArgs e)
{
if (topMostButton.Checked)
{
TopMost = true;
}
else
{
TopMost = true;
}
}
private void changeAdressButton_Click(object sender, EventArgs e)
{
long pbTmp, cmdTmp, xpTmp;
if (playerBaseTextBox.Text.StartsWith("0x"))
{
pbTmp = long.Parse(playerBaseTextBox.Text.Substring(2), System.Globalization.NumberStyles.HexNumber);
AdressOffset.PlayerBase = new IntPtr(pbTmp);
}
else
{
pbTmp = long.Parse(playerBaseTextBox.Text, System.Globalization.NumberStyles.HexNumber);
AdressOffset.PlayerBase = new IntPtr(pbTmp);
}
if (cmdBufferTextBox.Text.StartsWith("0x"))
{
cmdTmp = long.Parse(cmdBufferTextBox.Text.Substring(2), System.Globalization.NumberStyles.HexNumber);
AdressOffset.CMDBufferBase = new IntPtr(cmdTmp);
}
else
{
cmdTmp = long.Parse(cmdBufferTextBox.Text, System.Globalization.NumberStyles.HexNumber);
AdressOffset.CMDBufferBase = new IntPtr(cmdTmp);
}
if (xpScaleTextBox.Text.StartsWith("0x"))
{
xpTmp = long.Parse(xpScaleTextBox.Text.Substring(2), System.Globalization.NumberStyles.HexNumber);
AdressOffset.XPScaleBase = new IntPtr(xpTmp);
}
else
{
xpTmp = long.Parse(xpScaleTextBox.Text, System.Globalization.NumberStyles.HexNumber);
AdressOffset.XPScaleBase = new IntPtr(xpTmp);
}
consoleOut("PlayerBase adress set : " + "0x" + AdressOffset.PlayerBase.ToInt64().ToString("X"));
consoleOut("Cmdbuffer adress set : " + "0x" + AdressOffset.CMDBufferBase.ToInt64().ToString("X"));
consoleOut("Xpscale adress set : " + "0x" + AdressOffset.XPScaleBase.ToInt64().ToString("X"));
attachButton.Enabled = true;
}
private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
{
try
{
godmodCheck.Enabled = false;
munInfCheck.Enabled = false;
moneyInfCheck.Enabled = false;
rapifFirecheck.Enabled = false;
instaKillCheck.Enabled = false;
moveSpeedTrackBar.Enabled = false;
thermalScopeCheck.Enabled = false;
tpZombiCheck.Enabled = false;
changeWeaponButton.Enabled = false;
godmodeAllCheck.Enabled = false;
munitionInfAllCheck.Enabled = false;
tpZombieSavePointCheck.Enabled = false;
infMoneyAllCheck.Enabled = false;
changeWPP2.Enabled = false;
changeWPP3.Enabled = false;
changeWPP4.Enabled = false;
critKillCheck.Enabled = false;
allCritKill.Enabled = false;
autoFireCheck.Enabled = false;
freeze0Check.Enabled = false;
freeze1Check.Enabled = false;
freeze2Check.Enabled = false;
freeze3Check.Enabled = false;
cmdBufferInput.Enabled = false;
cmdBufferBtn.Enabled = false;
kick2.Enabled = false;
Kick3.Enabled = false;
Kick4.Enabled = false;
//activeXPCheck.Enabled = false;
godmodCheck.Checked = false;
munInfCheck.Checked = false;
moneyInfCheck.Checked = false;
rapifFirecheck.Checked = false;
instaKillCheck.Checked = false;
moveSpeedTrackBar.Value = 1;
thermalScopeCheck.Checked = false;
tpZombiCheck.Checked = false;
godmodeAllCheck.Checked = false;
munitionInfAllCheck.Checked = false;
tpZombieSavePointCheck.Checked = false;
infMoneyAllCheck.Checked = false;
critKillCheck.Checked = false;
allCritKill.Checked = false;
autoFireCheck.Checked = false;
freeze0Check.Checked = false;
freeze1Check.Checked = false;
freeze2Check.Checked = false;
freeze3Check.Checked = false;
//activeXPCheck.Checked = false;
var gameProcs = Process.GetProcessesByName("BlackOpsColdWar");
if (gameProcs.Length < 1) return;
gameProc = gameProcs[0];
gamePID = gameProc.Id;
if (gamePID < 1) return;
hProc = cwapi.OpenProcess(cwapi.ProcessAccessFlags.All, false, gameProc.Id);
if (baseAddress != cwapi.GetModuleBaseAddress(gameProc, "BlackOpsColdWar.exe"))
{
baseAddress = cwapi.GetModuleBaseAddress(gameProc, "BlackOpsColdWar.exe");
}
if (PlayerCompPtr != cwapi.FindDMAAddy(hProc, (IntPtr)(baseAddress.ToInt64() + AdressOffset.PlayerBase.ToInt64()), new int[] { 0 }))
{
PlayerCompPtr = cwapi.FindDMAAddy(hProc, (IntPtr)(baseAddress.ToInt64() + AdressOffset.PlayerBase.ToInt64()), new int[] { 0 });
}
if (PlayerPedPtr != cwapi.FindDMAAddy(hProc, (IntPtr)(baseAddress.ToInt64() + AdressOffset.PlayerBase.ToInt64() + 0x8), new int[] { 0 }))
{
PlayerPedPtr = cwapi.FindDMAAddy(hProc, (IntPtr)(baseAddress.ToInt64() + AdressOffset.PlayerBase.ToInt64() + 0x8), new int[] { 0 });
}
if (ZMGlobalBase != cwapi.FindDMAAddy(hProc, (IntPtr)(baseAddress.ToInt64() + AdressOffset.PlayerBase.ToInt64() + 0x60), new int[] { 0 }))
{
ZMGlobalBase = cwapi.FindDMAAddy(hProc, (IntPtr)(baseAddress.ToInt64() + AdressOffset.PlayerBase.ToInt64() + 0x60), new int[] { 0 });
}
if (ZMBotBase != cwapi.FindDMAAddy(hProc, (IntPtr)(baseAddress.ToInt64() + AdressOffset.PlayerBase.ToInt64() + 0x68), new int[] { 0 }))
{
ZMBotBase = cwapi.FindDMAAddy(hProc, (IntPtr)(baseAddress.ToInt64() + AdressOffset.PlayerBase.ToInt64()) + 0x68, new int[] { 0 });
}
if (ZMBotBase != (IntPtr)0x0 && ZMBotBase != (IntPtr)0x68 && ZMBotListBase != cwapi.FindDMAAddy(hProc, ZMBotBase + AdressOffset.ZM_Bot_List_Offset, new int[] { 0 }))
{
ZMBotListBase = cwapi.FindDMAAddy(hProc, ZMBotBase + AdressOffset.ZM_Bot_List_Offset, new int[] { 0 });
}
for (int i = 0; i < 4; i++)
{
cwapi.WriteProcessMemory(hProc, PlayerCompPtr + (AdressOffset.PC_ArraySize_Offset * i) + AdressOffset.PC_GodMode, 0x20, 1, out _);
}
for (int i = 0; i < 4; i++)
{
cwapi.WriteProcessMemory(hProc, PlayerCompPtr + (AdressOffset.PC_ArraySize_Offset * i) + AdressOffset.CritKill8, 0, 1, out _);
}
}
catch (Exception err)
{
consoleOut(err.Message);
}
}
public double ConvertToRadians(double angle)
{
return (Math.PI / 180) * angle;
}
public void RapidFire()
{
while (true)
{
if (rapifFirecheck.Checked && cwapi.GetAsyncKeyState(Keys.LButton) < 0)
{
cwapi.WriteProcessMemory(hProc, PlayerCompPtr + AdressOffset.PC_RapidFire1, 0, 4, out _);
cwapi.WriteProcessMemory(hProc, PlayerCompPtr + AdressOffset.PC_RapidFire2, 0, 4, out _);
Thread.Sleep(10);
}
else
{
Thread.Sleep(100);
}
}
}
public void InstaKill()
{
while (true)
{
Thread.Sleep(100);
for (int i = 0; i < 90; i++)
{
cwapi.WriteProcessMemory(hProc, (ZMBotListBase + AdressOffset.ZM_Bot_ArraySize_Offset * i) + AdressOffset.ZM_Bot_Health, 1, (long)4, out _);
byte[] tempHP = new byte[4];
cwapi.ReadProcessMemory(hProc, (ZMBotListBase + AdressOffset.ZM_Bot_ArraySize_Offset * i) + AdressOffset.ZM_Bot_MaxHealth, tempHP, 4, out _);
if (BitConverter.ToInt32(tempHP, 0) > 0)
{
cwapi.WriteProcessMemory(hProc, (ZMBotListBase + AdressOffset.ZM_Bot_ArraySize_Offset * i) + AdressOffset.ZM_Bot_MaxHealth, 1, (long)4, out _);
}
}
}
}
public void StatPlayerGrab()
{
while (true)
{
byte[] array = new byte[12];
cwapi.ReadProcessMemory(this.hProc, this.PlayerPedPtr + AdressOffset.PP_Coords, array, 12L, out _);
float num = BitConverter.ToSingle(array, 0);
float num2 = BitConverter.ToSingle(array, 4);
float num3 = BitConverter.ToSingle(array, 8);
updatedPlayerPos = new Vector3((float)Math.Round((double)num, 4), (float)Math.Round((double)num2, 4), (float)Math.Round((double)num3, 4));
UpdateLabel(posXLabel, updatedPlayerPos.X.ToString());
UpdateLabel(posYLabel, updatedPlayerPos.Y.ToString());
UpdateLabel(posZLabel, updatedPlayerPos.Z.ToString());
for (int i = 0; i < 4; i++)
{
byte[] _tempBuffer = new byte[100];
cwapi.ReadProcessMemory(hProc, PlayerCompPtr + (AdressOffset.PC_ArraySize_Offset * i) + AdressOffset.PC_Name, _tempBuffer, 100, out _);
string a = System.Text.Encoding.UTF8.GetString(_tempBuffer);
switch (i)
{
case 0:
UpdateLabel(player1, a);
break;
case 1:
UpdateLabel(player2, a);
break;
case 2:
UpdateLabel(player3, a);
break;
case 3:
UpdateLabel(player4, a);
break;
}
Thread.Sleep(40);
}
}
}
public void CurrentWeapon()
{
while (true)
{
byte[] _tempBuffer = new byte[8];
cwapi.ReadProcessMemory(hProc, PlayerCompPtr + AdressOffset.PC_CurrentUsedWeaponID, _tempBuffer, 8, out _);
UpdateTextBox(currentWeaponText, BitConverter.ToInt64(_tempBuffer, 0).ToString());
Thread.Sleep(200);
}
}
public void TpZombie()
{
byte[] enemyPosBuffer = new byte[12];
bool save = false;
while (true)
{
if (tpZombiCheck.Checked && !tpZombieSavePointCheck.Checked)
{
// gets current player position
byte[] playerHeadingXY = new byte[4];
byte[] playerHeadingZ = new byte[4];
cwapi.ReadProcessMemory(hProc, PlayerPedPtr + AdressOffset.PP_Heading_XY, playerHeadingXY, 4, out _);
cwapi.ReadProcessMemory(hProc, PlayerPedPtr + AdressOffset.PP_Heading_Z, playerHeadingZ, 4, out _);
// some stack overflow magic to get the direction the player is facing and getting a position in front of the player
double pitch = -ConvertToRadians(BitConverter.ToSingle(playerHeadingZ, 0));
double yaw = ConvertToRadians(BitConverter.ToSingle(playerHeadingXY, 0));
float x = Convert.ToSingle(Math.Cos(yaw) * Math.Cos(pitch));
float y = Convert.ToSingle(Math.Sin(yaw) * Math.Cos(pitch));
float z = Convert.ToSingle(Math.Sin(pitch));
// im guessing just a straight up BitConverter.GetBytes could have worked for writing vector3s to memory instead of this kinda messy solution
var newEnemyPos = updatedPlayerPos + new Vector3(x, y, z) * distanceTPBar.Value;
Buffer.BlockCopy(BitConverter.GetBytes(newEnemyPos.X), 0, enemyPosBuffer, 0, 4);
Buffer.BlockCopy(BitConverter.GetBytes(newEnemyPos.Y), 0, enemyPosBuffer, 4, 4);
Buffer.BlockCopy(BitConverter.GetBytes(newEnemyPos.Z), 0, enemyPosBuffer, 8, 4);
for (int i = 0; i < 90; i++)
{
cwapi.WriteProcessMemory(hProc, ZMBotListBase + (AdressOffset.ZM_Bot_ArraySize_Offset * i) + AdressOffset.ZM_Bot_Coords, enemyPosBuffer, 12, out _);
}
}
if (!tpZombiCheck.Checked && tpZombieSavePointCheck.Checked)
{
if (!save)
{
byte[] playerHeadingXY = new byte[4];
byte[] playerHeadingZ = new byte[4];
cwapi.ReadProcessMemory(hProc, PlayerPedPtr + AdressOffset.PP_Heading_XY, playerHeadingXY, 4, out _);
cwapi.ReadProcessMemory(hProc, PlayerPedPtr + AdressOffset.PP_Heading_Z, playerHeadingZ, 4, out _);
double pitch = -ConvertToRadians(BitConverter.ToSingle(playerHeadingZ, 0));
double yaw = ConvertToRadians(BitConverter.ToSingle(playerHeadingXY, 0));
float x = Convert.ToSingle(Math.Cos(yaw) * Math.Cos(pitch));
float y = Convert.ToSingle(Math.Sin(yaw) * Math.Cos(pitch));
float z = Convert.ToSingle(Math.Sin(pitch));
zombieTpPos = updatedPlayerPos + new Vector3(x, y, z) * 150;
Buffer.BlockCopy(BitConverter.GetBytes(zombieTpPos.X), 0, enemyPosBuffer, 0, 4);
Buffer.BlockCopy(BitConverter.GetBytes(zombieTpPos.Y), 0, enemyPosBuffer, 4, 4);
Buffer.BlockCopy(BitConverter.GetBytes(zombieTpPos.Z), 0, enemyPosBuffer, 8, 4);
if (cwapi.GetAsyncKeyState(Keys.RButton) < 0)
{
save = true;
}
for (int i = 0; i < 90; i++)
{
cwapi.WriteProcessMemory(hProc, ZMBotListBase + (AdressOffset.ZM_Bot_ArraySize_Offset * i) + AdressOffset.ZM_Bot_Coords, enemyPosBuffer, 12, out _);
}
}
else
{
Buffer.BlockCopy(BitConverter.GetBytes(zombieTpPos.X), 0, enemyPosBuffer, 0, 4);
Buffer.BlockCopy(BitConverter.GetBytes(zombieTpPos.Y), 0, enemyPosBuffer, 4, 4);
Buffer.BlockCopy(BitConverter.GetBytes(zombieTpPos.Z), 0, enemyPosBuffer, 8, 4);