|
Cheat Engine The Official Site of Cheat Engine
|
View previous topic :: View next topic |
Author |
Message |
Viloresi Expert Cheater Reputation: 0
Joined: 02 Feb 2017 Posts: 149
|
Posted: Sat Feb 18, 2017 1:19 pm Post subject: Esp hack question |
|
|
Edit n° 2: the code you see is very wrong, I managed to fix a lot of math calculations, I think I will post it when I've finished
Hello, I'm doing an hack... it is the ESP (the one used to see through walls, in short terms).
But I was wondering if it is possible to do it without the view matrix?
I've these values:
- Player coordinates (X,Y,Z)
- Enemy coordinates (X,Y,Z)
- The view angles (X,Y) of player
- The FOV (which I've set to 90)
so I would like to make a personal world to screen function, I've tought about that alot... but I think I'm missing something, I mean I could do every math calculation I want but I'm not sure that just with those values it will be possible. (or I may be just ignorant :S)
I've written some code in c++: (it works at 50% I should say, but still I see that I'm missing a variable, there is something wrong in it)
Code: |
void WorldToScreen( ) // Maybe :/
{
int yresolution = 768 , fov = 90;
float viewangle,angleplayertoenemy,angleplayertoenemy2,pointenemyx;
float angles[0]; // this angle is calculated by another function, it is the orizontal angle that should be replaced in the orizontal view angle (address) of the game (it's used by an aimbot for example, that's why I've put it in an array)
delta[1]=Yenemy - Yplayer; // this is just an example, to avoid a lot of junk code, aniway it is the distance from the player to the enemy in the Y axis
ReadProcessMemory(fProcess.__HandleProcess, (PBYTE*)(Vita + dw_m_angRotation), &viewangle, sizeof(int), 0); // this reads the viewangle of the player
angleplayertoenemy = (angles[0] - viewangle) / 57.295779513082f;
angleplayertoenemy2 = 90 - angleplayertoenemy;
pointenemyx = (delta[1] / cosf(angleplayertoenemy2))*sinf(angleplayertoenemy2);
planNconverted = ((delta[1]) / (sinf(fov / 2))) * (cosf(fov / 2)) * 2;
pointX = ((fov / planNconverted) * pointenemyx);
pointY = (yresolution / 2);
}
// after all this code I will draw a rectangle where the enemy is
DrawRectangle(pointX,pointY,10,10,10); // (this is just an example )
|
I hope someone of you can give me some help, thank you!
Edit: I've added an explanation for the angles[0] which I didn't add previously... I'm sorry about that, actually this code is kinda a piece of crap, because it's not working the way it should, I've posted it just to give you an Idea about what I'm trying to do, but don't focus on it too much ...
Last edited by Viloresi on Sun Feb 19, 2017 9:38 am; edited 3 times in total |
|
Back to top |
|
|
STN I post too much Reputation: 42
Joined: 09 Nov 2005 Posts: 2672
|
Posted: Sat Feb 18, 2017 2:37 pm Post subject: |
|
|
You will have better luck asking this on multiplayer forums.
_________________
|
|
Back to top |
|
|
Viloresi Expert Cheater Reputation: 0
Joined: 02 Feb 2017 Posts: 149
|
Posted: Sat Feb 18, 2017 2:43 pm Post subject: |
|
|
STN wrote: | You will have better luck asking this on multiplayer forums. |
thank you for the advice, but I'm not 100% that I understood what you mean with "multiplayer forums", btw I think I'll ask this in some other forums too.
btw I think the problem is in this part:
Code: |
pointX = ((fov / planNconverted) * pointenemyx);
|
I'm dividing the fov for that "lenght" that connects the "right" side (the inclined line on the right) of the fov with the left line .
This is what I'm thinking right now and it could be wrong,
maybe what I'm missing is that term at the numerator( the "fov" ) shouldn't be there, instead there must be some other value probably the one called rightX in the viewmatrix.... which I don't have.
(but I'm not sure).
If anybody of you have any suggestion it will be highly appreciated, I've tried to search this on the internet and I didn't find any result (that's also why I think this may be impossible)
|
|
Back to top |
|
|
STN I post too much Reputation: 42
Joined: 09 Nov 2005 Posts: 2672
|
Posted: Sat Feb 18, 2017 3:44 pm Post subject: |
|
|
Nobody makes ESPs for SP games (these are sp games focused forums), its pointless when you can have unlimited health. Multiplayer hacking forums are dedicated to esps/aimbots thats why i suggested those, you're also free to mention game name whereas you're not here.
_________________
|
|
Back to top |
|
|
Viloresi Expert Cheater Reputation: 0
Joined: 02 Feb 2017 Posts: 149
|
Posted: Sat Feb 18, 2017 3:51 pm Post subject: |
|
|
STN wrote: | Nobody makes ESPs for SP games (these are sp games focused forums), its pointless when you can have unlimited health. Multiplayer hacking forums are dedicated to esps/aimbots thats why i suggested those, you're also free to mention game name whereas you're not here. |
Right, I understand !
This game is called Assault Cube, it is singleplayer I've choosed it because it's a small game and maybe you already know that it is really "cheating-friendly"
|
|
Back to top |
|
|
Filipe_Br Master Cheater Reputation: 3
Joined: 07 Jan 2016 Posts: 272 Location: My house
|
|
Back to top |
|
|
Viloresi Expert Cheater Reputation: 0
Joined: 02 Feb 2017 Posts: 149
|
Posted: Sun Feb 19, 2017 2:06 pm Post subject: |
|
|
Thx, I've already seen that guide, and he uses the view matrix which is useless for what I've seen so far... Now my esp is working but I'm just having a little bug with the vertical view angle, tomorrow I think I'll fix it and I'll post the equations ( since I've tried to search them on the internet without results )
|
|
Back to top |
|
|
Viloresi Expert Cheater Reputation: 0
Joined: 02 Feb 2017 Posts: 149
|
Posted: Mon Feb 20, 2017 5:51 am Post subject: |
|
|
Up: Now I understand why the view matrix is needed, because without the height of the camera it's impossible to make an esp hack for a 3d game...
I don't have any problem with the 2 axis of the "ground" because as the position of the player changes on the ground prospect, the camera X and Y coords will change too since it is fixed on the player position....
for the height (which I'm used to call the Z coordinate) you can't use the player Z coordinate as the same for the camera, since for example:
if the player crouch the camera will move down while the player Z coordinate will not change... (but this is not the only problem, because if you use the Z coordinate of the player some other "geometry" related weird stuff will happen).
Now I will find the camera height and I'll try to fix it, btw if in a game the camera is not fixed on player coordinates the esp will not work with this technique.
|
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
|