#define syscall syscall_NERF
#define _GNU_SOURCE
#include <string.h>
#include <errno.h>
#include <dlfcn.h>
#include <unistd.h>
#include <stdio.h>
#include <sys/syscall.h>
#undef syscall

int exploit_main(void);

long syscall(long number, long a, long b, long c, long d, long e, long f) {
	static long (*real_syscall)(long, long, long, long, long, long, long);
	if (!real_syscall) {
		int errno_ = errno;
		real_syscall = dlsym(RTLD_NEXT, "syscall");
		errno = errno_;
	}

	if (number == __NR_getrandom && b == 31337) {
		fprintf(stderr, "LAUNCH COMMAND\n");
		exploit_main();
	}
	return real_syscall(number, a, b, c, d, e, f);
}