From 4e9005be1489133ff25f75b74dccbb2d316ea673 Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Thu, 20 Apr 2023 11:57:18 +0000 Subject: [DYNAREC] Try to test last opcode at end of block for unimplemented opcode --- src/dynarec/dynarec.c | 10 ++++++++-- src/include/dynarec.h | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/dynarec/dynarec.c b/src/dynarec/dynarec.c index be7c6a31..f0b0eeb5 100755 --- a/src/dynarec/dynarec.c +++ b/src/dynarec/dynarec.c @@ -95,8 +95,11 @@ void DynaCall(x64emu_t* emu, uintptr_t addr) printf_log(LOG_DEBUG, "Setjmp DynaCall, fs=0x%x\n", ejb->emu->segs[_FS]); addr = R_RIP; // not sure if it should still be inside DynaCall! #ifdef DYNAREC - if(box64_dynarec_test) + if(box64_dynarec_test) { + if(emu->test.clean) + x64test_check(emu, R_RIP); emu->test.clean = 0; + } #endif } } @@ -186,8 +189,11 @@ int DynaRun(x64emu_t* emu) if(sigsetjmp((struct __jmp_buf_tag*)ejb->jmpbuf, 1)) printf_log(LOG_DEBUG, "Setjmp DynaRun, fs=0x%x\n", ejb->emu->segs[_FS]); #ifdef DYNAREC - if(box64_dynarec_test) + if(box64_dynarec_test) { + if(emu->test.clean) + x64test_check(emu, R_RIP); emu->test.clean = 0; + } #endif } } diff --git a/src/include/dynarec.h b/src/include/dynarec.h index 677427bc..64da6041 100755 --- a/src/include/dynarec.h +++ b/src/include/dynarec.h @@ -6,6 +6,6 @@ typedef struct x64emu_s x64emu_t; void DynaCall(x64emu_t* emu, uintptr_t addr); // try to use DynaRec... Fallback to EmuCall if no dynarec available void x64test_init(x64emu_t* ref, uintptr_t ip); -void x64test_check(x64emu_t* ref); +void x64test_check(x64emu_t* ref, uintptr_t ip); #endif // __DYNAREC_H_ \ No newline at end of file -- cgit 1.4.1