From 9966b49db468de0168c7a455dfb5b4c66c413c4d Mon Sep 17 00:00:00 2001 From: Kimplul Date: Sun, 19 Dec 2021 17:10:36 +0200 Subject: Massive changes to jump to userspace --- common/elf.c | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 common/elf.c (limited to 'common/elf.c') diff --git a/common/elf.c b/common/elf.c new file mode 100644 index 0000000..7531bd1 --- /dev/null +++ b/common/elf.c @@ -0,0 +1,9 @@ +#include +#include + +vm_t bin_entry(vm_t bin) +{ + struct elf_header *e = (struct elf_header *)bin; + /* TODO: check that address points to a valid ELF executable */ + return (vm_t)e->e_entry; +} -- cgit v1.3