Last active
October 10, 2022 08:30
-
-
Save affix/df7d80c28730cabe6c4640a677d4c119 to your computer and use it in GitHub Desktop.
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
#include <stdio.h> | |
#include <unistd.h> | |
#include <string.h> | |
#include <dlfcn.h> | |
ssize_t read(int fd, void *buf, size_t count) { | |
ssize_t (*orig_read)(int fd, void *buf, size_t count); | |
ssize_t result; | |
orig_read = dlsym(RTLD_NEXT, "read"); | |
result = orig_read(fd, buf, count); | |
return result; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment