Created
April 28, 2016 05:16
-
-
Save PinkPandaKatie/68d48fc4f2cd9fa5265eca94d06f9d09 to your computer and use it in GitHub Desktop.
This file contains 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
/* | |
* Simple LD_PRELOAD library to dummy out getifaddrs() and return 0 results when it is called | |
* | |
* Compiling: | |
* gcc -m32 -fPIC -shared dummy_getifaddrs.c -o dummy_getifaddrs.so -Wall | |
* | |
* Copy dummy_getifaddrs.so to Tomb Raider dir (.../SteamApps/common/Tomb Raider/bin) then | |
* change steam launch options for Tomb Raider to: | |
* | |
* env LD_PRELOAD=./dummy_getifaddrs.so %command% | |
* | |
*/ | |
#include <stdio.h> | |
#define __USE_GNU | |
#include <errno.h> | |
#include <dlfcn.h> | |
#include <sys/types.h> | |
#include <ifaddrs.h> | |
int getifaddrs(struct ifaddrs **ifap) { | |
fprintf(stderr, "\n\n\n---------------- dummied out getifaddrs()!\n\n\n"); | |
*ifap = NULL; | |
return 0; | |
} | |
void freeifaddrs(struct ifaddrs *ifap) { | |
/* do nothing */ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment