move some operations after hook callback (#1243)

* fix finding python path which only has python3.

* move some operations after hook callback.
This commit is contained in:
Chen Huitao 2020-04-27 19:54:58 +08:00 committed by GitHub
parent cc5bfbc844
commit 8905ecd5e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -122,6 +122,15 @@ int cpu_exec(struct uc_struct *uc, CPUArchState *env) // qq
ret = cpu->exception_index;
break;
#else
#if defined(TARGET_X86_64)
if (env->exception_is_int) {
// point EIP to the next instruction after INT
env->eip = env->exception_next_eip;
}
#endif
#if defined(TARGET_MIPS) || defined(TARGET_MIPS64)
env->active_tc.PC = uc->next_pc;
#endif
if (uc->stop_interrupt && uc->stop_interrupt(cpu->exception_index)) {
// Unicorn: call registered invalid instruction callbacks
HOOK_FOREACH_VAR_DECLARE;
@ -151,15 +160,6 @@ int cpu_exec(struct uc_struct *uc, CPUArchState *env) // qq
}
cpu->exception_index = -1;
#if defined(TARGET_X86_64)
if (env->exception_is_int) {
// point EIP to the next instruction after INT
env->eip = env->exception_next_eip;
}
#endif
#if defined(TARGET_MIPS) || defined(TARGET_MIPS64)
env->active_tc.PC = uc->next_pc;
#endif
#endif
}
}