From: Jinoh Kang jinoh.kang.kr@gmail.com
--- dlls/ntdll/tests/exception.c | 51 ++++++++++++++++++------------------ 1 file changed, 25 insertions(+), 26 deletions(-)
diff --git a/dlls/ntdll/tests/exception.c b/dlls/ntdll/tests/exception.c index 0c69287c15b..ef9be039ae4 100644 --- a/dlls/ntdll/tests/exception.c +++ b/dlls/ntdll/tests/exception.c @@ -4424,26 +4424,26 @@ static void test_continue(void)
static const BYTE call_func[] = { - /* ret at 8*9(rsp) */ + /* ret at 8*13(rsp) */
/* need to preserve these */ - 0x53, /* push %rbx; 8*8(rsp) */ - 0x55, /* push %rbp; 8*7(rsp) */ - 0x56, /* push %rsi; 8*6(rsp) */ - 0x57, /* push %rdi; 8*5(rsp) */ - 0x41, 0x54, /* push %r12; 8*4(rsp) */ - 0x41, 0x55, /* push %r13; 8*3(rsp) */ - 0x41, 0x56, /* push %r14; 8*2(rsp) */ - 0x41, 0x57, /* push %r15; 8*1(rsp) */ - - 0x48, 0x83, 0xec, 0x08, /* sub $0x8, %rsp; reserve space for rsp */ - 0x48, 0x89, 0x24, 0x24, /* mov %rsp, (%rsp); for stack validation */ + 0x53, /* push %rbx; 8*12(rsp) */ + 0x55, /* push %rbp; 8*11(rsp) */ + 0x56, /* push %rsi; 8*10(rsp) */ + 0x57, /* push %rdi; 8*9(rsp) */ + 0x41, 0x54, /* push %r12; 8*8(rsp) */ + 0x41, 0x55, /* push %r13; 8*7(rsp) */ + 0x41, 0x56, /* push %r14; 8*6(rsp) */ + 0x41, 0x57, /* push %r15; 8*5(rsp) */ + + 0x48, 0x83, 0xec, 0x28, /* sub $0x28, %rsp; reserve space for rsp and outgoing reg params */ + 0x48, 0x89, 0x64, 0x24, 0x20, /* mov %rsp, 8*4(%rsp); for stack validation */
/* save args */ - 0x48, 0x89, 0x4c, 0x24, 0x50, /* mov %rcx, 8*10(%rsp) */ - 0x48, 0x89, 0x54, 0x24, 0x58, /* mov %rdx, 8*11(%rsp) */ - 0x4c, 0x89, 0x44, 0x24, 0x60, /* mov %r8, 8*12(%rsp) */ - 0x4c, 0x89, 0x4c, 0x24, 0x68, /* mov %r9, 8*13(%rsp) */ + 0x48, 0x89, 0x4c, 0x24, 0x70, /* mov %rcx, 8*14(%rsp) */ + 0x48, 0x89, 0x54, 0x24, 0x78, /* mov %rdx, 8*15(%rsp) */ + 0x4c, 0x89, 0x84, 0x24, 0x80, 0x00, 0x00, 0x00, /* mov %r8, 8*16(%rsp) */ + 0x4c, 0x89, 0x8c, 0x24, 0x88, 0x00, 0x00, 0x00, /* mov %r9, 8*17(%rsp) */
/* invoke capture context */ 0x41, 0xff, 0xd1, /* call *%r9 */ @@ -4487,8 +4487,8 @@ static void test_continue(void) /* FIXME: overwrite debug, x87 FPU and AVX registers to test those */
/* load args */ - 0x48, 0x8b, 0x4c, 0x24, 0x50, /* mov 8*10(%rsp), %rcx; context */ - 0x48, 0x8b, 0x54, 0x24, 0x58, /* mov 8*11(%rsp), %rdx; alertable */ + 0x48, 0x8b, 0x4c, 0x24, 0x70, /* mov 8*14(%rsp), %rcx; context */ + 0x48, 0x8b, 0x54, 0x24, 0x78, /* mov 8*15(%rsp), %rdx; alertable */ 0x48, 0x83, 0xec, 0x70, /* sub $0x70, %rsp; change stack */
/* setup context to return to label 1 */ @@ -4512,21 +4512,20 @@ static void test_continue(void) 0x9d, /* popf */
/* invoke NtContinue... */ - 0xff, 0x94, 0x24, 0xd0, 0x00, 0x00, 0x00, /* call *8*12+0x70(%rsp) */ + 0xff, 0x94, 0x24, 0xf0, 0x00, 0x00, 0x00, /* call *8*16+0x70(%rsp) */
/* validate stack pointer */ - 0x48, 0x8b, 0x0c, 0x24, /* 1: mov (%rsp), %rcx */ - 0x48, 0x39, 0xe1, /* cmp %rsp, %rcx */ - 0x74, 0x02, /* je 2f; jump over ud2 */ - 0x0f, 0x0b, /* ud2; stack pointer invalid, let's crash */ + 0x48, 0x3b, 0x64, 0x24, 0x20, /* 1: cmp 0x20(%rsp), %rsp */ + 0x74, 0x02, /* je 2f; jump over ud2 */ + 0x0f, 0x0b, /* ud2; stack pointer invalid, let's crash */
/* invoke capture context */ - 0x48, 0x8b, 0x4c, 0x24, 0x50, /* 2: mov 8*10(%rsp), %rcx; context */ + 0x48, 0x8b, 0x4c, 0x24, 0x70, /* 2: mov 8*14(%rsp), %rcx; context */ 0x48, 0x81, 0xc1, 0xd0, 0x04, 0x00, 0x00, /* add $0x4d0, %rcx; +sizeof(CONTEXT) to get context->after */ - 0xff, 0x54, 0x24, 0x68, /* call *8*13(%rsp) */ + 0xff, 0x94, 0x24, 0x88, 0x00, 0x00, 0x00, /* call *8*17(%rsp) */
/* free stack */ - 0x48, 0x83, 0xc4, 0x08, /* add $0x8, %rsp */ + 0x48, 0x83, 0xc4, 0x28, /* add $0x28, %rsp */
/* restore back */ 0x41, 0x5f, /* pop %r15 */