fix confusion betweet UC_MEM_xxx & UC_HOOK_MEM_xxx. fix issue #93
This commit is contained in:
@@ -183,7 +183,7 @@ WORD_TYPE helper_le_ld_name(CPUArchState *env, target_ulong addr, int mmu_idx,
|
||||
|
||||
// Unicorn: callback on memory read
|
||||
if (env->uc->hook_mem_read && READ_ACCESS_TYPE == MMU_DATA_LOAD) {
|
||||
struct hook_struct *trace = hook_find((uch)env->uc, UC_MEM_READ, addr);
|
||||
struct hook_struct *trace = hook_find((uch)env->uc, UC_HOOK_MEM_READ, addr);
|
||||
if (trace) {
|
||||
((uc_cb_hookmem_t)trace->callback)((uch)env->uc, UC_MEM_READ,
|
||||
(uint64_t)addr, (int)DATA_SIZE, (int64_t)0, trace->user_data);
|
||||
@@ -328,7 +328,7 @@ WORD_TYPE helper_be_ld_name(CPUArchState *env, target_ulong addr, int mmu_idx,
|
||||
|
||||
// Unicorn: callback on memory read
|
||||
if (env->uc->hook_mem_read && READ_ACCESS_TYPE == MMU_DATA_LOAD) {
|
||||
struct hook_struct *trace = hook_find((uch)env->uc, UC_MEM_READ, addr);
|
||||
struct hook_struct *trace = hook_find((uch)env->uc, UC_HOOK_MEM_READ, addr);
|
||||
if (trace) {
|
||||
((uc_cb_hookmem_t)trace->callback)((uch)env->uc, UC_MEM_READ,
|
||||
(uint64_t)addr, (int)DATA_SIZE, (int64_t)0, trace->user_data);
|
||||
@@ -511,7 +511,7 @@ void helper_le_st_name(CPUArchState *env, target_ulong addr, DATA_TYPE val,
|
||||
|
||||
// Unicorn: callback on memory write
|
||||
if (uc->hook_mem_write) {
|
||||
struct hook_struct *trace = hook_find((uch)uc, UC_MEM_WRITE, addr);
|
||||
struct hook_struct *trace = hook_find((uch)uc, UC_HOOK_MEM_WRITE, addr);
|
||||
if (trace) {
|
||||
((uc_cb_hookmem_t)trace->callback)((uch)uc, UC_MEM_WRITE,
|
||||
(uint64_t)addr, (int)DATA_SIZE, (int64_t)val, trace->user_data);
|
||||
@@ -649,7 +649,7 @@ void helper_be_st_name(CPUArchState *env, target_ulong addr, DATA_TYPE val,
|
||||
|
||||
// Unicorn: callback on memory write
|
||||
if (uc->hook_mem_write) {
|
||||
struct hook_struct *trace = hook_find((uch)uc, UC_MEM_WRITE, addr);
|
||||
struct hook_struct *trace = hook_find((uch)uc, UC_HOOK_MEM_WRITE, addr);
|
||||
if (trace) {
|
||||
((uc_cb_hookmem_t)trace->callback)((uch)uc, UC_MEM_WRITE,
|
||||
(uint64_t)addr, (int)DATA_SIZE, (int64_t)val, trace->user_data);
|
||||
|
||||
Reference in New Issue
Block a user