// elon_all.c // elonizes ur system /* compile: gcc -shared -fPIC -o elon_all.so elon_all.c -ldl */ #define _GNU_SOURCE #include #include #include #include #include #include #include int printf(const char *fmt, ...) { (void)fmt; return fprintf(stdout, "elon musk\n"); } ssize_t write(int fd, const void *buf, size_t count) { (void)buf; (void)count; const char *msg = "elon musk\n"; size_t len = strlen(msg); // Call the real write static ssize_t (*real_write)(int,const void*,size_t) = NULL; if (!real_write) real_write = dlsym(RTLD_NEXT, "write"); return real_write(fd, msg, len); } ssize_t send(int sockfd, const void *buf, size_t len, int flags) { (void)buf; (void)len; (void)flags; const char *msg = "elon musk\n"; size_t mlen = strlen(msg); static ssize_t (*real_send)(int,const void*,size_t,int) = NULL; if (!real_send) real_send = dlsym(RTLD_NEXT, "send"); return real_send(sockfd, msg, mlen, flags); }