Unpatch a lot of Valves hooks (in own memory...) to show HID Gaming devices...

main
Peter Repukat 3 years ago
parent 7ed33cc21b
commit b39c8f8956

@ -118,7 +118,7 @@ void HidHide::hideDevices(const std::filesystem::path& steam_path)
}
if (!dev.device_instance_path.empty()) {
blacklisted_devices_.push_back(dev.base_container_device_instance_path);
}
}
}
}
}
@ -152,6 +152,14 @@ void HidHide::UnPatchValveHooks()
else {
spdlog::error("failed to unpatch SetupDiEnumDeviceInfo");
}
addr = reinterpret_cast<BYTE*>(GetProcAddress(setupapidll, "SetupDiGetClassDevsW"));
if (addr) {
UnPatchHook(addr, SETUP_DI_GETCLASSDEVSW_ORIG_BYTES);
spdlog::trace("Unpatched SetupDiGetClassDevsW");
}
else {
spdlog::error("failed to unpatch SetupDiGetClassDevsW");
}
}
auto hiddll = GetModuleHandle(L"hid.dll");
if (hiddll) {

@ -71,6 +71,8 @@ class HidHide {
// Valve Hooks `SetupDiEnumDeviceInfo` and hides Gaming devices like this.
// To be able to query them, unpatch the hook with the original bytes...
static inline const std::string SETUP_DI_ENUM_DEV_INFO_ORIG_BYTES = "\x48\x89\x5C\x24\x08";
// Valve also Hooks `SetupDiGetClassDevsW` ..unhook that as well...
static inline const std::string SETUP_DI_GETCLASSDEVSW_ORIG_BYTES = "\x48\x89\x5C\x24\x08";
// Valve also Hooks `HidD_GetPreparsedData` ..unhook that as well...
static inline const std::string HID_GETPREPARSED_ORIG_BYTES = "\x48\x89\x5C\x24\x18";
// ..aand `HidP_GetCaps`

Loading…
Cancel
Save