Skip to content
JB2WINPublic

About

This is a Tool that has several features for the Xbox One and Xbox One X Controller (and Unsupported for the Series X)

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

Xbox Controller Tool

A Windows tool for Xbox controllers: live inspection, a rumble blocker, a stick calibration wizard, and — optionally — a virtual-controller bridge that makes the calibration apply inside games. It also exposes several undocumented XInput exports that Microsoft never published.

Languages: English and German, chosen automatically from the system language and switchable under Settings. → Deutsche Fassung dieser Datei


⚠ Read this before using it

This software talks to hardware, calls undocumented operating-system functions, and can optionally load kernel drivers and hide devices from other programs. That is not risk-free.

It comes with no warranty

This program is distributed under the GNU General Public License v3 and, in the words of that licence, comes with ABSOLUTELY NO WARRANTY. See sections 15 and 16 of LICENSE for the binding text. Everything below is a plain-language summary of the practical risks, not a replacement for it.

You use this software at your own risk. The author is not liable for damage to hardware, software, user accounts or game access.

Anti-cheat: you can lose access to games

The In games page creates a virtual controller using the ViGEmBus driver, and hides your real controller from other programs using HidHide. From the outside, a virtual controller is indistinguishable from a real one — which is exactly why anti-cheat systems watch for it.

Situation Assessment
Kernel-level anti-cheat (Riot Vanguard — Valorant, League of Legends; FACEIT) Do not use. These block ViGEmBus at load time. At best the game refuses to start.
Competitive titles generally Not recommended. Tools built on the same foundation (e.g. reWASD) have led to bans in individual cases.
EAC / BattlEye, single-player games Usually unproblematic — Steam Input and DS4Windows use the same technique and are in use by millions. Still not a guarantee.

Hiding a device with HidHide can also draw attention on its own, independently of the virtual controller. The rules change with every game patch. Nobody, including this project, can promise you that a given game will tolerate this today or tomorrow.

The tool provides a kill switch that disables both drivers with one click, and a tray entry that stops the bridge without opening the window. Use them before starting a competitive game.

Kernel drivers

The bridge requires two third-party kernel drivers, both by Nefarius Software Solutions:

  • ViGEmBus — creates the virtual controller
  • HidHide — hides the real controller from other programs

This program never downloads or installs them. It only detects whether they are present and opens the official download page in your browser. Installing kernel drivers is a decision you make yourself, from a source you trust.

Changes this program can make to your system

Everything below happens only when you click the corresponding button, and every step that needs administrator rights shows the exact command beforehand and triggers a visible UAC prompt. Nothing is changed silently.

Action What it does Reversible
HidHide setup Hides your controller from all programs except this one; enables cloaking Yes, one click
Kill switch Disables the ViGEmBus and HidHide devices via pnputil Yes, one click
Autostart Adds a value under HKCU\Software\Microsoft\Windows\CurrentVersion\Run Yes, checkbox

Important trap: while HidHide cloaking is active and the bridge is not running, games see no controller at all. If input disappears, turn off the bridge page's HidHide setup or use the kill switch.

Undocumented API use

Several features call XInput exports that have no name, no documentation and no stability guarantee (see below). Microsoft may change or remove them in any Windows update. Every such call is individually guarded and reports "not available" instead of crashing — but a future Windows version may simply turn those features off.

One of them, XInputPowerOffController, switches your controller off. It is behind an explicit button; do not press it if you did not mean to.

Not affiliated

This is an independent hobby project. It is not affiliated with, endorsed by, or supported by Microsoft or Nefarius Software Solutions. Xbox is a trademark of Microsoft Corporation, used here only to describe compatibility.


Requirements

  • Windows 10 1903 or newer (x64)
  • .NET 10 Desktop Runtime
  • An Xbox controller (USB, Bluetooth or Xbox Wireless Adapter)
  • Optional, only for the bridge: ViGEmBus and HidHide

The core features — live view, rumble blocker, calibration, undocumented APIs — need no drivers and no administrator rights.

Build

dotnet publish XboxControllerTool -c Release -r win-x64 --self-contained false -p:PublishSingleFile=true -o out

Leaving out --self-contained false bundles the whole .NET runtime (~126 MB instead of ~25 MB).


Features

Live view

Sticks with dead-zone rings, triggers, every button, battery level, connection type. Includes a stick drift test that records the largest deflection at rest and compares it against the standard dead zone — enough to tell an actually drifting stick from a healthy one.

Rumble blocker (no drivers)

Windows has no "rumble off" switch. Whether the controller vibrates is decided by the game, which tells the driver directly. From outside, that can only be overwritten — so a dedicated thread continuously sends motor strength 0. A game's vibration is cut off again after one interval at most (8 ms by default); at most a very short tap remains.

All four motors. The Xbox One and Series controllers have four motors: two large ones in the grips and a small one each in LT and RT (the impulse triggers). XInput only knows the two large ones — the trigger motors do not appear anywhere in that API. The blocker can therefore additionally go through Windows.Gaming.Input, where every motor is addressable individually.

Calibration

A wizard measures, in this order:

  1. Centre — the resting position, averaged over 3 seconds.
  2. Range — 8 seconds circling the outer edge; each direction is then normalised with its own measured span.
  3. Centre again — see below.
  4. Dead zone — radial, with rescaling, so the value starts cleanly at 0 instead of jumping.

Why the centre is measured twice. On the test controller the resting position was perfectly constant across 643 samples — zero spread. Between measurements minutes apart it wandered by up to 2900 units. The stick does not return to the same spot; it depends on where it was last pushed (stiction). A single measurement cannot show that. So the centre is placed on the average of both, and the dead zone is sized to cover the wander — otherwise the wander comes through as phantom input.

