| View previous topic :: View next topic |
| Author |
Message |
DrGamut Newbie cheater
Reputation: 0
Joined: 14 Feb 2006 Posts: 10
|
Posted: Sat Jun 02, 2012 8:35 am Post subject: DirectX question. |
|
|
So this might be the place to ask. As part of a school project I wanted to write a program to demonstrate exploitation of video games to gain advantage. I thought I would write a DirectX hook aimbot for a sample game.
I loaded the game in Microsoft PIX from the DX SDK and captured the render of a particular frame. I isolated the call that draws the mesh I would like to target, it looks like this in PIX: <0x078A0268> IDirect3DDevice9::DrawIndexedPrimitive(D3DPT_TRIANGLELIST, 0, 712, 2306, 3774, 3974)
I can check the vertex buffer that was last set with SetStreamSource and find the xyz coordinates of the vertices in the mesh, but they all seem relative to each other. What I want to know is the coordinates of the vertices or center of the mesh within the viewport. How can I find or calculate these?
I have little (read, none) experience with computer graphics. So I apologize if my question is dumb.
|
|
| Back to top |
|
 |
vnlagrla Cheater
Reputation: 0
Joined: 10 Apr 2011 Posts: 33
|
|
| Back to top |
|
 |
Dark Byte Site Admin
Reputation: 471
Joined: 09 May 2003 Posts: 25831 Location: The netherlands
|
Posted: Sat Jun 02, 2012 7:41 pm Post subject: |
|
|
That method makes use of knowledge about the internal game mechanics like player position, speed, etc...
The topic starter wants to specifically show the flaw in dx9 and earlier (dx10+ won't work this way)
Anyhow check http://code.google.com/p/cheat-engine/source/browse/branches/Cheat%20Engine%20Old/DirectXHook/directx9hook.pas
It watches all render commands and when a specific texture is being rendered (e.g the head texture) it uses the world, view and projection matrixes to get the point on the screen (you can't get those in dx10+ without experimenting with buffers)
D3DXVec3Project
Example: http://code.google.com/p/cheat-engine/source/browse/branches/Cheat%20Engine%20Old/DirectXHook/directx9hook.pas#1802
Then it watches 3 or more frames to see distance in pixels change. Then it extrapolates that to predict where the next point on the screen will be.
It then calculates how much the mouse has to move to bring that point to the center of the screen and then issues the mouse move command to do that, followed by an optional left mouse click
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
| Back to top |
|
 |
DrGamut Newbie cheater
Reputation: 0
Joined: 14 Feb 2006 Posts: 10
|
Posted: Sat Jun 02, 2012 11:10 pm Post subject: |
|
|
| vnlagrla wrote: | I have a few questions. what language are you writing it in?
when is this project due. |
C++, I have two weeks to submit my project.
| Dark Byte wrote: | | It watches all render commands and when a specific texture is being rendered (e.g the head texture) it uses the world, view and projection matrixes to get the point on the screen (you can't get those in dx10+ without experimenting with buffers) |
Thanks!
|
|
| Back to top |
|
 |
|