-
-
Save ZeDoCaixao/216835f8382c3b974f892121d9c21df8 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
#define _GNU_SOURCE | |
#include <dlfcn.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <time.h> | |
typedef int (*orig_open_f_type)(const char *pathname, int flags); | |
typedef int (*orig_open64_f_type)(const char *pathname, int flags); | |
int open(const char *pathname, int flags){ | |
orig_open_f_type orig_open; | |
orig_open = (orig_open_f_type)dlsym(RTLD_NEXT, "open"); | |
printf(">>> open(): '%s'!!!\n", pathname); | |
return orig_open(pathname, flags); | |
} | |
int open64(const char *pathname, int flags){ | |
orig_open64_f_type orig_open64; | |
orig_open64 = (orig_open64_f_type)dlsym(RTLD_NEXT, "open64"); | |
printf(">>> open64(): '%s'!!!\n", pathname); | |
return orig_open64(pathname, flags); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment