How does your DirectX "Hack" work?

Mumble about Mumble

How does your DirectX "Hack" work?

Postby GT-Anakin » Fri Mar 03, 2017 8:15 am

Hello,

I'm working on an overlay tool and i'm using Qt. Can you explain me, how you did the DirectX "Hack" to show the qt widgets on top of an DirectX application in Fullscreen mod??
GT-Anakin
 
Posts: 2
Joined: Thu Mar 02, 2017 10:14 am

Re: How does your DirectX "Hack" work?

Postby kissaki » Tue Mar 07, 2017 11:02 pm

It doesn't really have anything to do with Qt, and we don't really show Qt widgets per se.

We inject into the systems DLL loading and on loading DLLs check whether they are 3D accelerated applications (using DirectX, OpenGL...), and whether we want to show an overlay. If so, we inject our own functions into the original DirectX functions, replacing the original code with a jump to our own code, preserving what we replaced.

Then we use a Pipe for communication between the Mumble client and the overlay that was injected into other applications.

Refer to the overlay folder for the overlay specific code and src/mumble/overlay.h for the client specific stuff.

* Preparation
* Checking whether to inject
* injecting

You may want to check out the "minhook" library for code injection.

If you were talking about the interactive mode where we actually draw the Mumble client itself in the overlay, I'm not too sure about that, and I think we removed it in the current codebase because it apparently had some open issues and no maintainer. You'd have to check for the "interactive mode" flag and code paths.
MumPI: Your Mumble Web Interface in PHP
User avatar
kissaki
Team member
Team member
 
Posts: 1234
Joined: Sat Jan 09, 2010 12:15 pm

Re: How does your DirectX "Hack" work?

Postby mkrautz » Fri Mar 24, 2017 10:48 pm

Actually, in Mumble 1.2.x there is a full-screen overlay that does embed the full Mumble client in the overlay.
We do it using various hacks in both Qt and Mumble, and it's not pretty. It's not going to function in Qt 5/Mumble 1.3.0.

Some quick pointers for some of the hacks:
https://github.com/mumble-voip/mumble/s ... =%E2%9C%93
and our patched Qt 4 is at:
https://github.com/mumble-voip/mumble-developers-qt
mkrautz
Team member
Team member
 
Posts: 186
Joined: Wed Sep 23, 2009 4:57 pm

Re: How does your DirectX "Hack" work?

Postby GT-Anakin » Sat Mar 25, 2017 12:12 pm

i'm tied to Qt 5. So that would work for me, correct??

There are so many overlays (steam, origin, Nvidia,...) i wonder there is no kind of api that allows you to add some overlay items to the screen (labels, image) and to interact with them (get mouse position, get mouse klick event)

There is really not much needed. Just image/label print + option to grap the mouse with press/position.

Then you can write your own program to show the content permanent, to hide them, to interact with mouse...
GT-Anakin
 
Posts: 2
Joined: Thu Mar 02, 2017 10:14 am

Re: How does your DirectX "Hack" work?

Postby mkrautz » Tue Mar 28, 2017 11:07 pm

GT-Anakin wrote:i'm tied to Qt 5. So that would work for me, correct??

There are so many overlays (steam, origin, Nvidia,...) i wonder there is no kind of api that allows you to add some overlay items to the screen (labels, image) and to interact with them (get mouse position, get mouse klick event)

There is really not much needed. Just image/label print + option to grap the mouse with press/position.

Then you can write your own program to show the content permanent, to hide them, to interact with mouse...


Our implementation only worked on Qt 4.

What we did was, we made use of our existing overlay.

Then we leveraged our GlobalShortcut implementation (including the ability to suppress events).
This allowed us to grab mouse coordinates, clicks, etc. -- and ensure they weren't delivered to any other app on the system.

Our code is old and unmaintained, and I doubt it works well anymore. However, our implementation mirrored the "Windows platform" windows from Mumble into overlay. That was the most hacky part of it.

If you instead use a custom platform plugin in Qt, or you simply draw your widgets yourself, it should be much more doable.

Unfortunately, our overlay code isn't really its own project, so it's not easy to integrate into something else.
mkrautz
Team member
Team member
 
Posts: 186
Joined: Wed Sep 23, 2009 4:57 pm


Return to General

Who is online

Users browsing this forum: Google [Bot] and 2 guests

cron