add combination hook type UC_HOOK_MEM_VALID to intercept all valid memory access

This commit is contained in:
Nguyen Anh Quynh 2016-01-31 13:12:34 +08:00
parent 1fb5416f4a
commit a2ef52172c
5 changed files with 6 additions and 0 deletions

View file

@ -91,6 +91,7 @@ module Common =
let UC_HOOK_MEM_WRITE_INVALID = 288 let UC_HOOK_MEM_WRITE_INVALID = 288
let UC_HOOK_MEM_FETCH_INVALID = 576 let UC_HOOK_MEM_FETCH_INVALID = 576
let UC_HOOK_MEM_INVALID = 1008 let UC_HOOK_MEM_INVALID = 1008
let UC_HOOK_MEM_VALID = 7168
let UC_QUERY_MODE = 1 let UC_QUERY_MODE = 1
let UC_PROT_NONE = 0 let UC_PROT_NONE = 0

View file

@ -86,6 +86,7 @@ const (
HOOK_MEM_WRITE_INVALID = 288 HOOK_MEM_WRITE_INVALID = 288
HOOK_MEM_FETCH_INVALID = 576 HOOK_MEM_FETCH_INVALID = 576
HOOK_MEM_INVALID = 1008 HOOK_MEM_INVALID = 1008
HOOK_MEM_VALID = 7168
QUERY_MODE = 1 QUERY_MODE = 1
PROT_NONE = 0 PROT_NONE = 0

View file

@ -88,6 +88,7 @@ public interface UnicornConst {
public static final int UC_HOOK_MEM_WRITE_INVALID = 288; public static final int UC_HOOK_MEM_WRITE_INVALID = 288;
public static final int UC_HOOK_MEM_FETCH_INVALID = 576; public static final int UC_HOOK_MEM_FETCH_INVALID = 576;
public static final int UC_HOOK_MEM_INVALID = 1008; public static final int UC_HOOK_MEM_INVALID = 1008;
public static final int UC_HOOK_MEM_VALID = 7168;
public static final int UC_QUERY_MODE = 1; public static final int UC_QUERY_MODE = 1;
public static final int UC_PROT_NONE = 0; public static final int UC_PROT_NONE = 0;

View file

@ -84,6 +84,7 @@ UC_HOOK_MEM_READ_INVALID = 144
UC_HOOK_MEM_WRITE_INVALID = 288 UC_HOOK_MEM_WRITE_INVALID = 288
UC_HOOK_MEM_FETCH_INVALID = 576 UC_HOOK_MEM_FETCH_INVALID = 576
UC_HOOK_MEM_INVALID = 1008 UC_HOOK_MEM_INVALID = 1008
UC_HOOK_MEM_VALID = 7168
UC_QUERY_MODE = 1 UC_QUERY_MODE = 1
UC_PROT_NONE = 0 UC_PROT_NONE = 0

View file

@ -218,6 +218,8 @@ typedef enum uc_hook_type {
#define UC_HOOK_MEM_FETCH_INVALID (UC_HOOK_MEM_FETCH_PROT + UC_HOOK_MEM_FETCH_UNMAPPED) #define UC_HOOK_MEM_FETCH_INVALID (UC_HOOK_MEM_FETCH_PROT + UC_HOOK_MEM_FETCH_UNMAPPED)
// hook type for all events of illegal memory access // hook type for all events of illegal memory access
#define UC_HOOK_MEM_INVALID (UC_HOOK_MEM_UNMAPPED + UC_HOOK_MEM_PROT) #define UC_HOOK_MEM_INVALID (UC_HOOK_MEM_UNMAPPED + UC_HOOK_MEM_PROT)
// hook type for all events of valid memory access
#define UC_HOOK_MEM_VALID (UC_HOOK_MEM_READ + UC_HOOK_MEM_WRITE + UC_HOOK_MEM_FETCH)
/* /*
Callback function for hooking memory (UC_MEM_READ, UC_MEM_WRITE & UC_MEM_FETCH) Callback function for hooking memory (UC_MEM_READ, UC_MEM_WRITE & UC_MEM_FETCH)