mirror of
https://github.com/yuzu-emu/unicorn
synced 2024-11-24 19:28:11 +00:00
consistent style for docs of unicorn.h
This commit is contained in:
parent
978f671fa5
commit
f5fa84d985
1 changed files with 70 additions and 48 deletions
|
@ -60,8 +60,10 @@ typedef size_t uc_hook;
|
||||||
#define UC_API_MAJOR 0
|
#define UC_API_MAJOR 0
|
||||||
#define UC_API_MINOR 9
|
#define UC_API_MINOR 9
|
||||||
|
|
||||||
// Macro to create combined version which can be compared to
|
/*
|
||||||
// result of uc_version() API.
|
Macro to create combined version which can be compared to
|
||||||
|
result of uc_version() API.
|
||||||
|
*/
|
||||||
#define UC_MAKE_VERSION(major, minor) ((major << 8) + minor)
|
#define UC_MAKE_VERSION(major, minor) ((major << 8) + minor)
|
||||||
|
|
||||||
// Scales to calculate timeout on microsecond unit
|
// Scales to calculate timeout on microsecond unit
|
||||||
|
@ -129,27 +131,39 @@ typedef enum uc_err {
|
||||||
} uc_err;
|
} uc_err;
|
||||||
|
|
||||||
|
|
||||||
// Callback function for tracing code (UC_HOOK_CODE & UC_HOOK_BLOCK)
|
/*
|
||||||
// @address: address where the code is being executed
|
Callback function for tracing code (UC_HOOK_CODE & UC_HOOK_BLOCK)
|
||||||
// @size: size of machine instruction(s) being executed, or 0 when size is unknown
|
|
||||||
// @user_data: user data passed to tracing APIs.
|
@address: address where the code is being executed
|
||||||
|
@size: size of machine instruction(s) being executed, or 0 when size is unknown
|
||||||
|
@user_data: user data passed to tracing APIs.
|
||||||
|
*/
|
||||||
typedef void (*uc_cb_hookcode_t)(uc_engine *uc, uint64_t address, uint32_t size, void *user_data);
|
typedef void (*uc_cb_hookcode_t)(uc_engine *uc, uint64_t address, uint32_t size, void *user_data);
|
||||||
|
|
||||||
// Callback function for tracing interrupts (for uc_hook_intr())
|
/*
|
||||||
// @intno: interrupt number
|
Callback function for tracing interrupts (for uc_hook_intr())
|
||||||
// @user_data: user data passed to tracing APIs.
|
|
||||||
|
@intno: interrupt number
|
||||||
|
@user_data: user data passed to tracing APIs.
|
||||||
|
*/
|
||||||
typedef void (*uc_cb_hookintr_t)(uc_engine *uc, uint32_t intno, void *user_data);
|
typedef void (*uc_cb_hookintr_t)(uc_engine *uc, uint32_t intno, void *user_data);
|
||||||
|
|
||||||
// Callback function for tracing IN instruction of X86
|
/*
|
||||||
// @port: port number
|
Callback function for tracing IN instruction of X86
|
||||||
// @size: data size (1/2/4) to be read from this port
|
|
||||||
// @user_data: user data passed to tracing APIs.
|
@port: port number
|
||||||
|
@size: data size (1/2/4) to be read from this port
|
||||||
|
@user_data: user data passed to tracing APIs.
|
||||||
|
*/
|
||||||
typedef uint32_t (*uc_cb_insn_in_t)(uc_engine *uc, uint32_t port, int size, void *user_data);
|
typedef uint32_t (*uc_cb_insn_in_t)(uc_engine *uc, uint32_t port, int size, void *user_data);
|
||||||
|
|
||||||
// x86's handler for OUT
|
/*
|
||||||
// @port: port number
|
Callback function for OUT instruction of X86
|
||||||
// @size: data size (1/2/4) to be written to this port
|
|
||||||
// @value: data value to be written to this port
|
@port: port number
|
||||||
|
@size: data size (1/2/4) to be written to this port
|
||||||
|
@value: data value to be written to this port
|
||||||
|
*/
|
||||||
typedef void (*uc_cb_insn_out_t)(uc_engine *uc, uint32_t port, int size, uint32_t value, void *user_data);
|
typedef void (*uc_cb_insn_out_t)(uc_engine *uc, uint32_t port, int size, uint32_t value, void *user_data);
|
||||||
|
|
||||||
// All type of memory accesses for UC_HOOK_MEM_*
|
// All type of memory accesses for UC_HOOK_MEM_*
|
||||||
|
@ -195,27 +209,35 @@ typedef enum uc_hook_type {
|
||||||
// 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)
|
||||||
|
|
||||||
// Callback function for hooking memory (UC_MEM_READ, UC_MEM_WRITE & UC_MEM_FETCH)
|
/*
|
||||||
// @type: this memory is being READ, or WRITE
|
Callback function for hooking memory (UC_MEM_READ, UC_MEM_WRITE & UC_MEM_FETCH)
|
||||||
// @address: address where the code is being executed
|
|
||||||
// @size: size of data being read or written
|
@type: this memory is being READ, or WRITE
|
||||||
// @value: value of data being written to memory, or irrelevant if type = READ.
|
@address: address where the code is being executed
|
||||||
// @user_data: user data passed to tracing APIs
|
@size: size of data being read or written
|
||||||
|
@value: value of data being written to memory, or irrelevant if type = READ.
|
||||||
|
@user_data: user data passed to tracing APIs
|
||||||
|
*/
|
||||||
typedef void (*uc_cb_hookmem_t)(uc_engine *uc, uc_mem_type type,
|
typedef void (*uc_cb_hookmem_t)(uc_engine *uc, uc_mem_type type,
|
||||||
uint64_t address, int size, int64_t value, void *user_data);
|
uint64_t address, int size, int64_t value, void *user_data);
|
||||||
|
|
||||||
// Callback function for handling invalid memory access events (UC_MEM_*_UNMAPPED and
|
/*
|
||||||
// UC_MEM_*PROT events)
|
Callback function for handling invalid memory access events (UC_MEM_*_UNMAPPED and
|
||||||
// @type: this memory is being READ, or WRITE
|
UC_MEM_*PROT events)
|
||||||
// @address: address where the code is being executed
|
|
||||||
// @size: size of data being read or written
|
@type: this memory is being READ, or WRITE
|
||||||
// @value: value of data being written to memory, or irrelevant if type = READ.
|
@address: address where the code is being executed
|
||||||
// @user_data: user data passed to tracing APIs
|
@size: size of data being read or written
|
||||||
// @return: return true to continue, or false to stop program (due to invalid memory).
|
@value: value of data being written to memory, or irrelevant if type = READ.
|
||||||
|
@user_data: user data passed to tracing APIs
|
||||||
|
|
||||||
|
@return: return true to continue, or false to stop program (due to invalid memory).
|
||||||
|
*/
|
||||||
typedef bool (*uc_cb_eventmem_t)(uc_engine *uc, uc_mem_type type,
|
typedef bool (*uc_cb_eventmem_t)(uc_engine *uc, uc_mem_type type,
|
||||||
uint64_t address, int size, int64_t value, void *user_data);
|
uint64_t address, int size, int64_t value, void *user_data);
|
||||||
|
|
||||||
/* Memory region mapped by uc_mem_map() and uc_mem_map_ptr()
|
/*
|
||||||
|
Memory region mapped by uc_mem_map() and uc_mem_map_ptr()
|
||||||
Retrieve the list of memory regions with uc_mem_regions()
|
Retrieve the list of memory regions with uc_mem_regions()
|
||||||
*/
|
*/
|
||||||
typedef struct uc_mem_region {
|
typedef struct uc_mem_region {
|
||||||
|
|
Loading…
Reference in a new issue