From 0ac3cf99d488a0df3fb019edb2e00bcc10b808b6 Mon Sep 17 00:00:00 2001 From: Ryan Hileman Date: Fri, 21 Aug 2015 16:24:21 -0700 Subject: [PATCH] call int80 callback from x86_64 syscall helper --- qemu/target-i386/seg_helper.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/qemu/target-i386/seg_helper.c b/qemu/target-i386/seg_helper.c index 7245fa81..93d58566 100644 --- a/qemu/target-i386/seg_helper.c +++ b/qemu/target-i386/seg_helper.c @@ -22,6 +22,7 @@ #include "qemu/log.h" #include "exec/helper-proto.h" #include "exec/cpu_ldst.h" +#include "uc_priv.h" //#define DEBUG_PCALL @@ -944,6 +945,16 @@ void helper_syscall(CPUX86State *env, int next_eip_addend) #else void helper_syscall(CPUX86State *env, int next_eip_addend) { + // Unicorn: call interrupt callback if registered + struct uc_struct *uc = env->uc; + if (uc->hook_intr_idx) { + ((uc_cb_hookintr_t)uc->hook_callbacks[uc->hook_intr_idx].callback)( + (uch)uc, 80, + uc->hook_callbacks[uc->hook_intr_idx].user_data); + env->eip += next_eip_addend; + return; + } + int selector; if (!(env->efer & MSR_EFER_SCE)) {