Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


An interesting fact in a game using d3d9

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Viloresi
Expert Cheater
Reputation: 0

Joined: 02 Feb 2017
Posts: 149

PostPosted: Wed Dec 05, 2018 5:28 pm    Post subject: An interesting fact in a game using d3d9 Reply with quote

I've noticed in a d3d9 game (I don't say the name to avoid any problem, but if a moderator asks I'll say it) this thing:

I'm trying to make a wallhack using the zBuffer trick but I guess the developers made a fix, and I don't know how they did it... let me explain, when I change the zBuffer of a playermodel, I can see him behind some walls, but I can't behind some others but instead if I delete the texture of the wall to see behind it, I still can't see the player model but I see his shadow << that's the key I guess, I can see his shadow, but I don't understand what it means... why direct3d would display a shadow of a model that doesn't exists? So my guess is like if they made a function that gives the player a transparent texture if he is behind certain walls or what?

I guess at0mos maybe has a clue of what might be happening, thank you. Rolling Eyes
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 198

Joined: 25 Jan 2006
Posts: 8517
Location: 127.0.0.1

PostPosted: Thu Dec 06, 2018 1:15 am    Post subject: This post has 1 review(s) Reply with quote

In some games, the entity data isn't given to you if the player is behind enough things or far enough away that the server deems you out of range and don't need the data. It could be the fact that you aren't seeing them because of something like this. An example of a game that does this, CSGO. They started doing server sided visibility checks and such to prevent most wallhacks and ESP from working from far distances.

There are other means of getting the data needed to see players from other distances though such as sound information or other physics engine data that may relate to another player. If you still see the shadow, or if you have the player information you could just draw your own skeleton/textures to render the model yourself.

Other things to check if you do have the data is the depth buffer, render states, and to make sure that you are properly altering all layers between yourself and the player.

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
Viloresi
Expert Cheater
Reputation: 0

Joined: 02 Feb 2017
Posts: 149

PostPosted: Thu Dec 06, 2018 6:55 am    Post subject: Reply with quote

atom0s wrote:
In some games, the entity data isn't given to you if the player is behind enough things or far enough away that the server deems you out of range and don't need the data. It could be the fact that you aren't seeing them because of something like this. An example of a game that does this, CSGO. They started doing server sided visibility checks and such to prevent most wallhacks and ESP from working from far distances.

There are other means of getting the data needed to see players from other distances though such as sound information or other physics engine data that may relate to another player. If you still see the shadow, or if you have the player information you could just draw your own skeleton/textures to render the model yourself.

Other things to check if you do have the data is the depth buffer, render states, and to make sure that you are properly altering all layers between yourself and the player.


