| View previous topic :: View next topic |
| Author |
Message |
kaboom How do I cheat?
Reputation: 0
Joined: 15 Jan 2010 Posts: 2
|
Posted: Fri Jan 15, 2010 8:22 am Post subject: How To Draw Custom Text Onto The Game Screen |
|
|
How To Hook DirectX Games And Draw Custom Text Onto The Games Screen like fraps.
maybe some one has an example in delphi ?  |
|
| Back to top |
|
 |
hcavolsdsadgadsg I'm a spammer
Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
Posted: Fri Jan 15, 2010 4:55 pm Post subject: |
|
|
| Look into the ID3DXFONT interface (and ID3DXSPRITE) |
|
| Back to top |
|
 |
iPromise Grandmaster Cheater
Reputation: -1
Joined: 27 Jun 2009 Posts: 529 Location: Canada
|
Posted: Fri Jan 15, 2010 7:58 pm Post subject: |
|
|
| Use TextOut() |
|
| Back to top |
|
 |
LolSalad Grandmaster Cheater
Reputation: 1
Joined: 26 Aug 2007 Posts: 988 Location: Australia
|
Posted: Fri Jan 15, 2010 8:15 pm Post subject: |
|
|
| iPromise wrote: | | Use TextOut() |
DirectX, not GDI... _________________
|
|
| Back to top |
|
 |
kaboom How do I cheat?
Reputation: 0
Joined: 15 Jan 2010 Posts: 2
|
Posted: Sat Jan 16, 2010 2:25 am Post subject: |
|
|
| slovach wrote: | | Look into the ID3DXFONT interface (and ID3DXSPRITE) |
lol.
Well, thanks for you participation in discussion , but this answer really sucks  |
|
| Back to top |
|
 |
hcavolsdsadgadsg I'm a spammer
Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
Posted: Sat Jan 16, 2010 3:43 am Post subject: |
|
|
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 |
|
 |
Hologram How do I cheat?
Reputation: 0
Joined: 07 Jan 2010 Posts: 8
|
Posted: Sat Jan 16, 2010 3:54 pm Post subject: |
|
|
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 |
|
 |
hcavolsdsadgadsg I'm a spammer
Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
Posted: Sat Jan 16, 2010 5:35 pm Post subject: |
|
|
| 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 |
|
 |
Hologram How do I cheat?
Reputation: 0
Joined: 07 Jan 2010 Posts: 8
|
Posted: Sun Jan 17, 2010 7:20 am Post subject: |
|
|
| 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 |
|
 |
hcavolsdsadgadsg I'm a spammer
Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
Posted: Sun Jan 17, 2010 7:58 pm Post subject: |
|
|
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 |
|
 |
|