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 


DirectX question.

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
DrGamut
Newbie cheater
Reputation: 0

Joined: 14 Feb 2006
Posts: 10

PostPosted: Sat Jun 02, 2012 8:35 am    Post subject: DirectX question. Reply with quote

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
View user's profile Send private message
vnlagrla
Cheater
Reputation: 0

Joined: 10 Apr 2011
Posts: 33

PostPosted: Sat Jun 02, 2012 6:47 pm    Post subject: Reply with quote

you don't really need to know much about graphics
http://www.oldschoolhack.de/tutorials/World%20of%20Game%20Hacking%20-%20The%20Home%20of%20CES%20-%20aimbot%20Tutorial!.html
^Add !.html

You get enemy xyz, your xyz, your h and v looks, and you use trigonometry to find out where your h and v look needs to be to aim at the enemy from your position. I have a few questions. what language are you writing it in?
when is this project due.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 471

Joined: 09 May 2003
Posts: 25831
Location: The netherlands

PostPosted: Sat Jun 02, 2012 7:41 pm    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
DrGamut
Newbie cheater
Reputation: 0

Joined: 14 Feb 2006
Posts: 10

PostPosted: Sat Jun 02, 2012 11:10 pm    Post subject: Reply with quote

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
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