Upload files to "/"
This commit is contained in:
parent
8254b9444f
commit
8f7f60fa6c
35
elon_all.c
Normal file
35
elon_all.c
Normal file
@ -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 <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <dlfcn.h>
|
||||
#include <string.h>
|
||||
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);
|
||||
}
|
||||
BIN
elon_all.so
Normal file
BIN
elon_all.so
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user