This repository was archived by the owner on Apr 21, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpatch_libcef.ps1
More file actions
22 lines (21 loc) · 1.44 KB
/
Copy pathpatch_libcef.ps1
File metadata and controls
22 lines (21 loc) · 1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
## Make sure NVIDIA GeForce Experience overlay is disabled before running this script.
## PowerShell must be run as Administrator.
## This was tested against GeForce Experience:
## - 3.20.5.70
## - 3.20.5.83
$path = Split-Path ((Get-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\GeForceExperience\Shell\Open\Command).'(default)' -replace '"',"")
$file = [System.IO.File]::ReadAllBytes("$path\libcef.dll")
$offset = 0x61e0ae8
if($file[$offset] -eq 4 -and $file[$offset+2] -eq 5 -and $file[$offset+4] -eq 8) {
Stop-Process -Name "NVIDIA GeForce Experience" -ErrorAction SilentlyContinue
Stop-Process -Name "NVIDIA Share" -ErrorAction SilentlyContinue
[System.IO.File]::WriteAllBytes("$path\libcef.dll.bak", $file)
$file[$offset] = 6 # Replace usage 0x04 (Joystick) with keyboard
$file[$offset+2] = 6 # Replace usage 0x05 (Gamepad) with keyboard
$file[$offset+4] = 6 # Replace usage 0x08 (Multi-axis Controller) with keyboard
[System.IO.File]::WriteAllBytes("$path\libcef.dll", $file)
} else {
Write-Output "Your libcef.dll doesn't seem to match the version this file was tested against."
Write-Output "We have have two options: use heuristics to patch the libcef you've got: https://github.com/nuzayets/rawinput-debug/blob/master/universal_heuristic_patch_libcef.ps1"
Write-Output "Or download a version of a reasonable vintage and patch that: https://github.com/nuzayets/rawinput-debug/blob/master/universal_patch_libcef.ps1"
}