Skip to content

Instantly share code, notes, and snippets.

@affix
Last active October 10, 2022 08:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save affix/df7d80c28730cabe6c4640a677d4c119 to your computer and use it in GitHub Desktop.
Save affix/df7d80c28730cabe6c4640a677d4c119 to your computer and use it in GitHub Desktop.
#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