The range step also diagnoses what is wrong. Two conditions look identical on screen — "it feels worse in one direction" — but have opposite consequences:

Finding Meaning Fixable?
Both sides reach full deflection healthy stick nothing to do
One side saturates, the other falls short shifted centre the short side fully; at the saturated end some stick travel stays without effect
Both sides fall short stick never reaches full scale fully

The maths is covered by tests: resting → exactly (0,0), full deflection → exactly ±1.000, no jump at the dead-zone edge, strictly monotonic throughout, magnitude on the diagonal never above 1.

On its own the calibration only affects this program. For it to reach games, use the bridge.

The bridge (in games)

real controller → read XInput → calibration → virtual Xbox 360 controller → game
                ←──── vibration: forward or discard ←────

Xbox 360 is used as the virtual device because that protocol is exactly what XInput speaks — axes, triggers and button bits map one to one, with no conversion.

The return channel is the second gain. Vibration commands land on the virtual pad, not on the real controller. Discarding them there switches vibration off for real — the command never reaches the motors. That is different from the blocker, which only drowns it out.

Latency: exactly one sampling period is added, plus the driver handover. At 1000 Hz that averages 0.5 ms, around 1 ms in total. A report is only sent when something actually changed, and the same high-resolution timer as the blocker is used — no busy waiting.

Hidden APIs

xinput1_4.dll exports several functions with no name — reachable only by ordinal, present in no header, used internally by Windows itself.

Getting at them is trickier than it looks: NativeLibrary.TryGetExport(h, "#103") does not work. .NET passes the string straight to GetProcAddress, and for that "#103" is simply a name that does not exist. Ordinals must be passed as a number inside the pointer (MAKEINTRESOURCE), so GetProcAddress has to be called with an IntPtr directly.

Ordinal Function Used
#100 XInputGetStateEx — like XInputGetState, but with the Xbox/Guide button yes
#101 XInputWaitForGuideButton detected only
#102 XInputCancelGuideButtonWait no
#103 XInputPowerOffController — switches off a wireless controller yes
#104 XInputGetBaseBusInformation yes
#108 XInputGetCapabilitiesEx — returns vendor and product ID yes

#101 is deliberately never called: it blocks the calling thread and its parameters are not reliably documented.

The layout of the #104 structure is documented nowhere. Comparing it against #108 shows the first six bytes are vendor ID, product ID and version as little-endian 16-bit values — the program interprets them accordingly and shows the raw bytes as well.

Also included is XInputGetKeystroke: documented, but practically unused. Instead of a state it hands out an event queue with down, up and an auto-repeat that XInput generates itself.


Two traps worth documenting

Both were found by measurement while building the bridge, and both would silently produce wrong behaviour rather than an error.

An all-zero report is not transmitted. A freshly plugged virtual pad already sits at zero internally. Submitting the same state changes nothing, so no packet goes out — XInput keeps showing the uninitialised state and the packet number stands still. This is guaranteed to happen here, because a calibrated stick at rest is exactly (0,0). Without a counter-measure the pad would never send a real report while the controller is not moved, and games would see garbage instead of centre. VirtualPad.Prime() therefore pushes one non-zero value after connecting, followed by the resting state.

IXbox360Controller.UserIndex is not the XInput slot. Measured: the pad sat in XInput slot 2 while UserIndex reported 0; in other runs the property throws right after connecting. Relying on it can, in the worst case, make the bridge read from its own virtual pad and write back into it. Only comparing the occupied slots before and after is reliable.

The bridge additionally sends a report every 250 ms even without a change. A stick at rest never produces one otherwise, so a once-wrong state would stay wrong forever.


What is not possible

  • Writing the calibration into the controller. Xbox controllers speak the proprietary GIP protocol; there is no public command to read or write the factory calibration, and over Bluetooth the vendor channel does not exist at all. Microsoft's own Xbox Accessories app only stores button remapping on a standard controller — on-board stick curves exist solely on the Elite Series 2. Guessing vendor commands and writing to firmware memory can brick the device permanently, so this project does not attempt it.
  • Remapping buttons. Technically possible through the virtual controller, but not built.

The lasting hardware fix for genuine drift is replacing the stick modules — Hall-effect replacements do not wear out.


Files and layout

XboxControllerTool/
  Localization.cs         two-language support
  XInput.cs               P/Invoke wrapper, loads xinput1_4 → 1_3 → 9_1_0 dynamically
  XInputSecrets.cs        the undocumented ordinal exports
  ImpulseTriggers.cs      Windows.Gaming.Input for the trigger motors
  PrecisionTimer.cs       high-resolution waitable timer
  Calibration.cs          stick calibration: maths and profile storage
  ControllerService.cs    poll thread + blocker thread
  BridgeService.cs        forwarding real → virtual, including the vibration return channel
  VirtualPad.cs           virtual Xbox 360 controller via ViGEmBus
  HidHideManager.cs       driving HidHide through its CLI
  DriverControl.cs        disabling and re-enabling drivers via pnputil
  MainForm*.cs            the user interface, one file per page
  Theme.cs / Widgets.cs   presentation

Settings live in %AppData%\XboxControllerTool\settings.json, calibration profiles in calibration.json next to it — one entry per device, keyed by VID/PID so a controller keeps its profile even when XInput gives it a different slot.


Licence

GNU General Public License v3.0 or later — see LICENSE.

Third-party components and their licences are listed in THIRD-PARTY-NOTICES.md.

About

This is a Tool that has several features for the Xbox One and Xbox One X Controller (and Unsupported for the Series X)

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors