unicorn/include/hook.h

21 lines
637 B
C
Raw Normal View History

2015-08-21 07:04:50 +00:00
/* Unicorn Emulator Engine */
/* By Nguyen Anh Quynh <aquynh@gmail.com>, 2015 */
#ifndef UC_HOOK_H
#define UC_HOOK_H
// return -1 on failure, index to traces[] on success.
2015-08-26 10:11:39 +00:00
size_t hook_add(struct uc_struct *uc, int type, uint64_t begin, uint64_t end, void *callback, void *user_data);
2015-08-21 07:04:50 +00:00
// return 0 on success, -1 on failure
2015-08-26 10:11:39 +00:00
uc_err hook_del(struct uc_struct *uc, uch *traceh);
2015-08-21 07:04:50 +00:00
// return NULL on failure
2015-08-26 10:11:39 +00:00
struct hook_struct *hook_find(struct uc_struct *uc, int type, uint64_t address);
2015-08-21 07:04:50 +00:00
// return index of an free hook entry in hook_callbacks[] array.
// this realloc memory if needed.
size_t hook_find_new(struct uc_struct *uc);
#endif