atomos you are always a great knowledge source! Anyway I missed another particular thing... I've noticed that there is some kind of a bug that bypasses the problem I explained above, this bug consists of: when I aim the gun in a way that I cover the "position" of a enemy behind a wall with my gun , I can see him through my gun texture.
let me explain better : my gun if positioned correctly seems like some sort of an xray viewer( I don't know how to call it otherwise) Wink ... I can see players if I manage to cover them with my gun model.

So resuming, I'm not sure that the server doesn't send the entity data, because otherwise the bug above shouldn't happen, and also the shadow shouldn't be displayed at all... the fact the shadow is displayed seems to me some sort of a wallhack fix didn't made well by the developers...

In response to your suggestions:
I've tried to change the depth buffer without success and also render states(fillmode, zbuffer, blending)...
The only informations I have about players are the stride number and the primcount and vertices of some textures, this is what my wallhack uses.
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 198

Joined: 25 Jan 2006
Posts: 8517
Location: 127.0.0.1

PostPosted: Tue Dec 11, 2018 2:24 pm    Post subject: Reply with quote

It's hard to say without knowing what game it is, but given that its online based on what you are saying you can't name it here otherwise it'd break the rules and this thread would be locked.

That said, play around with monitoring the other player data to make sure it is or isn't staying updated based on distance and depth behind objects to rule out if that is even something to worry about.

Outside of that, making things show up over other stuff is mainly a matter of altering the render states of the specific object, in your case the player model and anything attached to it (so you'd need to get the information for not just the player model but anything attached like their gun, radio, bomb, hats/helmets, etc.)

In most cases it's just done by disabling the Z render state before drawing the object that you deemed the player model and anything attached to it.

Code:

if (/* checks to validate if its the player model you want to draw */)
{
    device->SetRenderState(D3DRS_ZENABLE, FALSE);
    device->DrawPrimitive(...); // can be any of the primitive drawing calls..
    device->SetRenderState(D3DRS_ZENABLE, TRUE);
}


Another method is altering the Z func used to handle the depth testing and ordering. This also relies on the depth buffer being used and setup in a way that would allow you to write to it and alter it as needed.

Code:

device->SetRenderState(D3DRS_ZWRITEENABLE, TRUE);
device->SetRenderState(D3DRS_ZFUNC, D3DCMP_LESSEQUAL);


Depeding on how the depth buffer is used, you can change the D3DCMP_LESSEQUAL value to one of the other available options as well.

Other things you can mess with as well is shaders and altering the texture used to render the parts of the player model to make chams but as a means to see things better.

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
Viloresi
Expert Cheater
Reputation: 0

Joined: 02 Feb 2017
Posts: 149

PostPosted: Tue Dec 11, 2018 6:18 pm    Post subject: Reply with quote

atom0s wrote:
It's hard to say without knowing what game it is, but given that its online based on what you are saying you can't name it here otherwise it'd break the rules and this thread would be locked.

That said, play around with monitoring the other player data to make sure it is or isn't staying updated based on distance and depth behind objects to rule out if that is even something to worry about.

Outside of that, making things show up over other stuff is mainly a matter of altering the render states of the specific object, in your case the player model and anything attached to it (so you'd need to get the information for not just the player model but anything attached like their gun, radio, bomb, hats/helmets, etc.)

In most cases it's just done by disabling the Z render state before drawing the object that you deemed the player model and anything attached to it.

Code:

if (/* checks to validate if its the player model you want to draw */)
{
    device->SetRenderState(D3DRS_ZENABLE, FALSE);
    device->DrawPrimitive(...); // can be any of the primitive drawing calls..
    device->SetRenderState(D3DRS_ZENABLE, TRUE);
}


Another method is altering the Z func used to handle the depth testing and ordering. This also relies on the depth buffer being used and setup in a way that would allow you to write to it and alter it as needed.

Code:

device->SetRenderState(D3DRS_ZWRITEENABLE, TRUE);
device->SetRenderState(D3DRS_ZFUNC, D3DCMP_LESSEQUAL);


Depeding on how the depth buffer is used, you can change the D3DCMP_LESSEQUAL value to one of the other available options as well.

Other things you can mess with as well is shaders and altering the texture used to render the parts of the player model to make chams but as a means to see things better.


I've tried all the things you said... (disabling Z buffer is what I'm already doing with my wallhack, and I've also tried to change the ZFUNC with many parameters without success.)
but anyway in these days I've checked more forums and the internet and I've seen that basically all the cheats online for this game don't have a good chams or wallhack (just like mine), they have just a very great ESP (it shows every player correctly, doesn't matter where they are) which probably works by reading the actual positions of players in memory, without d3d hooks (because their chams works exactly buggy as mine), so I guess there must be something else the developers changed in d3d...
I clearly don't understand how d3d works, how it "loads" textures in memory.
Let me explain I can't change the Z buffer or altering the Z function in order to show something that is not being "loaded" right? Rolling Eyes .
Resuming:
The server still sends the positions of the players, I'm sure because I've checked other cheats (tried also) and they have a full working ESP Boxes, but it's just a fix they made with d3d. ( I guess)
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites