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:
@ -122,6 +122,15 @@ int cpu_exec(struct uc_struct *uc, CPUArchState *env) // qq
|
|||||||
ret = cpu->exception_index;
|
ret = cpu->exception_index;
|
||||||
break;
|
break;
|
||||||
#else
|
#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)) {
|
if (uc->stop_interrupt && uc->stop_interrupt(cpu->exception_index)) {
|
||||||
// Unicorn: call registered invalid instruction callbacks
|
// Unicorn: call registered invalid instruction callbacks
|
||||||
HOOK_FOREACH_VAR_DECLARE;
|
HOOK_FOREACH_VAR_DECLARE;
|
||||||
@ -151,15 +160,6 @@ int cpu_exec(struct uc_struct *uc, CPUArchState *env) // qq
|
|||||||
}
|
}
|
||||||
|
|
||||||
cpu->exception_index = -1;
|
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
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user