CSGO Aimbot Tutorial & CalcAngle Explained

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
welcome to the import - toriel by the NFS tutorial you're going to have a fully functional ambit and you will understand how it works I structured this tutorial in four sections first I'm going to show you what we are actually creating in this tutorial then I will try to make you understand what we are trying to calculate to get this M worth working then we do the calculations and finally we jump into visual studio and coat the M word ok so let me start by showing you the result when I inject this DLL here it's an internal M but you can see it aims nicely as to be closed at their closest enemy to us when I kill him names at the next one and kill all of them alright so our goal when creating a game board is to always look at the enemy's head and we can calculate this angle we have to look at using trigonometry and we're going to need our view position and the enemy's head position and as you guys probably remember from school we are going to need right-angled triangles to do some to use our trigonometric functions however that's called but I can't see any triangles here right now so to make this easier for you I added some layers maybe those will have finding these triangles so the this corner right here is my view position and I also added the straight line from our view position to the enemy head the blue one right here and from our head position to the enemy feet and I can see some triangles right now can you see the triangles just like those closed episode panel alright so if I'm standing here and I want to aim at this blue line I have two angles I have to calculate one is the height I have to aim at also called pitch which basically is just this angle between this red and blue right line right here if I stand here I'm currently looking at the red one I just need to aim up exactly this angle towards the blue line and the sec so now we got our height but we still could be off to the right or left side and to get this angle we'll have to spot another right angled triangle and there are many more but I'm going to use this one that's this white line the the right angle here this white line and this red one so if we calculate that angle two we can aim at the correct height I guess maybe and then even aim at the correct jaw which is yeah left to right basically and then we're exactly at the enemy's head there are a few things we have to take into consideration when doing our embark calculation first all we have to determine if our view angles are saved in radians or in degrees and I know there are still a lot of people getting confused by it but it's just two units for the same thing so with radians instead of one full turn being 360 degrees it's just the distance traveled along the outside of the circle specifically of a unit circle that's a circle with a radius of one and therefore one full turn will be equal to two times pi and yeah that's why we can easily convert between degrees and angles so when we have degrees we just have to multiply our value by 180 divided by PI and if we have radians and want to convert to degrees we just have to multiply by pi divided by 180 so absolutely no reason to get freaked out by radians or degrees very easy thing okay so let's jump right into the game and see which unit or view angles are in so when I look all the way down I've added my view angles here in a cheat engine you can see that the pitch is equal to 89 and when I look all the way up you can see my pitch is equal to minus 89 and when I look around myself too to the left you can see that my jaw goes from minus 180 to 0 and then 2 plus 180 in the end okay so yeah what unit are view angles in definitely degrees because as you know a full circle is going to be to two times pi when we have radians and we have values like 180 which would be a half turn if the unit is degrees so it's very safe to say that the engine saves our view angles in degrees yeah so let's take some notes about the information we found so far we know our pitch is in the interval between minus 89 and 89 we know our jaw is from minus 180 to 180 and we know it's degrees the next thing we have to pay attention to is the parameters and return values of the trigonometric functions we are going to use so for example if we were going to use the sine function we can see here that it is expecting an angle expressed in radians and will return the sine of the angle in radians but we actually need the angle itself so we can aim at this angle and not the sine of this angle and therefore we are going to use the inverse function of the sine which is a sine and you can see here it's expecting a value between minus 1 and 1 and below we will return the angle in radians in the interval between minus pi divided by 2 and plus PI divided by 2 so pi divided by 2 by 2 is equal to 90 degrees as you can see here there were also nice enough to give us the formula to convert between degrees and radians and yeah when you see this this interval like between minus 90 degrees and plus 90 degrees I think this would be a very good match to calculate our pitch because it's very close to the yeah to the interval of the game uses to represent all of you angles and it's just 89 because in csgo you just barely can't look all the way up or belly can't look all the way down we will make sure later that we never set our view angles to exactly 90 degrees or minus 90 degrees because our pitch specifically because that's a very easy check for an anti cheat and in fact we'll get you instantly banned in csgo okay yeah so what we got now is we we know what we want to use to calculate our pitch we want to try and use the a sign now we need another trigonometric function to calculate our jaw so let's have a look at cosine again using the inverse function here and let's see what this one returns it returns in the range of 0 and pi so between 0 degrees and 180 degrees now that doesn't match our jaw too well so I will have a look at the tangent function so item C++ and we can see this one returns in returns minus PI half and divided by 2 and PI divided by 2 so this is again in plus 90 and minus 90 it is also not really what we're looking for and but there's another function atan2 so let's have a look at this one and this will return on this ones return value will be in the interval between minus PI and pi which is exactly - Saturday 180 degree and 100 80 degree and we're definitely going to use this one and the main difference between eight and two and regular a turn is that eight and two takes two parameters and what this does for us is it solves the problem and different quadrants so when you have coordinate system quadrants and you can see here for example I'm there for importance in a coordinate system and we would if we were to use regulation we have to catch every case see in which quadrant we end up and then do some calculation based on that but 8 + 2 is going to do everything for us and we just have to take the the return value in radians converted back to degrees and we're good to go all right so now we have our two functions we are going to use to calculate our view angles and we are ready to jump into visual studio and do the actual mbot so let's start with a fresh project here as this is not my first take I will have to come up with a creative name I don't know yeah first I'm going to change the project's configuration type because this is an internal project we're going to make this a DLL oh I only did for release I also have to do it for debug now all right yeah I will start by just copy and pasting some boilerplate code all this goes the Lakotas is defining a main entry creating a threat which will then spawn a debug console and then in an infinity loop just call this her run function until we press delete then it will unload the heck without crashing the game I'm calling this run method it doesn't exist though so I will just by creating it run and then include it here cool so now this run method is getting caught in an infinity loop and yeah let's start by adding in some offsets for the game so we can actually read our position and enemy position and our view angles and nameless offsets I will use haste damper which will automatically use signatures to dump all the required classes right this is a stumper I got csgo running still so now what I can do is just execute it and it will generate a nice header file for me here which I can just open copy and paste my offsets into here so now I got lots of offsets already yeah if you do it on a different game of course you will have to maybe reverse the offsets yourself I'll find them elsewhere okay so let's start by creating our local player class again I'm going to copy just just them so it's going to be a little faster local player yeah so I'm I just created this class which has a static member local player because there will be only one local player made the constructor private so you can't create any more local player objects but we'll have to use this this method here to get an instance right and then I also have code to get my own origin and my view of it my health my team aim at the target enemy and to get the distance so we can aim at the closest enemy to us the more interesting part now is the implementation of this class so let me just and source 5 here local player yeah I just like to copy and paste this over so I know what I'm going to implement all right so let's start with the get function local player pointer local player get all right so yeah what I will be doing here is use the hey Stamper offset to get the game's instance of my local player okay yeah so there's nothing too fancy going on here get module handle will return the base address of the current module get module handle if I pass now in there it will be the module that this DLL is executed in so when you include windows actually call that cool but if you are familiar with see if csgo you know the local player is actually not in the main module like in csgo that X E but in client panorama DLL well okay also I make this epic so it doesn't get it's only ever initialized once when the method first is called and not every time I call get because that's pretty yeah there's CPU intensive alright so now we got the client module address let's get the local player from it low-cal lair just listen to the local player pointer get to client module and then use the offsets I just edit so I have to include them of course offset and use hey Stamper I think it's in signatures and then local player alright cool so if you have any questions regarding local player entity list or anything csgo specific please consider the other tutorials on these topics this one is more about the math behind them and not going to explain how to find these values in csgo or any other game alright so finally we just have to return this value and we are done with our get method cool for the other method methods I'm just going to copy and paste them straight away for from the example project I made for this tutorial because there is nothing special going on yeah let's take origin for an example it will just use the dis pointer which is equal to the local player we returned here and then yeah at the offset that we got from the hey Stamper and then return a pointer to that location okay I think that's all we need for now so let's start with adding other players like our enemy also I made a here another class for local player even though it's also a player because I wanted to have functions like this a Metz function as a member function that I wouldn't be able to use on regular players and I also just like to split that okay so I add a player header file again just copy and paste these things over it's basically the same same stuff as with the local player with the difference that here also edits a function to get the maximum players so I can iterate a loop and then a get player function that will return me the player of an index I can specify here okay yeah the implementation of this class again is not not very special I will just go ahead and fully copy and paste it into here okay I need to add a vector3 class all right file back also paste it over here it's just a class that holds a three variables because positions of course in csgo are three-dimensional and yeah we just allow me to yeah to have the location stored in a separate type you can also always use the source sdk or some heck bases they have classes for all these things defined already okay yeah yeah get player is just getting me the player from the entity list there it has there's a very recent tutorial on the entity list in csgo on this channel so if you have any questions regarding this please watch that tutorial I will also link to this stuff in the description of this tutorial yeah max players will just return the total amount of players yeah the other stuff is the same as in local player and I've also added in here I get bone with bone position which will return the exact position of the head of the player why is he mad can't bone position make the three incomplete types not a lot [Music] is here player we include back to three why how you mad returns incomplete type now because it doesn't know the size of of it here all right I will just return a pointer to it then yeah that's just some simple a specific stuff that I'm not going to go into great detail mmm this is annoying of course now I will just make this return all right let's hope my quick fix you didn't mess everything up let's see if it well with compels I'm kind of surprised did compile it right there okay what do we have left to do we don't have these functions defined yet and I am just going to copy them straight over mm-hmm what are we missing oh no we got get origin we got get view upsets health team gets oh we're missing a met and guess get distance so yeah my aim it is the most important function of this tutorial of course I will just copy and paste to get distance function over and he is made yet again oh because I didn't include vector three here that makes sense at least vector three nice and we need math to do square root right there all right now we're compiling again so get distance we'll just get the three dimensional distance in yeah we'll just get the distance between us and a point we specify in a 3d space it's just plain and plain mouth nothing csgo specific or anything all right and let's see what we're going to put in our HEC method in our run method here so first thing we're going to need is a way to get the enemy that is closest to us and we will have to write a function for it now to not make this tutorial longer than it already is I'm just going to paste this function straight in it's pretty self-explanatory so if you have any trouble with it just pause the video here and have a look at it also the full code will be aware available so no worries okay so if we found closest enemy what we want to do is get our local player and a mat left closest enemy so we get closest enemy get bond position 8 and csgo this will return the position of the head bone yeah and it's all we have to do but we haven't defined this function so that's the next thing we have to do jump in here alright so this is where all the knowledge we gained from the previous parts of this tutorial will yield us good results now that we got all the values that we need to do our calculations let's jump back into csgo and spawn the e triangles and we agree that the first angle we want to calculate is between this red and this blue line so we aim at the correct height since we want to calculate this angle this makes this red line the adjacent this white one right here the opposite and of course the blue one the hypotenuse also we noted that we want to calculate this using the sine function so let's check out what the sine function needs the sine function use the upper side and the hypotenuse so we need this name for it here and this length right here to calculate this angle getting this length of course is easy because it's just the difference in height between our head and the enemy head yeah which is just this white line here basically and then we have to get the length of this blue line because that's you hypotenuse and that's the first thing we're going to do is just get this length so yeah the first thing we have to do for that is actually oops I could be pasted the wrong line is to get the Delta vector which is exactly this blue line and you get a vector between two other vectors by subtracting from your sauce vector from the target vector and so we are subtracting our head position from the enemy's head position and that's exactly what we're doing here to get this blue line which is the T vector and then we use this formula resistance formula again in 3d space to get the length of this blue line which is our hypotenuse so now that we do have the length of it we can calculate the pitch using the sine of Delta Delta vac dot Z which is exactly the height difference of our head and the enemy hat and divide that by Delta vector length which is the length of the hypotenuse I forgot an equal sign there okay and then of course since we will get back radians and csgo as we have determined uses degrees we have to convert it back to degrees before we can use it to set our angles and that's exactly what we're doing here pi is not defined but let's define PI real quick I'm just going to do a double here you name it PI and then set it to private you yeah and I think if we set the view angle our view angles to this pitch angle we should see something in game we are hoping that we have the correct height at least so I'm just going to inject this dll all right and we I can't move upwards or downwards but we see we're definitely not at the head height what we do notice though is as we get higher we aim above the enemy set if we are higher than them and if we are lower we aim below his head and that is because we have to we're currently calculating a sign but we have to prefix this with a minus and that is because our view angles as you can see if I attach cheat engine and csgo yes in this case our pitch so the first haha the first line here will actually decrease if we go higher so if we go all the way up it's minus 89 and if you go all the way down it's 89 so that's why we need to - there I knew this was going to happen in this case but I just wanted for you guys to know that when you're testing your calculations in a game and you see some side effects like this you just know sometimes you will be off by 90 degrees or 180 degrees or you will have to prefix it with a minus and and I don't really think it's worth to to go go and think about all this stuff beforehand it's more important that your calculations is are mathematically correct and you then can deal with game specific stuff as you go okay so now that I've added two - I will quickly recompile it and inject it again and you can now see that I'm always aiming at the correct height to calculate the jaw let me just inject my laser show again yeah we need to calculate this this angle here where we're looking and yeah we said earlier that we were going to use eight and two because the return result is exactly the range that csgo uses so it's a perfect fit so let's check what tangent takes all right engine takes opposite and adjacent so let's fight find the triangle to get this angle where we have those two values so if we extend here and for example we want to [ __ ] this angle here between this white line and this red line we have this white line as our adjacent and this white line as our opposite so that's exactly what we need you have to calculate this angle so what we can do here is float the jaw is equal to 8 and 2 we said we're going to use 8 and 2 because it's better than Athan because we don't have to deal with different quadrants and we're going to use Delta back dot Y and Delta back dot Z again that's just these two lines as you can see the difference in one direction is exactly the white line above me now like this one I'm spawn it again is this one and the difference in the other direction is this white line and it's exactly the triangle we want to calculate so can just use this then of course we will also have to convert the results in radians back to degrees before we can make use of it and then also set our new angles accordingly y equals the jaw and then recompile and checked it into the game and perfect fit we are exactly IMing at the enemy hat and yeah we now can shoot them and yeah there you go now one last thing I want to mention so you don't get instantly banned is clamping any angles what this means is just making sure that the angles you calculate our ballots in the game's engine so as Beauty terms pitch in csgo is between minus eighty nine and eighty nine and jaw is always between minus 180 and 180 and we will just make sure before setting the view angles that we calculate that we are within the range so we are just going to check if pitch pitch is greater or equal to minus eighty nine and pitch is smaller or equal eighty nine and then also if JA is greater or equal to minus 180 and Ja is smaller or equal to 180 and only if that's the case we are going to set our view angles now there are more sophisticated ways to do this and also to make sure that angles for example when when talking about angles 360 degrees is the same as they really and 720 degrees and you never want to set for example 720 degrees to a game so you would take the reminder only of 360 and stuff like this but this is just the gist of it that I wanted to show you here all right and it's that concludes the tutorial I hope you I really hope you learn something and that you also come can apply this knowledge to other games
Info
Channel: Guided Hacking
Views: 84,162
Rating: undefined out of 5
Keywords: aimbot angles, aimbot csgo, aimbot fortnite, aimbot guide, aimbot trigonometry, aimbot tutorial, calcangle tutorial, clamp angles, counter strike, cs go, csgo aimbot, csgo aimbot tutorial, csgo calcangle, csgo cheat, csgo cheats, csgo hack tutorial, csgo offsets, hazedumper, how to, how to make a csgo cheat, how to make aimbot, how to make an aimbot
Id: sDd8aBCCBbA
Channel Id: undefined
Length: 33min 12sec (1992 seconds)
Published: Sun Sep 22 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.