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 


Creating a tool that can overlay on any direct x game

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

Joined: 18 Feb 2015
Posts: 3

PostPosted: Wed Feb 18, 2015 8:23 pm    Post subject: Creating a tool that can overlay on any direct x game Reply with quote

I am looking for a reliable and stable way to add an overlay on any direct X fullscreen game/application.

In my case this is not for cheating but I think the programmers in here are among the most experienced developers for such a task.

I think of something that is as easy and portable as Fraps.
Fraps works without issues with almost any program or game.
I need the same (just overlaying a much larger image).


Does anyone know of something, if possible sample code (favored in C# or also C++) available ?
I'd also be up to compensate the work if someone can write me a realiable demonstration from where I can continue if there is nothing open source available.
Back to top
View user's profile Send private message
SteveAndrew
Master Cheater
Reputation: 30

Joined: 02 Sep 2012
Posts: 323

PostPosted: Wed Feb 18, 2015 9:01 pm    Post subject: Reply with quote

Well, you're going to have to get working and perfect a hook for directx 9, 10, and 11. And also support both 32-bit and 64-bit for all three. Very Happy You could support older versions as well, but I think those three are good enough right? because that's already 6 when you take into account x86/x64...

DirectX 9 is pretty easily done. DX10 & DX11 is where it gets a little tricky, and along with a completely changed way things work internally, there also isn't a built into draw text api like in DX9! But there are free draw text libraries for dx10 and 11 available so thats not too much of an issue. Or you could always use a bitmap containing your font as an image like a lot of games do anyway.

After hearing this you're not ready to give up yet right?

Good. lol!

So I'd recommend finding a directx hooking example online and getting that to work and tweaking it to your needs. Pick a few games you like which use the directx versions you want to support, as your testing environments.

You can find out what version of DX a particular DX application is using by enumerating DLLs & Symbols (under the View menu in the Memory Viewer)



If I remember correctly some applications might have multiple DX dlls loaded for whatever reason, and in that case you assume the highest one is the one being used. Your application will have to in some way detect the DX version automatically.

The common way / one of the main ways to do this is to create a DLL which does the hooking and inject that. If you can combine all three versions of hooks into a single DLL you could have 2 DLLs one for 32-bit and the other for 64-bit... Or maybe just make it 6 seperate dlls if that's easier, 3 for 32-bit, 3 for 64-bit...

Or follow CE's lead and forget all the DLLs lol and just directly inject your DX hook as assembler. That would be the cleanest way I think, if you can get your ASM code all well and good!

Then after all that, you can decide whether you want to support OpenGL as well, although not many games use it (it seems like anyway).

Good luck! You can pull it off, if you stay dedicated and work through any issues you come across until you get it right! Very Happy

_________________
Back to top
View user's profile Send private message
zm0d
Master Cheater
Reputation: 7

Joined: 06 Nov 2013
Posts: 423

PostPosted: Thu Feb 19, 2015 4:27 am    Post subject: Reply with quote

Larezh wrote:
to add an overlay on any direct X fullscreen game/application

SteveAndrew explained you the internal way. => Hooking the games drawing and put you own stuff there. If you are interested in overlays => a window that gets rendered above the game with some special properties so you can click through and see through, then you might take a look at C# and WPF. It's fairly easy to do, but the user has to play in windowed mode. The user might play with "fullscreen borderless windowed" so the game looks like fullscreen but your window is on top of the games window and you can do all your drawing there.... I used this technique for a few ESP wallhacks and it worked pretty good Smile There are a few tutorias in the WWW on how to do that. Smile
Back to top
View user's profile Send private message
Larezh
How do I cheat?
Reputation: 0

Joined: 18 Feb 2015
Posts: 3

PostPosted: Thu Feb 19, 2015 3:34 pm    Post subject: Reply with quote

Thanks for the responses.
I spent the whole night (until 6 AM) researching.

I'll try to first limit myself to DX 11 and then go on from there, I can see it's a LOT of work and almost any example I found was not working properly.

Sadly I can not rely on non fullscreen solutions, I have to target true fullscreen apps/games with vsync on.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

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

PostPosted: Thu Feb 19, 2015 6:55 pm    Post subject: Reply with quote

one tip: get an dx11 tutorial with source and experiment with it. e. g place a function call right before or after the present call and see if you can make your drawing happen there

then when it's time to do the hooking you'll know what the hook needs to do

_________________
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
Larezh
How do I cheat?
Reputation: 0

Joined: 18 Feb 2015
Posts: 3

PostPosted: Thu Feb 19, 2015 11:39 pm    Post subject: Reply with quote

Yea that was a good hint, I use the simple sprite demo from m$ that just draws a triangle.
However, every hook DLL code I found so far causes a crash (will have to dig into that)

Is there any well working source around that hooks DX11 ?

Right now I tried the "best" one I could find (wwwDOTunknowncheatsDOTme/forum/d3d-tutorials-and-source/88369-universal-d3d11-hookDOThtml)
(easy to compile just the beaengine include had to be commented)

Btw, the hook works when I launch the demo exe from my IDE in debugging mode.
It crashes when I have no debugger connected.

Update:
It now works (without modification on my end).
So fo rnow I am quite happy, first success Wink
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