The engine dlls in early CS 1.6 builds lack relocation information, and on modern Windows versions the engine's preferred load address is often already occupied by system internals by the time the launcher attempts to load the dll.
This project resolves the conflict by reserving the engine's required address range within the main executable (hl.exe or hlds.exe) and manually mapping the engine dll into that space (This is actually the same technique Valve used for their engine/client dll encryption and manual mapping system).
This repository provides a patcher that adds a reservation section to the executable and makes it load ldrpatch.dll. The dll then hooks the necessary functions to manually map the engine image.
Warning: The patcher does not check for existing patches. Running it on an already patched executable will break the file.
- Build the project or download the binaries from Releases
- Run
patcher.exe path\to\hl.exeorpatcher.exe path\to\hlds.exeto patch the executable - Move
ldrpatch.dllinto the same folder as the patched executable - Launch the game as normal