· 6 years ago · Nov 28, 2019, 11:24 AM
1PASTEBINnew pastePRO API tools faq deals
2search...
3
4
5Guest User
6-
7
8Public Pastes
9Belle KNOB
104 sec ago
11Untitled
1219 sec ago
13Untitled
1426 sec ago
15Untitled
1635 sec ago
17Untitled
1856 sec ago
19Untitled
20HTML 5 | 58 sec ago
21Untitled
2259 sec ago
23pagnosuperculo
241 min ago
25
26SHARE
27TWEET
28
29Main.cpp //CSGO AIMBOT
30 A GUEST OCT 1ST, 2013 8,885 NEVER
31
32Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
33rawdownloadcloneembedreportprintC++ 17.54 KB
34
35
36
37#include <Windows.h>
38#include <iostream>
39#include <math.h>
40#include "HackProcess.h"
41#include <vector>
42#include <algorithm> // std::sort
43//Create our 'hooking' and process managing object
44CHackProcess fProcess;
45using namespace std;
46//We use F6 to exit the hack
47#define F6_Key 0x75
48//right click
49#define RIGHT_MOUSE 0x02
50//Here we store the num of players and update it regularly to know how many enemies we are dealing with
51//this saves us doing loops unless their necessary e.g. we have 12 players and still loop 32 times wasting our great resources
52//This makes our triggerbot MUCH faster in general
53int NumOfPlayers = 15;
54const DWORD dw_PlayerCountOffs = 0x6F4020;//Engine.dll //Tirar //////engine.dll+6F4020
55
56//The player base is VERY important so we know where our player info is at
57//including current jump status so we can use force jumping making our bHop
58const DWORD GameBasePtr = 0xC000;
59const DWORD GameBase = 0x00A15F68;
60
61DWORD MeuPlayerBase;
62int localizado = 0;
63int localizadoang = 0;
64int contador = 0;
65const DWORD Player_Base = GameBase-0x198;//0x00574560;
66//The ATTACK address BELOW, WE WRITE 5 TO SHOOT OR 4 TO
67const DWORD dw_MyTeamOffset = 0xD8;//client // + vai virar -
68const DWORD dw_mTeamOffset = 0xD8;//client // -
69const DWORD dw_MyHealth = 0x198;//client //+
70const DWORD dw_Health = 0x00;//client //+
71//FOR the x coord we can use cl_pdump for m_vecOrigin Vector or just move around the map looking for different values
72//e.g. to find y coordinate walk up ladder search up, walk down search down etc.
73const DWORD dw_Pos = 0x48;//client //0134 //-
74const DWORD dw_MyPos = 0x150;//client //+
75const CHAR mname = 0x4;//+
76//Enemy Vars including the enemy loop
77const DWORD EntityPlayer_Base = GameBase;
78//How far in memory is each enemy data
79const DWORD EntityLoopDistance = 0x1E0;
80
81const DWORD waller = 0x9A8320;
82//ViewAngles
83//We find these by moving our mouse around constantly looking for changed/unchanged value,
84//the alternative is to use cl_pdump 1 and search for the value assigned to m_angRotation vector
85
86
87//We will use this struct throughout all other tutorials adding more variables every time
88
89DWORD dw_m_angRotationFINAL = 0x09B23760;
90//const DWORD dw_m_angRotationFINAL = 0x00;
91
92/*
93void EncontraAngulo()
94{
95
96float angulo;
97float angulocompare;
98DWORD compareptr;
99
100for(int i = 0; i < 3300;i++) {
101 if(localizadoang == 0) {
102ReadProcessMemory (fProcess.__HandleProcess, (PBYTE*)(fProcess.__dwordClient + 0xA00EB8), &angulo, sizeof(float), 0);
103ReadProcessMemory (fProcess.__HandleProcess, (PBYTE*)(fProcess.__dwordEngine + 0xi), &compareptr, sizeof(DWORD), 0);
104ReadProcessMemory (fProcess.__HandleProcess, (PBYTE*)(compareptr), &angulocompare, sizeof(DWORD), 0);
105printf("contador = %d \n", i);
106printf("Angulo encontrado addr %x \n", compareptr);
107printf("Angulo encontrado %f \n", angulocompare);
108if(angulo == angulocompare)
109{
110dw_m_angRotationFINAL = compareptr;
111printf("Angulo encontrado addr %x \n", compareptr);
112printf("Angulo encontrado %f \n", angulocompare);
113localizadoang = 1;
114}
115 }
116}
117
118
119
120}*/
121
122
123struct MyPlayer_t
124{
125 DWORD CLocalPlayer;
126 DWORD ggGameBase;
127 DWORD ggGameBaseB;
128 DWORD ggGameBaseC;
129 int Team;
130 int Health;
131 float Position[3];
132
133 float poscomparer;
134 float posfinder;
135
136 DWORD TeamPtr;
137 DWORD HealthPtr;
138 DWORD PositionPtr;
139
140 DWORD poscomparerptr;
141
142 DWORD BaseOffsA, BaseOffsB,BaseOffsC,BaseOffsD,BaseOffsE,BaseOffsF,BaseOffsG,BaseOffsH;
143 DWORD BaseOffsAptr, BaseOffsBptr,BaseOffsCptr,BaseOffsDptr,BaseOffsEptr,BaseOffsFptr,BaseOffsGptr,BaseOffsHptr;
144 DWORD TeamGambiarra;
145 void ReadInformation()
146 {
147
148
149 ReadProcessMemory (fProcess.__HandleProcess, (PBYTE*)(fProcess.__dwordClient + GameBase), &ggGameBase, sizeof(DWORD), 0);
150
151 BaseOffsA = ggGameBase+0x4FC;
152 ReadProcessMemory (fProcess.__HandleProcess, (PBYTE*)(BaseOffsA), &BaseOffsAptr, sizeof(DWORD), 0);
153 BaseOffsB = BaseOffsAptr+0x504;
154 ReadProcessMemory (fProcess.__HandleProcess, (PBYTE*)(BaseOffsB), &BaseOffsBptr, sizeof(DWORD), 0);
155 BaseOffsC = BaseOffsBptr+0xD4;
156 ReadProcessMemory (fProcess.__HandleProcess, (PBYTE*)(BaseOffsC), &BaseOffsCptr, sizeof(DWORD), 0);
157 BaseOffsD = BaseOffsCptr+0x0;
158 ReadProcessMemory (fProcess.__HandleProcess, (PBYTE*)(BaseOffsD), &BaseOffsDptr, sizeof(DWORD), 0);
159 BaseOffsE = BaseOffsDptr+0x90;
160 ReadProcessMemory (fProcess.__HandleProcess, (PBYTE*)(BaseOffsE), &BaseOffsEptr, sizeof(DWORD), 0);
161 BaseOffsF = BaseOffsEptr+0x7C;
162 ReadProcessMemory (fProcess.__HandleProcess, (PBYTE*)(BaseOffsF), &BaseOffsFptr, sizeof(DWORD), 0);
163 BaseOffsG = BaseOffsFptr+0x120;
164 ReadProcessMemory (fProcess.__HandleProcess, (PBYTE*)(BaseOffsG), &BaseOffsGptr, sizeof(DWORD), 0);
165 BaseOffsH = BaseOffsGptr+0x200;
166 ReadProcessMemory (fProcess.__HandleProcess, (PBYTE*)(BaseOffsH), &BaseOffsHptr, sizeof(DWORD), 0);
167
168
169
170 // ReadProcessMemory (fProcess.__HandleProcess, (PBYTE*)(gggGameBaseB + (Player * EntityLoopDistance)),&CBaseEntity, sizeof(DWORD), 0);
171
172
173 for(int i = 0; i < 32; i++) {
174 if(localizado == 0) {
175 CLocalPlayer = BaseOffsH + (i * EntityLoopDistance);
176 poscomparerptr = CLocalPlayer - dw_Pos;
177 ReadProcessMemory (fProcess.__HandleProcess, (PBYTE*)(fProcess.__dwordClient + 0x9B8960), &posfinder, sizeof(float), 0);
178 //ReadProcessMemory (fProcess.__HandleProcess, (PBYTE*)(Nameptr), &Nameptrb, sizeof(DWORD), 0);
179 ReadProcessMemory (fProcess.__HandleProcess, (PBYTE*)(poscomparerptr), &poscomparer, sizeof(float), 0);
180 printf("posfinder: %f \n", posfinder);
181 printf("poscomparer: %f \n", poscomparer);
182 if(posfinder == poscomparer) {
183 CLocalPlayer = BaseOffsH + (i * EntityLoopDistance);
184 localizado = 1;
185 contador = i;
186 printf("Localizado ;p");
187 }else {
188 localizado = 0;
189 }
190 //printf("i = %d", i);
191 }
192 }
193
194
195
196
197 //ggGameBaseB = BaseOffsH;
198 //ggGameBaseC = BaseOffsH-0x198;
199 // printf("BaseOffsH = %x", BaseOffsH);
200
201 // ###############CLocalPlayer = ggGameBaseC; ******************************************/
202
203 //////ACHA O MEU PLAYER NO MEIO DOS PLAYERSS!!!!!!!!!!
204
205
206
207CLocalPlayer = BaseOffsH + (contador * EntityLoopDistance);
208//printf("Localizado %d", localizado);
209//CLocalPlayer = MeuPlayerBase-0x4;
210
211
212 HealthPtr = CLocalPlayer+dw_Health;
213 PositionPtr = CLocalPlayer-dw_Pos;
214 TeamPtr = CLocalPlayer-dw_mTeamOffset;
215 //printf("Team: %x", TeamPtr);
216 // Reading CLocalPlayer Pointer to our "CLocalPlayer" DWORD.
217 //ReadProcessMemory (fProcess.__HandleProcess, (PBYTE*)(ggGameBaseC), &CLocalPlayer, sizeof(DWORD), 0);
218 // Reading out our Team to our "Team" Varible.
219
220
221
222
223 // Reading out our Health to our "Health" Varible.
224 ReadProcessMemory (fProcess.__HandleProcess, (PBYTE*)(HealthPtr), &Health, sizeof(int), 0);
225
226
227 ReadProcessMemory (fProcess.__HandleProcess, (PBYTE*)(TeamPtr), &Team, sizeof(int), 0);//Tirar
228
229 // Reading out our Position to our "Position" Varible.
230 ReadProcessMemory (fProcess.__HandleProcess, (PBYTE*)(PositionPtr), &Position, sizeof(float[3]), 0);
231
232 //Here we find how many player entities exist in our game, through this we make sure to only loop the amount of times we need
233 //when grabbing player data
234 //Note that this call could be even better at a regular 15 or so seconds timer but performance shouldn't vary a great deal
235 //ReadProcessMemory (fProcess.__HandleProcess, (PBYTE*)(fProcess.__dwordEngine + dw_PlayerCountOffs), &NumOfPlayers, sizeof(int), 0); //Tirar
236
237 //DWORD PosX = 0x9B8960;
238 //DWORD PosZ = 0x9B8964;
239 //DWORD PosY = 0x9B8968;
240
241
242 }
243}MyPlayer;
244
245
246
247
248//Here is where we narrow the enemy data to the enemies that we want to shoot,
249//these players are added once we validated them e.g. do they have enough health?, or maybe they are on the enemy team
250struct TargetList_t
251{
252 float Distance;
253 float AimbotAngle[3];
254
255 TargetList_t()
256 {
257 //our default constructor :S
258 }
259
260 TargetList_t(float aimbotAngle[], float myCoords[], float enemyCoords[])
261 {
262 //Send our coordinates and the enemy's to find out how close they are to us!
263 Distance = Get3dDistance(myCoords[0], myCoords[1], myCoords[2],
264 enemyCoords[0], enemyCoords[1], enemyCoords[2] );
265
266 //Define our aimbot angles and set them for later use when shooting
267 AimbotAngle[0] = aimbotAngle[0];
268 AimbotAngle[1] = aimbotAngle[1];
269 AimbotAngle[2] = aimbotAngle[2];
270 }
271
272 //Get our 3d Distance between 2 sets of coordinates(ours and enemies) and find out how close an enemy is to us
273 //when it comes to shooting we aim at the closest enemy
274 //Simple but effective
275
276 //Here we will AVOID vectors for simplicity but feel free to create to use them
277 //if you prefer float Get3dDistance(std::vector<float> myCoords, std::vector<float> enemyCoords)
278
279 //See how far away our enemy is to us
280 float Get3dDistance(float myCoordsX, float myCoordsZ, float myCoordsY,
281 float eNx, float eNz, float eNy)
282 {
283 //Use the 3d distance formula to get a resulting Floating distance value POW!!
284 return sqrt(
285 pow(double(eNx - myCoordsX), 2.0) +
286 pow(double(eNy - myCoordsY), 2.0) +
287 pow(double(eNz - myCoordsZ), 2.0));
288 }
289};
290
291
292
293//ENemy struct
294struct PlayerList_t
295{
296 DWORD gggGameBase;
297 DWORD gggGameBaseB;
298 DWORD gggGameBaseC;
299 DWORD CBaseEntity;
300 int Team;
301 int Health;
302 float Position[3];
303 float AimbotAngle[3];
304 char Name[39];
305
306 DWORD Healthptr;
307 DWORD Teamptr;
308 DWORD Positionptr;
309 DWORD Nameptr;
310
311
312 DWORD BaseOffsA, BaseOffsB,BaseOffsC,BaseOffsD,BaseOffsE,BaseOffsF,BaseOffsG,BaseOffsH;
313 DWORD BaseOffsAptr, BaseOffsBptr,BaseOffsCptr,BaseOffsDptr,BaseOffsEptr,BaseOffsFptr,BaseOffsGptr,BaseOffsHptr;
314 void ReadInformation(int Player)
315 {
316 // Reading CBaseEntity Pointer to our "CBaseEntity" DWORD + Current Player in the loop. 0x10 is the CBaseEntity List Size
317 //"client.dll"+00545204 //0x571A5204
318
319
320
321
322
323
324
325 ReadProcessMemory (fProcess.__HandleProcess, (PBYTE*)(fProcess.__dwordClient + GameBase), &gggGameBase, sizeof(DWORD), 0);
326
327 BaseOffsA = gggGameBase+0x4FC;
328 ReadProcessMemory (fProcess.__HandleProcess, (PBYTE*)(BaseOffsA), &BaseOffsAptr, sizeof(DWORD), 0);
329 BaseOffsB = BaseOffsAptr+0x504;
330 ReadProcessMemory (fProcess.__HandleProcess, (PBYTE*)(BaseOffsB), &BaseOffsBptr, sizeof(DWORD), 0);
331 BaseOffsC = BaseOffsBptr+0xD4;
332 ReadProcessMemory (fProcess.__HandleProcess, (PBYTE*)(BaseOffsC), &BaseOffsCptr, sizeof(DWORD), 0);
333 BaseOffsD = BaseOffsCptr+0x0;
334 ReadProcessMemory (fProcess.__HandleProcess, (PBYTE*)(BaseOffsD), &BaseOffsDptr, sizeof(DWORD), 0);
335 BaseOffsE = BaseOffsDptr+0x90;
336 ReadProcessMemory (fProcess.__HandleProcess, (PBYTE*)(BaseOffsE), &BaseOffsEptr, sizeof(DWORD), 0);
337 BaseOffsF = BaseOffsEptr+0x7C;
338 ReadProcessMemory (fProcess.__HandleProcess, (PBYTE*)(BaseOffsF), &BaseOffsFptr, sizeof(DWORD), 0);
339 BaseOffsG = BaseOffsFptr+0x120;
340 ReadProcessMemory (fProcess.__HandleProcess, (PBYTE*)(BaseOffsG), &BaseOffsGptr, sizeof(DWORD), 0);
341 BaseOffsH = BaseOffsGptr+0x200;
342 ReadProcessMemory (fProcess.__HandleProcess, (PBYTE*)(BaseOffsH), &BaseOffsHptr, sizeof(DWORD), 0);
343
344
345
346 // ReadProcessMemory (fProcess.__HandleProcess, (PBYTE*)(gggGameBaseB + (Player * EntityLoopDistance)),&CBaseEntity, sizeof(DWORD), 0);
347
348 CBaseEntity = BaseOffsH + (Player * EntityLoopDistance);
349
350 //printf("gggGameBaseB = %x", CBaseEntity);
351
352
353 Teamptr = CBaseEntity - dw_mTeamOffset;
354 Healthptr = CBaseEntity + dw_Health;
355 Positionptr = CBaseEntity - dw_Pos;
356 Nameptr = CBaseEntity + mname;
357
358
359 // Reading out our Team to our "Team" Varible.
360 ReadProcessMemory (fProcess.__HandleProcess, (PBYTE*)(Teamptr), &Team, sizeof(int), 0); //Tirar
361 //printf("TeamId = %d \n", Team);
362 // Reading out our Health to our "Health" Varible.
363 ReadProcessMemory (fProcess.__HandleProcess, (PBYTE*)(Healthptr), &Health, sizeof(int), 0);
364 // Reading out our Position to our "Position" Varible.
365 ReadProcessMemory (fProcess.__HandleProcess, (PBYTE*)(Positionptr), &Position, sizeof(float[3]), 0);
366
367 ReadProcessMemory (fProcess.__HandleProcess, (PBYTE*)(Nameptr), &Name, sizeof(char), 0);
368
369
370 }
371}PlayerList[32];
372
373
374
375//Used to compare the distance when sorting the array of Target Enemies
376//JUST think of this as an assist for a sorting algorithm
377//and this isn't necessarily related to hacking but it helps us out
378struct CompareTargetEnArray
379{
380 //USE A COMPARATOR TO SORT OUR ARRAY nicely
381 bool operator() (TargetList_t & lhs, TargetList_t & rhs)
382 {
383 return lhs.Distance < rhs.Distance;
384 }
385};
386
387
388//Props to Nubtik and a couple of other places on the interwebs for this function
389void CalcAngle( float *src, float *dst, float *angles )
390{
391
392 double delta[3] = { (src[0]-dst[0]), (src[1]-dst[1]), (src[2]-dst[2]) };
393 double hyp = sqrt(delta[0]*delta[0] + delta[1]*delta[1]);
394 angles[0] = (float) (asinf(delta[2]/hyp) * 57.295779513082f);
395 angles[1] = (float) (atanf(delta[1]/delta[0]) * 57.295779513082f);
396 angles[2] = 0.0f;
397
398 if(delta[0] >= 0.0)
399 {
400 angles[1] += 180.0f;
401 }
402}
403
404
405
406
407 float Calculadistancia(float myCoordsX, float myCoordsZ, float myCoordsY,
408 float eNx, float eNz, float eNy)
409 {
410 //Use the 3d distance formula to get a resulting Floating distance value POW!!
411 return sqrt(
412 pow(double(eNx - myCoordsX), 2.0) +
413 pow(double(eNy - myCoordsY), 2.0) +
414 pow(double(eNz - myCoordsZ), 2.0));
415 }
416
417void Aimbot()
418{
419 float fNearest = (float)INT_MAX;//Meu cod
420 int iAimAt = -1;
421 int gambiarrameutime = 12;
422 ///////
423 //Declare our target list to define our victims through a dynamic array
424 TargetList_t* TargetList = new TargetList_t[NumOfPlayers];
425 //Loop through all our players and retrieve their information
426 //we use this mainly here to find out what players are our enemies and what players are on our team
427 //loops through players to set the target enemies
428 int targetLoop = 0;
429 for(int i = 1; i < NumOfPlayers; i ++) //Começa com 2 pq se n mira em mim mesmo e explode a porra toda
430 {
431 if (GetAsyncKeyState(VK_RBUTTON)) { ////Meu
432 i++;
433 }
434 if (GetAsyncKeyState(VK_F2)) { ////Meu
435 gambiarrameutime = 12;
436 }
437 if (GetAsyncKeyState(VK_F3)) { ////Meu
438 gambiarrameutime = 16;
439 }
440
441 if (GetAsyncKeyState(VK_F4)) { ////Meu
442 gambiarrameutime = 8;
443 }
444
445
446 PlayerList[i].ReadInformation(i);
447
448 // Skip if they're my teammates.
449 if (PlayerList[i].Team == MyPlayer.Team)
450 continue;
451
452 //Make sure our targets have at keast 2 health
453 if (PlayerList[i].Health < 2)
454 continue; //break to next iteration //Tirar
455
456 if(Calculadistancia(MyPlayer.Position[0], MyPlayer.Position[1], (MyPlayer.Position[2]),PlayerList[i].Position[0],PlayerList[i].Position[1], (PlayerList[i].Position[2]) ) < fNearest )//dis :D
457 {
458
459 // if(!Parede.noobie && !Parede.aimdelay) { //Mudar aki...
460
461 iAimAt = i;
462
463 fNearest = Calculadistancia(MyPlayer.Position[0], MyPlayer.Position[1],
464 (MyPlayer.Position[2]),PlayerList[i].Position[0],PlayerList[i].Position[1], (PlayerList[i].Position[2]) );
465 // }
466 }
467
468
469 //PlayerList[i].Position[2] -= 10;
470 CalcAngle (MyPlayer.Position, PlayerList[i].Position, PlayerList[i].AimbotAngle);
471
472 //ONCE WE GET HERE we have already read all the information we want, all enemies have been checked for valid data
473 //Therefore players on our team a dont get selected and only enemies with over 1 health are allowed
474
475 //WE NOW DEFINE A LIST OF ENEMIES TO SHOOT AT, from here we will scan that array and choose to aim at the closest one
476 //Create our target loop player and store the most important information
477 TargetList[targetLoop] = TargetList_t(PlayerList[i].AimbotAngle, MyPlayer.Position, PlayerList[i].Position);
478
479 //Increment so we can add more players onto the array
480 targetLoop++;
481 }
482
483
484
485
486 //ONLY AIM if we have any enemies
487 if(targetLoop > 0)
488 {
489 //SORT ENEMIES ARRAY BY DISTANCE before AIMING AT THEM
490 //JUST NORMAL std::sort function with our custom comparator, not much to it
491 //target loop -1 because it will always go 1 above the count
492 std::sort(TargetList, TargetList+targetLoop, CompareTargetEnArray());
493
494 //AIM at the closest guy we found,
495 //by default aim at ALL times, if you right click hold it switches it off
496 //This isn't the best example but change the example to whatevery you like E.g. Left click etc...
497 if (GetAsyncKeyState(VK_MBUTTON))
498 {
499 if(iAimAt != -1) {
500
501
502 /*
503 WriteProcessMemory (fProcess.__HandleProcess,
504 (PBYTE*)(fProcess.__csgoexe+dw_m_angRotation),
505 TargetList[0].AimbotAngle, 12, 0);*/
506
507 if(MyPlayer.Health > 2) { //Evita um bug louco
508 WriteProcessMemory (fProcess.__HandleProcess,
509 (PBYTE*)(dw_m_angRotationFINAL),
510 TargetList[0].AimbotAngle, 14, 0);
511 }
512/*
513 WriteProcessMemory (fProcess.__HandleProcess,
514 (PBYTE*)(dw_m_angRotationX),
515 TargetList[0].AimbotAngle, 12, 0);
516
517 WriteProcessMemory (fProcess.__HandleProcess,
518 (PBYTE*)(dw_m_angRotationY),
519 TargetList[0].AimbotAngle, 12, 0);
520 WriteProcessMemory (fProcess.__HandleProcess,
521 (PBYTE*)(dw_m_angRotationZ),
522 TargetList[0].AimbotAngle, 12, 0);*/
523
524
525
526
527
528 }
529
530 //no recoil above text
531 }
532
533 }
534 //reset the loop counter
535 targetLoop = 0;
536 //DELETE OUR ARRAY and clear memory, very important
537 delete [] TargetList;
538}
539
540
541
542int main()
543{
544
545 fProcess.RunProcess(); // Waiting for CSS......
546 cout << "Game found! Running Aimbot..." << endl;
547
548 //Exit if the F6 key is pressed
549 while (!GetAsyncKeyState(F6_Key)) // or for(;;)
550 {
551 //Read player information into our struct so we know the player
552 //base and the bunny hop addresses
553
554
555 MyPlayer.ReadInformation();
556 // EncontraAngulo();
557
558
559 //Call our Aimbot
560
561 Aimbot();
562
563 }
564}
565RAW Paste Data
566
567
568#include <Windows.h>
569#include <iostream>
570#include <math.h>
571#include "HackProcess.h"
572#include <vector>
573#include <algorithm> // std::sort
574//Create our 'hooking' and process managing object
575CHackProcess fProcess;
576using namespace std;
577//We use F6 to exit the hack
578#define F6_Key 0x75
579//right click
580#define RIGHT_MOUSE 0x02
581//Here we store the num of players and update it regularly to know how many enemies we are dealing with
582//this saves us doing loops unless their necessary e.g. we have 12 players and still loop 32 times wasting our great resources
583//This makes our triggerbot MUCH faster in general
584int NumOfPlayers = 15;
585const DWORD dw_PlayerCountOffs = 0x6F4020;//Engine.dll //Tirar //////engine.dll+6F4020
586
587//The player base is VERY important so we know where our player info is at
588//including current jump status so we can use force jumping making our bHop
589const DWORD GameBasePtr = 0xC000;
590const DWORD GameBase = 0x00A15F68;
591
592DWORD MeuPlayerBase;
593int localizado = 0;
594int localizadoang = 0;
595int contador = 0;
596const DWORD Player_Base = GameBase-0x198;//0x00574560;
597//The ATTACK address BELOW, WE WRITE 5 TO SHOOT OR 4 TO
598const DWORD dw_MyTeamOffset = 0xD8;//client // + vai virar -
599const DWORD dw_mTeamOffset = 0xD8;//client // -
600const DWORD dw_MyHealth = 0x198;//client //+
601const DWORD dw_Health = 0x00;//client //+
602//FOR the x coord we can use cl_pdump for m_vecOrigin Vector or just move around the map looking for different values
603//e.g. to find y coordinate walk up ladder search up, walk down search down etc.
604const DWORD dw_Pos = 0x48;//client //0134 //-
605const DWORD dw_MyPos = 0x150;//client //+
606const CHAR mname = 0x4;//+
607//Enemy Vars including the enemy loop
608const DWORD EntityPlayer_Base = GameBase;
609//How far in memory is each enemy data
610const DWORD EntityLoopDistance = 0x1E0;
611
612const DWORD waller = 0x9A8320;
613//ViewAngles
614//We find these by moving our mouse around constantly looking for changed/unchanged value,
615//the alternative is to use cl_pdump 1 and search for the value assigned to m_angRotation vector
616
617
618//We will use this struct throughout all other tutorials adding more variables every time
619
620DWORD dw_m_angRotationFINAL = 0x09B23760;
621//const DWORD dw_m_angRotationFINAL = 0x00;
622
623/*
624void EncontraAngulo()
625{
626
627float angulo;
628float angulocompare;
629DWORD compareptr;
630
631for(int i = 0; i < 3300;i++) {
632 if(localizadoang == 0) {
633ReadProcessMemory (fProcess.__HandleProcess, (PBYTE*)(fProcess.__dwordClient + 0xA00EB8), &angulo, sizeof(float), 0);
634ReadProcessMemory (fProcess.__HandleProcess, (PBYTE*)(fProcess.__dwordEngine + 0xi), &compareptr, sizeof(DWORD), 0);
635ReadProcessMemory (fProcess.__HandleProcess, (PBYTE*)(compareptr), &angulocompare, sizeof(DWORD), 0);
636printf("contador = %d \n", i);
637printf("Angulo encontrado addr %x \n", compareptr);
638printf("Angulo encontrado %f \n", angulocompare);
639if(angulo == angulocompare)
640{
641dw_m_angRotationFINAL = compareptr;
642printf("Angulo encontrado addr %x \n", compareptr);
643printf("Angulo encontrado %f \n", angulocompare);
644localizadoang = 1;
645}
646 }
647}
648
649
650
651}*/
652
653
654struct MyPlayer_t
655{
656 DWORD CLocalPlayer;
657 DWORD ggGameBase;
658 DWORD ggGameBaseB;
659 DWORD ggGameBaseC;
660 int Team;
661 int Health;
662 float Position[3];
663
664 float poscomparer;
665 float posfinder;
666
667 DWORD TeamPtr;
668 DWORD HealthPtr;
669 DWORD PositionPtr;
670
671 DWORD poscomparerptr;
672
673 DWORD BaseOffsA, BaseOffsB,BaseOffsC,BaseOffsD,BaseOffsE,BaseOffsF,BaseOffsG,BaseOffsH;
674 DWORD BaseOffsAptr, BaseOffsBptr,BaseOffsCptr,BaseOffsDptr,BaseOffsEptr,BaseOffsFptr,BaseOffsGptr,BaseOffsHptr;
675 DWORD TeamGambiarra;
676 void ReadInformation()
677 {
678
679
680 ReadProcessMemory (fProcess.__HandleProcess, (PBYTE*)(fProcess.__dwordClient + GameBase), &ggGameBase, sizeof(DWORD), 0);
681
682 BaseOffsA = ggGameBase+0x4FC;
683 ReadProcessMemory (fProcess.__HandleProcess, (PBYTE*)(BaseOffsA), &BaseOffsAptr, sizeof(DWORD), 0);
684 BaseOffsB = BaseOffsAptr+0x504;
685 ReadProcessMemory (fProcess.__HandleProcess, (PBYTE*)(BaseOffsB), &BaseOffsBptr, sizeof(DWORD), 0);
686 BaseOffsC = BaseOffsBptr+0xD4;
687 ReadProcessMemory (fProcess.__HandleProcess, (PBYTE*)(BaseOffsC), &BaseOffsCptr, sizeof(DWORD), 0);
688 BaseOffsD = BaseOffsCptr+0x0;
689 ReadProcessMemory (fProcess.__HandleProcess, (PBYTE*)(BaseOffsD), &BaseOffsDptr, sizeof(DWORD), 0);
690 BaseOffsE = BaseOffsDptr+0x90;
691 ReadProcessMemory (fProcess.__HandleProcess, (PBYTE*)(BaseOffsE), &BaseOffsEptr, sizeof(DWORD), 0);
692 BaseOffsF = BaseOffsEptr+0x7C;
693 ReadProcessMemory (fProcess.__HandleProcess, (PBYTE*)(BaseOffsF), &BaseOffsFptr, sizeof(DWORD), 0);
694 BaseOffsG = BaseOffsFptr+0x120;
695 ReadProcessMemory (fProcess.__HandleProcess, (PBYTE*)(BaseOffsG), &BaseOffsGptr, sizeof(DWORD), 0);
696 BaseOffsH = BaseOffsGptr+0x200;
697 ReadProcessMemory (fProcess.__HandleProcess, (PBYTE*)(BaseOffsH), &BaseOffsHptr, sizeof(DWORD), 0);
698
699
700
701 // ReadProcessMemory (fProcess.__HandleProcess, (PBYTE*)(gggGameBaseB + (Player * EntityLoopDistance)),&CBaseEntity, sizeof(DWORD), 0);
702
703
704 for(int i = 0; i < 32; i++) {
705 if(localizado == 0) {
706 CLocalPlayer = BaseOffsH + (i * EntityLoopDistance);
707 poscomparerptr = CLocalPlayer - dw_Pos;
708 ReadProcessMemory (fProcess.__HandleProcess, (PBYTE*)(fProcess.__dwordClient + 0x9B8960), &posfinder, sizeof(float), 0);
709 //ReadProcessMemory (fProcess.__HandleProcess, (PBYTE*)(Nameptr), &Nameptrb, sizeof(DWORD), 0);
710 ReadProcessMemory (fProcess.__HandleProcess, (PBYTE*)(poscomparerptr), &poscomparer, sizeof(float), 0);
711 printf("posfinder: %f \n", posfinder);
712 printf("poscomparer: %f \n", poscomparer);
713 if(posfinder == poscomparer) {
714 CLocalPlayer = BaseOffsH + (i * EntityLoopDistance);
715 localizado = 1;
716 contador = i;
717 printf("Localizado ;p");
718 }else {
719 localizado = 0;
720 }
721 //printf("i = %d", i);
722 }
723 }
724
725
726
727
728 //ggGameBaseB = BaseOffsH;
729 //ggGameBaseC = BaseOffsH-0x198;
730 // printf("BaseOffsH = %x", BaseOffsH);
731
732 // ###############CLocalPlayer = ggGameBaseC; ******************************************/
733
734 //////ACHA O MEU PLAYER NO MEIO DOS PLAYERSS!!!!!!!!!!
735
736
737
738CLocalPlayer = BaseOffsH + (contador * EntityLoopDistance);
739//printf("Localizado %d", localizado);
740//CLocalPlayer = MeuPlayerBase-0x4;
741
742
743 HealthPtr = CLocalPlayer+dw_Health;
744 PositionPtr = CLocalPlayer-dw_Pos;
745 TeamPtr = CLocalPlayer-dw_mTeamOffset;
746 //printf("Team: %x", TeamPtr);
747 // Reading CLocalPlayer Pointer to our "CLocalPlayer" DWORD.
748 //ReadProcessMemory (fProcess.__HandleProcess, (PBYTE*)(ggGameBaseC), &CLocalPlayer, sizeof(DWORD), 0);
749 // Reading out our Team to our "Team" Varible.
750
751
752
753
754 // Reading out our Health to our "Health" Varible.
755 ReadProcessMemory (fProcess.__HandleProcess, (PBYTE*)(HealthPtr), &Health, sizeof(int), 0);
756
757
758 ReadProcessMemory (fProcess.__HandleProcess, (PBYTE*)(TeamPtr), &Team, sizeof(int), 0);//Tirar
759
760 // Reading out our Position to our "Position" Varible.
761 ReadProcessMemory (fProcess.__HandleProcess, (PBYTE*)(PositionPtr), &Position, sizeof(float[3]), 0);
762
763 //Here we find how many player entities exist in our game, through this we make sure to only loop the amount of times we need
764 //when grabbing player data
765 //Note that this call could be even better at a regular 15 or so seconds timer but performance shouldn't vary a great deal
766 //ReadProcessMemory (fProcess.__HandleProcess, (PBYTE*)(fProcess.__dwordEngine + dw_PlayerCountOffs), &NumOfPlayers, sizeof(int), 0); //Tirar
767
768 //DWORD PosX = 0x9B8960;
769 //DWORD PosZ = 0x9B8964;
770 //DWORD PosY = 0x9B8968;
771
772
773 }
774}MyPlayer;
775
776
777
778
779//Here is where we narrow the enemy data to the enemies that we want to shoot,
780//these players are added once we validated them e.g. do they have enough health?, or maybe they are on the enemy team
781struct TargetList_t
782{
783 float Distance;
784 float AimbotAngle[3];
785
786 TargetList_t()
787 {
788 //our default constructor :S
789 }
790
791 TargetList_t(float aimbotAngle[], float myCoords[], float enemyCoords[])
792 {
793 //Send our coordinates and the enemy's to find out how close they are to us!
794 Distance = Get3dDistance(myCoords[0], myCoords[1], myCoords[2],
795 enemyCoords[0], enemyCoords[1], enemyCoords[2] );
796
797 //Define our aimbot angles and set them for later use when shooting
798 AimbotAngle[0] = aimbotAngle[0];
799 AimbotAngle[1] = aimbotAngle[1];
800 AimbotAngle[2] = aimbotAngle[2];
801 }
802
803 //Get our 3d Distance between 2 sets of coordinates(ours and enemies) and find out how close an enemy is to us
804 //when it comes to shooting we aim at the closest enemy
805 //Simple but effective
806
807 //Here we will AVOID vectors for simplicity but feel free to create to use them
808 //if you prefer float Get3dDistance(std::vector<float> myCoords, std::vector<float> enemyCoords)
809
810 //See how far away our enemy is to us
811 float Get3dDistance(float myCoordsX, float myCoordsZ, float myCoordsY,
812 float eNx, float eNz, float eNy)
813 {
814 //Use the 3d distance formula to get a resulting Floating distance value POW!!
815 return sqrt(
816 pow(double(eNx - myCoordsX), 2.0) +
817 pow(double(eNy - myCoordsY), 2.0) +
818 pow(double(eNz - myCoordsZ), 2.0));
819 }
820};
821
822
823
824//ENemy struct
825struct PlayerList_t
826{
827 DWORD gggGameBase;
828 DWORD gggGameBaseB;
829 DWORD gggGameBaseC;
830 DWORD CBaseEntity;
831 int Team;
832 int Health;
833 float Position[3];
834 float AimbotAngle[3];
835 char Name[39];
836
837 DWORD Healthptr;
838 DWORD Teamptr;
839 DWORD Positionptr;
840 DWORD Nameptr;
841
842
843 DWORD BaseOffsA, BaseOffsB,BaseOffsC,BaseOffsD,BaseOffsE,BaseOffsF,BaseOffsG,BaseOffsH;
844 DWORD BaseOffsAptr, BaseOffsBptr,BaseOffsCptr,BaseOffsDptr,BaseOffsEptr,BaseOffsFptr,BaseOffsGptr,BaseOffsHptr;
845 void ReadInformation(int Player)
846 {
847 // Reading CBaseEntity Pointer to our "CBaseEntity" DWORD + Current Player in the loop. 0x10 is the CBaseEntity List Size
848 //"client.dll"+00545204 //0x571A5204
849
850
851
852
853
854
855
856 ReadProcessMemory (fProcess.__HandleProcess, (PBYTE*)(fProcess.__dwordClient + GameBase), &gggGameBase, sizeof(DWORD), 0);
857
858 BaseOffsA = gggGameBase+0x4FC;
859 ReadProcessMemory (fProcess.__HandleProcess, (PBYTE*)(BaseOffsA), &BaseOffsAptr, sizeof(DWORD), 0);
860 BaseOffsB = BaseOffsAptr+0x504;
861 ReadProcessMemory (fProcess.__HandleProcess, (PBYTE*)(BaseOffsB), &BaseOffsBptr, sizeof(DWORD), 0);
862 BaseOffsC = BaseOffsBptr+0xD4;
863 ReadProcessMemory (fProcess.__HandleProcess, (PBYTE*)(BaseOffsC), &BaseOffsCptr, sizeof(DWORD), 0);
864 BaseOffsD = BaseOffsCptr+0x0;
865 ReadProcessMemory (fProcess.__HandleProcess, (PBYTE*)(BaseOffsD), &BaseOffsDptr, sizeof(DWORD), 0);
866 BaseOffsE = BaseOffsDptr+0x90;
867 ReadProcessMemory (fProcess.__HandleProcess, (PBYTE*)(BaseOffsE), &BaseOffsEptr, sizeof(DWORD), 0);
868 BaseOffsF = BaseOffsEptr+0x7C;
869 ReadProcessMemory (fProcess.__HandleProcess, (PBYTE*)(BaseOffsF), &BaseOffsFptr, sizeof(DWORD), 0);
870 BaseOffsG = BaseOffsFptr+0x120;
871 ReadProcessMemory (fProcess.__HandleProcess, (PBYTE*)(BaseOffsG), &BaseOffsGptr, sizeof(DWORD), 0);
872 BaseOffsH = BaseOffsGptr+0x200;
873 ReadProcessMemory (fProcess.__HandleProcess, (PBYTE*)(BaseOffsH), &BaseOffsHptr, sizeof(DWORD), 0);
874
875
876
877 // ReadProcessMemory (fProcess.__HandleProcess, (PBYTE*)(gggGameBaseB + (Player * EntityLoopDistance)),&CBaseEntity, sizeof(DWORD), 0);
878
879 CBaseEntity = BaseOffsH + (Player * EntityLoopDistance);
880
881 //printf("gggGameBaseB = %x", CBaseEntity);
882
883
884 Teamptr = CBaseEntity - dw_mTeamOffset;
885 Healthptr = CBaseEntity + dw_Health;
886 Positionptr = CBaseEntity - dw_Pos;
887 Nameptr = CBaseEntity + mname;
888
889
890 // Reading out our Team to our "Team" Varible.
891 ReadProcessMemory (fProcess.__HandleProcess, (PBYTE*)(Teamptr), &Team, sizeof(int), 0); //Tirar
892 //printf("TeamId = %d \n", Team);
893 // Reading out our Health to our "Health" Varible.
894 ReadProcessMemory (fProcess.__HandleProcess, (PBYTE*)(Healthptr), &Health, sizeof(int), 0);
895 // Reading out our Position to our "Position" Varible.
896 ReadProcessMemory (fProcess.__HandleProcess, (PBYTE*)(Positionptr), &Position, sizeof(float[3]), 0);
897
898 ReadProcessMemory (fProcess.__HandleProcess, (PBYTE*)(Nameptr), &Name, sizeof(char), 0);
899
900
901 }
902}PlayerList[32];
903
904
905
906//Used to compare the distance when sorting the array of Target Enemies
907//JUST think of this as an assist for a sorting algorithm
908//and this isn't necessarily related to hacking but it helps us out
909struct CompareTargetEnArray
910{
911 //USE A COMPARATOR TO SORT OUR ARRAY nicely
912 bool operator() (TargetList_t & lhs, TargetList_t & rhs)
913 {
914 return lhs.Distance < rhs.Distance;
915 }
916};
917
918
919//Props to Nubtik and a couple of other places on the interwebs for this function
920void CalcAngle( float *src, float *dst, float *angles )
921{
922
923 double delta[3] = { (src[0]-dst[0]), (src[1]-dst[1]), (src[2]-dst[2]) };
924 double hyp = sqrt(delta[0]*delta[0] + delta[1]*delta[1]);
925 angles[0] = (float) (asinf(delta[2]/hyp) * 57.295779513082f);
926 angles[1] = (float) (atanf(delta[1]/delta[0]) * 57.295779513082f);
927 angles[2] = 0.0f;
928
929 if(delta[0] >= 0.0)
930 {
931 angles[1] += 180.0f;
932 }
933}
934
935
936
937
938 float Calculadistancia(float myCoordsX, float myCoordsZ, float myCoordsY,
939 float eNx, float eNz, float eNy)
940 {
941 //Use the 3d distance formula to get a resulting Floating distance value POW!!
942 return sqrt(
943 pow(double(eNx - myCoordsX), 2.0) +
944 pow(double(eNy - myCoordsY), 2.0) +
945 pow(double(eNz - myCoordsZ), 2.0));
946 }
947
948void Aimbot()
949{
950 float fNearest = (float)INT_MAX;//Meu cod
951 int iAimAt = -1;
952 int gambiarrameutime = 12;
953 ///////
954 //Declare our target list to define our victims through a dynamic array
955 TargetList_t* TargetList = new TargetList_t[NumOfPlayers];
956 //Loop through all our players and retrieve their information
957 //we use this mainly here to find out what players are our enemies and what players are on our team
958 //loops through players to set the target enemies
959 int targetLoop = 0;
960 for(int i = 1; i < NumOfPlayers; i ++) //Começa com 2 pq se n mira em mim mesmo e explode a porra toda
961 {
962 if (GetAsyncKeyState(VK_RBUTTON)) { ////Meu
963 i++;
964 }
965 if (GetAsyncKeyState(VK_F2)) { ////Meu
966 gambiarrameutime = 12;
967 }
968 if (GetAsyncKeyState(VK_F3)) { ////Meu
969 gambiarrameutime = 16;
970 }
971
972 if (GetAsyncKeyState(VK_F4)) { ////Meu
973 gambiarrameutime = 8;
974 }
975
976
977 PlayerList[i].ReadInformation(i);
978
979 // Skip if they're my teammates.
980 if (PlayerList[i].Team == MyPlayer.Team)
981 continue;
982
983 //Make sure our targets have at keast 2 health
984 if (PlayerList[i].Health < 2)
985 continue; //break to next iteration //Tirar
986
987 if(Calculadistancia(MyPlayer.Position[0], MyPlayer.Position[1], (MyPlayer.Position[2]),PlayerList[i].Position[0],PlayerList[i].Position[1], (PlayerList[i].Position[2]) ) < fNearest )//dis :D
988 {
989
990 // if(!Parede.noobie && !Parede.aimdelay) { //Mudar aki...
991
992 iAimAt = i;
993
994 fNearest = Calculadistancia(MyPlayer.Position[0], MyPlayer.Position[1],
995 (MyPlayer.Position[2]),PlayerList[i].Position[0],PlayerList[i].Position[1], (PlayerList[i].Position[2]) );
996 // }
997 }
998
999
1000 //PlayerList[i].Position[2] -= 10;
1001 CalcAngle (MyPlayer.Position, PlayerList[i].Position, PlayerList[i].AimbotAngle);
1002
1003 //ONCE WE GET HERE we have already read all the information we want, all enemies have been checked for valid data
1004 //Therefore players on our team a dont get selected and only enemies with over 1 health are allowed
1005
1006 //WE NOW DEFINE A LIST OF ENEMIES TO SHOOT AT, from here we will scan that array and choose to aim at the closest one
1007 //Create our target loop player and store the most important information
1008 TargetList[targetLoop] = TargetList_t(PlayerList[i].AimbotAngle, MyPlayer.Position, PlayerList[i].Position);
1009
1010 //Increment so we can add more players onto the array
1011 targetLoop++;
1012 }
1013
1014
1015
1016
1017 //ONLY AIM if we have any enemies
1018 if(targetLoop > 0)
1019 {
1020 //SORT ENEMIES ARRAY BY DISTANCE before AIMING AT THEM
1021 //JUST NORMAL std::sort function with our custom comparator, not much to it
1022 //target loop -1 because it will always go 1 above the count
1023 std::sort(TargetList, TargetList+targetLoop, CompareTargetEnArray());
1024
1025 //AIM at the closest guy we found,
1026 //by default aim at ALL times, if you right click hold it switches it off
1027 //This isn't the best example but change the example to whatevery you like E.g. Left click etc...
1028 if (GetAsyncKeyState(VK_MBUTTON))
1029 {
1030 if(iAimAt != -1) {
1031
1032
1033 /*
1034 WriteProcessMemory (fProcess.__HandleProcess,
1035 (PBYTE*)(fProcess.__csgoexe+dw_m_angRotation),
1036 TargetList[0].AimbotAngle, 12, 0);*/
1037
1038 if(MyPlayer.Health > 2) { //Evita um bug louco
1039 WriteProcessMemory (fProcess.__HandleProcess,
1040 (PBYTE*)(dw_m_angRotationFINAL),
1041 TargetList[0].AimbotAngle, 14, 0);
1042 }
1043/*
1044 WriteProcessMemory (fProcess.__HandleProcess,
1045 (PBYTE*)(dw_m_angRotationX),
1046 TargetList[0].AimbotAngle, 12, 0);
1047
1048 WriteProcessMemory (fProcess.__HandleProcess,
1049 (PBYTE*)(dw_m_angRotationY),
1050 TargetList[0].AimbotAngle, 12, 0);
1051 WriteProcessMemory (fProcess.__HandleProcess,
1052 (PBYTE*)(dw_m_angRotationZ),
1053 TargetList[0].AimbotAngle, 12, 0);*/
1054
1055
1056
1057
1058
1059 }
1060
1061 //no recoil above text
1062 }
1063
1064 }
1065 //reset the loop counter
1066 targetLoop = 0;
1067 //DELETE OUR ARRAY and clear memory, very important
1068 delete [] TargetList;
1069}
1070
1071
1072
1073int main()
1074{
1075
1076 fProcess.RunProcess(); // Waiting for CSS......
1077 cout << "Game found! Running Aimbot..." << endl;
1078
1079 //Exit if the F6 key is pressed
1080 while (!GetAsyncKeyState(F6_Key)) // or for(;;)
1081 {
1082 //Read player information into our struct so we know the player
1083 //base and the bunny hop addresses
1084
1085
1086 MyPlayer.ReadInformation();
1087 // EncontraAngulo();
1088
1089
1090 //Call our Aimbot
1091
1092 Aimbot();
1093
1094 }
1095}
1096
1097We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
1098Not a member of Pastebin yet?
1099Sign Up, it unlocks many cool features!
1100
1101create new paste / dealsnew! / syntax languages / archive / faq / tools / night mode / api / scraping api
1102privacy statement / cookies policy / terms of service / security disclosure / dmca / contact
1103
1104By using Pastebin.com you agree to our cookies policy to enhance your experience.
1105Site design & logo © 2019 Pastebin; user contributions (pastes) licensed under cc by-sa 3.0 -- FavPNG -- Dedicated Server Hosting by Steadfast
1106Top