CS2 External Overlay ESP Tutorial | C++

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey everyone today we're going to be making a CS2 external ESP using IMG and an external overlay so let's just hop right into it so we're just going to name our project I'm choosing an empty project for C++ all right so here we have our name so I've created the uh project so I'm just going to hide all files the default ones are kind of [ __ ] and we're going to create a source file and we're also going to create an external file sorry I mean folder all right so in the external folder we're going to create a IMG y uh folder and in Source we're going to create a main.cpp a memory. h and we're also going to create a vector. h all right so next we're going to be getting um imgui so I've headed on to img's GitHub page uh we're just going to hit releases and download uh just scroll all the way down here and you're going to hits source code all right so I have it here uh what we're going to need are these files uh so what I'm going to do is just I'm going to copy them over so head over here into IMG and paste it uh next we're also going to have to head over to back ends in mgy and we're going to have to get dx11 uh yep these two and we're also going to have to get win32 so my memory class is going to be available in the description and uh then we'll get on to making your vexor class all right so uh I've got my memory class here all right so I have my memory class you'll find a slightly different one on my Pace bin but you know we won't be using any of the other things so this will work for now so change this to release uh x64 since CS go is 64 bits head into our properties change this to 20 then you're going to head into advanced multi BTE and head into Linker inputs we need to use d3d 111 uh then in system we're going to have to change this to Windows since we're making a Windows application and in VC ++ directories we going to have to use our uh include directory so navigate over to your external folder and um choose your IMG folder so here great so that's done now let's move on to our vector class first we're going to have to include numbers and cmath uh and next we're going to have to make a view Matrix direct you can find these anywhere there are thousands of them you choose whichever one or you can copy mine all right so once you've written that out we can move on to our actual Vector struct right so once you've written this out don't worry uh it's giving errors just because we haven't defined z uh y or x yet but we'll Define that later all right so now we need to make our operator overload so this is like minus uh plus divided by multiplied you get the point uh yeah so you can almost just copy these just change this and uh this you'll need to write one out and then just copy the rest uh you can you can also create like bigger than smaller than is equal to you know stuff like that but we wouldn't be needing that for this project but if you ever have um nothing to do then go for it I'm actually going to Define XYZ no just because it's kind of annoying me and it's really as simple as that that's all you have to do um now we need to make our world to screen function now same thing you can find this anywhere just use the one that works the best for you where you can use mine uh since this is just like backend [ __ ] you can use really cryptic names for this by the way this is world to screen don't forget that that's really important um just use really cryptic names it doesn't really matter because you won't be seeing this again as long as you do it right also you're going to want to Define screen width and Screen height now in your main.cpp so let's go ahead and do that so um we're going to use get system metrics uh which uses windows. H so much you to find that you can literally just do this so we're using get system metrics to get our width and our height so for me that would be uh 1920 and 1080 back in our vector class we're going to now create our function right so that's a lot to write out but uh you know I believe in you you got it bro so now we're going to Define our X and Y so using screen width and Screen height oh uh yeah sorry uh we need to actually include vector. H in our um project here so vector. H and we can also include our m.h before our vector. H there we go sorry about that and we also need to get our y uh the reason we're doing this is to get the center our screen which will be useful later all right great we're almost done now we just need to return X Y and W all right so that's our world screen function uh WTS for me but you can call it whatever you want uh once you have something similar to this then we can move on to our. cppb and create our overlay all right so I'm in my main. cpb let's include our IMG and the [ __ ] needed forgi uh all right so your include should look like this we DW map i.h d3d11.dll some obscure ass function I could probably do it some other way but I don't really want to do that so let's move on to making our overlay uh so we're going to jump into IMG sorry I forgot to refresh there don't forget to include this uh so head into our win32 and we're just going to to copy this as you can see it's an extern this basically just tells the compiler hey this function exists don't worry about it you know Source trust me bro let's create it and we're also going to need a window procedure so mean I just kind of found this off Google not going to lie and I've always just been using it and it's been fine for my overlays so you know go ahead and copy me go ahead and find something else go ahead and write it yourself you know it's a good learning experience but uh I've used this for a while and it's worked without problems so follow along all right so here's the Obscure function I was talking about when you've uh created your window procedure at least using mine this is why you need Windows X uhh besides that it's a very basic uh window procedure you don't really need anything more uh it's for an overlay you know um so let's move on to our actual entry point of the program so since it's um a windows program we need to do this so is a win main don't weget to spell that correctly so I'm going to take you along when I'm writing this so H instance uh we're going to Define that as instance uh we have a choice for another H but we don't really need that uh a p string which we don't need either so we're just going to skip over it and we're also going to need this to show the window later all right so let's actually start off by making our memory object so unless you've been coding C++ for less than 5 minutes you'll know what an object is anyways I believe in you uh you're definitely not just pasting right now so let's make an object all right so this opens the handle to CS2 uh I would recommend doing um handle hijacking for this but I'm not going to be showing that in this tutorial maybe in the future uh then we need to get our clients great so that's our clients next we need to uh make our window class this is our window class uh the size is obviously the size of well the window class um the window procedure is our own instance is our instance and then the name can be whatever you want so next let's register our class and we're calling our window procedure oh sorry not uh window class not procedure all right next let's create our window uh we'll use top mod transparent and layered for this uh so we're using transparent because we won't the windows to be transparent obviously and we're using layered so we can click through it without issues next we're going to be calling our name call it as a popup we don't want any position set yet uh width will be our screen width and height will obviously be our screen height next will be n berter because we don't have aent for this um window nor is it a menu and instance will call our window class instance and next we can just add no pointer all right we still have a lot of stuff to do all right we still have a lot to do so let's keep moving all right next we set layered window attributes uh on our overlay doesn't matter what color you set here because we're passing uh this uh what's it called we're passing lwa Alpha so it doesn't really matter anyways let's move on uh this sets our area of the window all right here comes the boring ship where we set up our swap Shain uh for our d3d 111 sorry direct X1 all right so basically all you need to know here that's important is this is our refresh rates um AKA well FPS and that's all you really need to know if you want to make it smoother you can increase this or get a better computer you know depending on um well depending on a lot of factors uh next we need to create our device all right so I've gone and created the device like this is a lot of [ __ ] random [ __ ] you don't really need toh care about but it's still needed for the compiler all right guys good job uh now we show our window and update it so we can create our context now for rgy and also don't forget to set a style this doesn't really matter since it's an overlay uh you can create a window on overlay I've done that before it's actually really fun setting up uh like arrow keys for um the different options but it doesn't really matter change this to whatever you want I usually use dark for my menus but I'll go with classtic for now all right so now we have to display it all right now we need to create a Boolean variable for if um our overlay is running and if it ever isn't running then we'll exit IMG and uh destroy our windows and such right so now we need our message Loop all right let's check if we're not running here well uh let's create our new frame now all right so don't forget to add IMG render here so we need to set our color to zero uh because if we don't I'll show you what happens yeah so that'll happen if you don't set the color correctly so you know let's set the color correctly uh so let's set our device context to render our targets nice and let's also render our draw data which we'll use later to draw rectangles and then let's present um so if you set this to one it'll use vsync which I don't like to do usually cuz while it's a lot more performant it it usually ends up a lot more laggy but you can test with vsync and see if it you know works for you if you're not going to be sharing it with any friends or anything it'll probably be fine to use vsync but personally I'd like to just use it use uh without vsync all right so that's that done now we need to shut down IMG destroy context and uh we also need to release our swapchain uh if we're ever exiting if we ever get to this point that means we're like exiting the program so right so on you written this down we're almost done with uh well at least with the overlay uh next we destroy the window and unregister our class and then we're done all right and now we return zero all right so we're officially done with our overlay um there are a thousand of them out there so feel free to use anyone that you like more but this has served me well um so let's create the actual sheet now all right so before we continue with our sheets we're going to have to make a new render function sorry a new render class so let's create a render AG it's not even a class it's an actual namespace you get tired after coding this much so we're going to create a struct for our colors nice so that's our struct then we create our color function right so that's all we need uh now we create our render name space uh and now we have to draw a rectangle so we're going to need void uh and then draw rect we're going to need an INT X int Y in width and in height sorry H and we're going to need our color here so we'll Define that as color and this is RGB so that is the struct is what it's referring to and we need an INT thickness too so the function is very simple actually I'll walk you through it so it's IMI get background draw list and then we need to add a rect and this is imv 2 since it's two Vector points X and Y uh then we need I V two which is x + width and then y + height and then color we Define that as color two zeros because we don't want rounding or any extra flags and thickness is our thickness all right great so this should return no errors this should be fine uh don't forget to also include render Doh I've already done that though uh next we're going to need offsets uh I'll leave a link in the description for the uh dumper where you can get offsets so next we can get into our main sheet Loop but first we need to Define some offsets so first is our local player so this is our local player it's a un pointer and we're reading client plus DW local player uh next is our local origin we're using our um Vector 3 struct uh we're using local players since we're getting our well local origin and we're using the V origin offset next is our view Matrix here uh we're making use of our view Matrix struct and we're calling it view Matrix and it's our client plus DW view Matrix next is very basic it's our entity list and our entity list is also a un pointer and our client and next is our local team and our local team is an INT and it's our local player plus team so let's get into our for Loop so I like to say player index but it's fine if you just call it like I or something which is the standard but um it makes a lot more sense for my just mind to uh read player index instead of like I when we're iterating through it so first is our list entry uh so these are the new calculations for list entry so in CS go just you just iterate through uh your entity lists but this um game is a lot more complicated with the um entity lists and the different entity types but uh we'll get through it together uh so just check if we got our list entry here and then now we can get our player now check if we go to our player uh next we need to get our player pawn and list entry to so our player is a un pointer which is and is also list entry plus 120 and then times our player index and 0x1 FF used to get our HP but they recently added an update where you have to get um another controller instead of this anyways let's check if we got our list entry 2 uh next we can get our PCS player Pawn so this is um a un pointer it's a list entry 2 plus 120 times player pawn and 01 0x1 FF so it's the same as this but instead of player index we're using player Pawn same as always check if we got it all right so next we can check for if the player is alive so uh it actually used to be player Pawn Plus offset and health but they actually did recently change it so do keep in mind this uh this stuff can break but you can always check for unknown sheets uh where people are usually having the same problem um so before you could just check if the player wasn't alive with um if and not Health which would return zero but in CS2 is a lot better to check if they have um equal to or less than zero health or more than 100 so basically just do this check next we can check if our PCS player Pawn is equal to our local player and if it isn't then that means we won't render our own player or sorry if it is so this makes it so we don't render our own player next we need to Define our Vector spot so our player origin and the head all right so this is our origin PCS player B plus uh de origin uh I call this origin because we have to write this one out a lot local origin isn't used as much so that's why it gets a longer name since we aren't using bone matrix uh plus 75f is fine for now uh if you do add a bone matrix it should be very easy to implement next we can get our screen position and our screen head and we're using our world to screen function here and um calling our view Matrix as the arguments and we need to also get screen head uh next we Define height and width uh since width can really change we just use uh divided by 2.4 um you can also use like eye position like where they're looking to like rotate the box but we're not doing that in this tutorial uh next we can Define our colors for the box so if you want uh tmate and enemy I usually do that but since we're only uh rendering enemy this um in this tutorial uh I'll just call it enemy I'll render it as a red since it's a bad guy U next we're actually going to change our world to screen and we're going to be adding a check in the actual uh world to screen function so this checks if they're behind us and if they are uh return false also while you're here don't forget to uh Define this I forgot to and uh I ended up with a lot of Errors so make sure to Define this as an extern integer screen width and also don't forget screen Heights uh next I have a function from my own memory class that I like to use a lot but um this obviously isn't a necessity so this just checks if the window is in the foreground which is uh very nice for esps so next we can draw rectangles uh I'll code this with you I'm not going to cut here so we call our render name space and draw a rectangle then we do screen head do x minus width / two uh and then for our y we can call screen head doy sorry not a capital S there uh and then we call width and as you can see here AG that means height which we defined here uh and then we can call our enemy RGB structs and then I like to set my thickness at 1.5 and this should build so as you can see uh that's actually weird it's surrendering your own teammates but uh I guess I'll fix that later but you know uh it's actually pretty nice since I'm already here uh um Runing our team is found problem putting boxes around them also them it's also laggy since it's external but there are a lot of ways you can fix that but um thank you for watching my tutorial it's um been a very basic CS2 ESP uh I've enjoyed coding it with you um I HED you enjoyed watching um I hope this was a learning experience and not just a pace for you um and I really hope you have a good day bye-bye hey guys so uh post me here I actually forgot to add shck for the player team so we can actually do that right now so after player just add a int player team equals mem do read in uh player plus offset team now uh sorry semicon too and then if player team is equal to local team then you can continue yeah sorry guys I totally missed that
Info
Channel: Asver
Views: 16,490
Rating: undefined out of 5
Keywords: cs2, cheat, esp, c++
Id: wH6QsBshx8o
Channel Id: undefined
Length: 18min 56sec (1136 seconds)
Published: Sun Oct 22 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.