From 9014a8c7afe1dfe5f2dc64d3e25df6cd865b0dc7 Mon Sep 17 00:00:00 2001 From: Peter Repukat Date: Wed, 15 Feb 2017 21:43:14 +0100 Subject: [PATCH] SteamTarget: Add x86 opcodes for unpatching Valve's XInputGetState hook --- SteamTarget/VirtualControllerThread.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/SteamTarget/VirtualControllerThread.h b/SteamTarget/VirtualControllerThread.h index 40a6b78..6ad3755 100644 --- a/SteamTarget/VirtualControllerThread.h +++ b/SteamTarget/VirtualControllerThread.h @@ -49,7 +49,14 @@ private: static const uint8_t opPatchLenght = 5; uint8_t valveHookBytes[5]; + + // First 5 bytes are the same for XInput1_4.dll and XInput9_1_0.dll (on AMD64 at least, didn't check yet for x86, there is no ViGEm build for Win7 anway...) + // So no change has to be made for Win7 Targets +#ifdef _AMD64_ const uint8_t realBytes[5] = {0x48, 0x89, 0x5C, 0x24, 0x08}; +#else + const uint8_t realBytes[5] = { 0x8B, 0xFF, 0x55, 0x8B, 0xEC }; +#endif //uint8_t realBytes[5] = { 0xDE, 0xAD, 0xBE, 0xEF, 0x90 }; int controllerCount = 0;