INTRODUCTION
There's this old fullscreen 800x600 or windowed mode online game binary I would like to make a new GUI for, using C++. I haven't got its source code. Same interface yet scaled to occupy most of the screen as fullscreen while avoiding the game being distorted by stretching into a monitor with a different resolution, besides allowing app switching while keeping native resolution. So far I've successfully made a window paint itself with the windowed game window content scaled, and redirected both it's keyboard input and all the window activation messages into the windowed game window in the background. I'm currently struggling to send the remapped cursor position and clicks.
MY ATTEMPTS
I first tried sending WM_MOUSEMOVE
messages but found out the game uses Direct Input. Suspending or killing the dinput8.dll!GetdfDIJoystick+0x61c8 game thread with Process Explorer stops the game from reacting to mouse input.
This StackOverflow answer states:
...it's worth noting that in recent versions of Windows, DirectInput for mouse & keyboard input is just a wrapper around the Win32 windows messages...
... so I also tried intercepting that thread messages. I inspected a window called DIEmWin using Spy++, which seems to be spawned by Direct Input and belonging to the game process, and saw it was receiving WM_INPUT
messages. I installed a WH_GETMESSAGE
hook into its thread and stopped these messages avoiding their CallNextHookEx()
call. Rehooking the same window with Spy++ showed no more WM_INPUT
messages being received, yet the game was still reacting to mouse input. I then tried adding a WH_MOUSE_LL
hook on top of that, despite Spy++ showing no related messages to that thread, just in case. Game still reacting to mouse input.
MY QUESTION
How can I go about remapping the cursor position without using detours? I was hoping to achieve my objective by hooking this theoretical Direct Input wrapper, and thus avoiding the need to inject assembly code into the game Direct X 8 calls. I believe I've successfully intercepted all this wrapper messages and yet game reacts to input anyways.
Some notes:
The redirected keyboard input is probably non existing and happening because of the game window receiving an activation message while on the background and Direct Input getting keyboard input as is.
I haven't got access to a way of signing drivers without cost.