diff options
Diffstat (limited to 'executor/x86_64/asm.c')
-rw-r--r-- | executor/x86_64/asm.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/executor/x86_64/asm.c b/executor/x86_64/asm.c index c741f15..f2bb801 100644 --- a/executor/x86_64/asm.c +++ b/executor/x86_64/asm.c @@ -210,7 +210,7 @@ static void asm_print_code_hex(Asm *self) { } #endif -int asm_execute(Asm *self) { +int asm_execute(Asm *self, u32 offset) { void (*func)(); if(mprotect(self->code, self->allocated_size, PROT_READ | PROT_EXEC) != 0) return -errno; @@ -218,7 +218,7 @@ int asm_execute(Asm *self) { /*asm_print_code_hex(self);*/ /* TODO: Verify if this is valid on all platforms. According to ISO C standard it isn't? */ - *(void**)(&func) = self->code; + *(void**)(&func) = self->code + offset; func(); return 0; } |