Adding INSN hook checks for x86 (#833)

* adding INSN hook checking for x86

* tabs to spaces

* need to return bool not uc_err

* fixed conditional after switching to bool
This commit is contained in:
bulaza
2017-05-13 13:16:17 -04:00
committed by Nguyen Anh Quynh
parent 4b50ca5cec
commit 4b9efdc986
3 changed files with 25 additions and 1 deletions

View File

@@ -78,6 +78,9 @@ typedef bool (*uc_args_int_t)(int intno);
// some architecture redirect virtual memory to physical memory like Mips
typedef uint64_t (*uc_mem_redirect_t)(uint64_t address);
// validate if Unicorn supports hooking a given instruction
typedef bool(*uc_insn_hook_validate)(uint32_t insn_enum);
struct hook {
int type; // UC_HOOK_*
int insn; // instruction for HOOK_INSN
@@ -169,6 +172,8 @@ struct uc_struct {
// TODO: remove current_cpu, as it's a flag for something else ("cpu running"?)
CPUState *cpu, *current_cpu;
uc_insn_hook_validate insn_hook_validate;
MemoryRegion *system_memory; // qemu/exec.c
MemoryRegion io_mem_rom; // qemu/exec.c
MemoryRegion io_mem_notdirty; // qemu/exec.c