1

I'm currently working on a C++ DLL project. This DLL will be injected into a game.

All I'm looking to do for now is draw some text like "Active" or "Working" in the bottom right or left hand corner of the screen when in game.

Just to give me something visual to show that the DLL is working and active/injected.

ChrisF
  • 134,786
  • 31
  • 255
  • 325
Graven
  • 13
  • 1
  • 3
  • Do you want your code to work with any and all games no matter what they're written with, or do you know what game you will work with? Do you know DirectX? Do you know any techniques for getting words on to the screen? Do you have any design or architecture in place for this DLL yet? – Kate Gregory Jun 10 '13 at 18:37
  • I want it to work with just this game, see, this game automatically loads any .asi file found in its directory. – Graven Jun 10 '13 at 19:18
  • At the moment you have not provided enough information for anyone to be able to help you. Please edit your question with things like what game you want to work with and what libraries or frameworks you plan to use. You haven't even said what operating system you're targeting. – Kate Gregory Jun 10 '13 at 19:20
  • I want it to work with just this game, see, this game automatically loads any .asi file found in its directory. I've not really worked with DirectX although I've searched online for drawing text with DirectX but found no topics related to my exact question. The only thing implemented into the DLL so far is checking that the current process it's attached to is the one I want. I'm looking to intercept the games Save/Load functions then use my DLL to write the save files instead, is this even possible? I'm targeting "Grand theft auto: San Andreas" on the Windows OS. – Graven Jun 10 '13 at 19:21

1 Answers1

0

I haven't done this myself and this is an amalgamation of resources. First of all, since you're targeting GTA San Andreas, you should know that it's running using DirectX 9. I'm not aware of any OpenGL rendering version, so correct me if I'm wrong. Now about how to 'inject' make a draw call to render an overlay, please look in here: Hooking DirectX EndScene from an injected DLL. So, basically you change DirectX function EndScene() with your custom function that draws the text you need and then calls the actual EndScene(). Let me know if you want to know more.

Helpful links:

  1. Draw text in Direct3D 9
  2. What is the most efficient way to draw text in DirectX 9?
Community
  • 1
  • 1
Vite Falcon
  • 6,575
  • 3
  • 30
  • 48
  • Thankyou immensely for your reply, I will take a look. Just a note, I will be renaming the DLL to ASI when built, will I still be able to use this method? – Graven Jun 10 '13 at 19:34
  • As long as your DLL (or ASI) gets loaded in memory and your method that hooks your custom call to DirectX's call, you should be fine. Naming doesn't matter. – Vite Falcon Jun 10 '13 at 22:58
  • Thankyou Vite! The link you provided doesn't have source code for displaying text? – Graven Jun 10 '13 at 23:10
  • It's not about displaying text, it's about 'where' to hook it. To Draw text, see the changes to my answer. – Vite Falcon Jun 10 '13 at 23:17
  • The bottom link's source code is out of date, thankyou for the support and calmness with a beginner. – Graven Jun 10 '13 at 23:29
  • If this did help you with resolving your issue, please mark it as the answer. Thanks. – Vite Falcon Jun 10 '13 at 23:32