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 


How To Draw Custom Text Onto The Game Screen

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
kaboom
How do I cheat?
Reputation: 0

Joined: 15 Jan 2010
Posts: 2

PostPosted: Fri Jan 15, 2010 8:22 am    Post subject: How To Draw Custom Text Onto The Game Screen Reply with quote

How To Hook DirectX Games And Draw Custom Text Onto The Games Screen like fraps.

maybe some one has an example in delphi ? Shocked
Back to top
View user's profile Send private message
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Fri Jan 15, 2010 4:55 pm    Post subject: Reply with quote

Look into the ID3DXFONT interface (and ID3DXSPRITE)
Back to top
View user's profile Send private message
iPromise
Grandmaster Cheater
Reputation: -1

Joined: 27 Jun 2009
Posts: 529
Location: Canada

PostPosted: Fri Jan 15, 2010 7:58 pm    Post subject: Reply with quote

Use TextOut()
Back to top
View user's profile Send private message MSN Messenger
LolSalad
Grandmaster Cheater
Reputation: 1

Joined: 26 Aug 2007
Posts: 988
Location: Australia

PostPosted: Fri Jan 15, 2010 8:15 pm    Post subject: Reply with quote

iPromise wrote:
Use TextOut()


DirectX, not GDI...

_________________
Back to top
View user's profile Send private message MSN Messenger
kaboom
How do I cheat?
Reputation: 0

Joined: 15 Jan 2010
Posts: 2

PostPosted: Sat Jan 16, 2010 2:25 am    Post subject: Reply with quote

slovach wrote:
Look into the ID3DXFONT interface (and ID3DXSPRITE)


lol.
Well, thanks for you participation in discussion , but this answer really sucks Very Happy
Back to top
View user's profile Send private message
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Sat Jan 16, 2010 3:43 am    Post subject: Reply with quote

Hardly a discussion if all you wanted was all the code to be fed to you, since you apparently didn't even bother to search for what I posted.

Have fun implementing your own routine, I guess.
Back to top
View user's profile Send private message
Hologram
How do I cheat?
Reputation: 0

Joined: 07 Jan 2010
Posts: 8

PostPosted: Sat Jan 16, 2010 3:54 pm    Post subject: Reply with quote

Hook Direct3DCreate() API function if the game uses IDirect3D, for game using IDirectDraw you have to hook DirectDrawCreate() (check for hooking COM interfaces).
After getting the interface object you have full control over it.
Create overlay surface, get its device context and use GDI to draw text. Than display the overlay over the primary surface which you can get by enumerating or hooking CreateSurface() API function.

Another way is using proxy dll.

I have written described hook in delphi. But maybe if you a more specific question?
Back to top
View user's profile Send private message
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Sat Jan 16, 2010 5:35 pm    Post subject: Reply with quote

Hologram wrote:
Hook Direct3DCreate() API function if the game uses IDirect3D, for game using IDirectDraw you have to hook DirectDrawCreate() (check for hooking COM interfaces).
After getting the interface object you have full control over it.
Create overlay surface, get its device context and use GDI to draw text. Than display the overlay over the primary surface which you can get by enumerating or hooking CreateSurface() API function.

Another way is using proxy dll.

I have written described hook in delphi. But maybe if you a more specific question?


Overlay surfaces have iffy driver support if I remember right, and GDI doesn't tend to play too nicely with exclusive mode.
Back to top
View user's profile Send private message
Hologram
How do I cheat?
Reputation: 0

Joined: 07 Jan 2010
Posts: 8

PostPosted: Sun Jan 17, 2010 7:20 am    Post subject: Reply with quote

Yes, you are right with that iffy driver support. If I may ask what methodology would be more suitable for games using DirectDraw (old games)? Hooking Flip() or Blt() APIs and drawing text directly into the primary surface?
Back to top
View user's profile Send private message
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Sun Jan 17, 2010 7:58 pm    Post subject: Reply with quote

Hmm, I thought GDI and DD didn't get along too nicely, but I might have been thinking of something else.


I'm guessing the MSDN article for IDirectDrawSurface::Lock is saying that GetDC/ReleaseDC 'lock' the surface as well so you can do GDI drawing. I'm not sure how fast it would be though, but this is probably the easiest way.

If speed is a problem, I guess you could draw your character map into another surface and handle the drawing yourself.
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