diff --git a/elon_all.c b/elon_all.c new file mode 100644 index 0000000..9889978 --- /dev/null +++ b/elon_all.c @@ -0,0 +1,35 @@ +// 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); +} diff --git a/elon_all.so b/elon_all.so new file mode 100644 index 0000000..8a3f1dc Binary files /dev/null and b/elon_all.so differ