#include "header.h"
#include "realfuncs.h"
+#include "syscalls.h"
char *bin_path;
char **g_argv;
long *stack_frame;
struct stat st;
char buf[64];
+ long lret;
if (argc < 2) {
fprintf(stderr, "usage: %s <program> [args]\n", argv[0]);
g_argv = argv;
+ lret = g_personality(-1);
+ if (g_syscall_error(lret) != -1) {
+ lret |= 0x0240000; // ADDR_COMPAT_LAYOUT | ADDR_NO_RANDOMIZE
+ g_personality(lret);
+ }
+
fi = fopen("/proc/self/maps", "r");
CHECK_NE(fi, NULL, "fopen maps");
raw_syscall_easy g_execve_raw, __NR_execve
raw_syscall_easy g_clock_gettime_raw, __NR_clock_gettime
raw_syscall_easy g_rt_sigprocmask_raw, __NR_rt_sigprocmask
+raw_syscall_easy g_personality, __NR_personality
raw_syscall_easy g_exit_group_raw, __NR_exit_group
long g_clock_gettime_raw(int clk_id, const struct timespec *tp);
long g_rt_sigprocmask_raw(int how, const void *set, void *oldset,
size_t sigsetsize);
+long g_personality(long persona);
long __attribute__((noreturn))
g_exit_group_raw(int status);