Created
January 12, 2023 03:21
-
-
Save Calinou/8990fd37c3c8dd7c3dfa7503ba10922f to your computer and use it in GitHub Desktop.
Dirt Rally Linux fix (source: https://news.ycombinator.com/item?id=25818126)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Source: <https://news.ycombinator.com/item?id=25818126> | |
// | |
// Instructions: | |
// 1. Paste contents of this file to a new file called "game.c" within your home folder. | |
// 2. Open a terminal, install GCC from distribution repositories and compile this source file: gcc game.c -shared -o game.so | |
// 3. Move game.so to the same folder as the DirtRally binary (within the bin/ folder, not DirtRally.sh). | |
// Use Manage > Browse Local Files on Dirt Rally to reach this folder, then enter the bin/ folder. | |
// 4. Modify Steam launch options: LD_PRELOAD=./game.so %command% | |
// 5. Run the game on Steam. | |
#include <sys/mman.h> | |
#include <unistd.h> | |
#include <sys/syscall.h> | |
int mprotect(void *addr, size_t len, int prot) { | |
if (prot == PROT_EXEC) { | |
prot |= PROT_READ; | |
} | |
return syscall(__NR_mprotect, addr, len, prot); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment