From dd8dfb7f53840f727e2d0dbf1a06c69d13e877bb Mon Sep 17 00:00:00 2001 From: Curtis McEnroe Date: Fri, 7 Oct 2016 20:57:10 -0400 Subject: Swap stacks in OP_CALL and wasteful OP_RELO in jrp NEED MORE BYTES. --- .bin/jrp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.bin/jrp.c b/.bin/jrp.c index b98f750d..20019245 100755 --- a/.bin/jrp.c +++ b/.bin/jrp.c @@ -16,7 +16,8 @@ typedef value *(*fptr)(value *); enum { OP_PROL = 0x90fc8948e5894855, // push ebp; mov rbp, rsp; mov rsp, rdi OP_EPIL = 0xc35dec8948e08948, // mov rax, rsp; mov rsp, rbp; pop rbp; ret - OP_CALL = 0x90666666d0ff5f58, // pop rax; pop rdi; call rax + OP_CALL = 0x90d0ffe587485f58, // pop rax; pop rdi; xchg rsp, rbp; call rax + OP_RELO = 0x9090666666e58748, // xchg rsp, rbp OP_PUSH = 0x0000000068906666, // push strict dword 0 OP_HIGH = 0x00000000042444c7, // mov [rsp + 4], strict dword 0 OP_DROP = 0x9066666608c48348, // add rsp, 8 @@ -75,6 +76,7 @@ static void rt_print_hex(value val) { #define JIT_CALL(p, fn) { \ JIT_PUSH(p, fn); \ *p++ = OP_CALL; \ + *p++ = OP_RELO; \ } int main() { -- cgit 1.4.1