Skip to content

An internal hack that detours the XInputGetState function from xinput.dll

Notifications You must be signed in to change notification settings

DavidAngell/rusty-xinput-detour

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rusty XInput Detour

A program to detour the XInput dll injected into a game. Specifically, this repo uses Rocket League as the example game. It also provides a function scheduler which allows the user to pass delays for when an input should be run on the controller. Chaining such delays allows for the simple creation of macro buttons on a controller.

Running Example

Prerequisites

You will need Rust and Rocket League to view the example. Rocket League is free on Epic Games (not sponsored).

  • Rust
    curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

Installation

  1. Clone the repo
    git clone https://github.com/DavidAngell/rusty-xinput-detour
    cd rusty-xinput-detour/
  2. Build the DLL
    cd xinput_detour_dll/
    cargo build
  3. Run the injector script (must be in the root directory)
    cd ..
    cargo run

Usage

Editing main.rs

  • Change the value of EXE_NAME to match the name of the exe you want to detour
  • IMPORTANT: if you change the lib name in Cargo.toml it will change the name of the genrated dll. You will need to change DLL_NAME at the top of main.rs to match whatever lib name you choose

Handling Controller Actions

See examples in handle_controller_state.rs to get an understanding of how function scheduler works.

(back to top)

Contributing

If you have a suggestion that would make this program better, please fork the repo and create a pull request. Thank You.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

License

Distributed under the MIT License. See LICENSE for more information.

(back to top)

Contact

David Angell - @DavidJAngell42 - davidjangell42@gmail.com

(back to top)

Acknowledgments

About

An internal hack that detours the XInputGetState function from xinput.dll

Topics

Resources

Stars

Watchers

Forks

Languages