mirror of
https://github.com/gtxaspec/wz_mini_hacks.git
synced 2024-12-26 22:03:35 +00:00
19 lines
460 B
C
19 lines
460 B
C
#include <stdio.h>
|
|
#include <dlfcn.h>
|
|
#include <string.h>
|
|
|
|
static FILE * (*original_freopen)(const char *pathname, const char *mode, FILE *stream);
|
|
|
|
static void __attribute ((constructor)) freopen_hook_init(void) {
|
|
|
|
original_freopen = dlsym(dlopen ("/lib/libc.so.0", RTLD_LAZY), "freopen");
|
|
}
|
|
|
|
FILE *freopen(const char *pathname, const char *mode, FILE *stream) {
|
|
|
|
if(stream == stdout) return stdout;
|
|
return original_freopen(pathname, mode, stream);
|
|
}
|
|
|
|
|