This repository hosts the code for extensions made to the UDK for Renegade X.
When compiled, this repository will produce a fake dinput8.dll
intended to live alongside UDK.exe
.
Installation simply involves copying our DLL into the game's binary directory. No extra steps need to be taken to load the extensions.
src/
dinput8.rs
- redirected dinput8 APIlib.rs
- initialization codeudk_log.rs
- UDK logging FFIudk_offsets.rs
- Constants describing important offsets in the UDK binaryudk_xaudio.rs
- UDK XAudio FFI and detoursxaudio27.rs
- XAudio2.7 -> 2.9 compatibility layer
When the system loads the UDK, it will load all DLL dependencies alongside the UDK before executing any game code.
When searching for dependencies, the first path the system will look is in the same directory as the executable binary.
In addition, every DLL binary can have an entry-point function (DllMain
) that the system's loader will invoke after loading it.
As such, we can create our own DLL and put it in place of one of the UDK's dependencies. The system will load and run our code while starting up the game, but before executing any game code.
So, we chose a random dependency that just happened to export only a single function (dinput8.dll
, which exposes DirectInputCreate8
) and replaced it with our own code.
And just like that, we get the opportunity to install hooks in the game, without the cost of designing our own loader.