drmgr.h File Reference

Header for DynamoRIO Multi-Instrumentation Manager Extension. More...

Data Structures

struct  _drmgr_priority_t
 
struct  _drmgr_instru_events_t
 
struct  _emulated_instr_t
 

Typedefs

typedef dr_emit_flags_t(* drmgr_xform_cb_t) (void *drcontext, void *tag, instrlist_t *bb, bool for_trace, bool translating)
 
typedef dr_emit_flags_t(* drmgr_analysis_cb_t) (void *drcontext, void *tag, instrlist_t *bb, bool for_trace, bool translating, DR_PARAM_OUT void **user_data)
 
typedef drmgr_analysis_cb_t drmgr_app2app_ex_cb_t
 
typedef dr_emit_flags_t(* drmgr_ilist_ex_cb_t) (void *drcontext, void *tag, instrlist_t *bb, bool for_trace, bool translating, void *user_data)
 
typedef dr_emit_flags_t(* drmgr_insertion_cb_t) (void *drcontext, void *tag, instrlist_t *bb, instr_t *inst, bool for_trace, bool translating, void *user_data)
 
typedef dr_emit_flags_t(* drmgr_opcode_insertion_cb_t) (void *drcontext, void *tag, instrlist_t *bb, instr_t *inst, bool for_trace, bool translating, void *user_data)
 
typedef struct _drmgr_priority_t drmgr_priority_t
 
typedef struct _drmgr_instru_events_t drmgr_instru_events_t
 
typedef struct _emulated_instr_t emulated_instr_t
 

Enumerations

enum  drmgr_bb_phase_t {
  DRMGR_PHASE_NONE,
  DRMGR_PHASE_APP2APP,
  DRMGR_PHASE_ANALYSIS,
  DRMGR_PHASE_INSERTION,
  DRMGR_PHASE_INSTRU2INSTRU,
  DRMGR_PHASE_META_INSTRU
}
 
enum  dr_emulate_options_t {
  DR_EMULATE_REST_OF_BLOCK = 0x0001,
  DR_EMULATE_IS_FIRST_INSTR = 0x0002,
  DR_EMULATE_INSTR_ONLY = 0x0004
}
 

Functions

DR_EXPORT bool drmgr_init (void)
 
DR_EXPORT void drmgr_exit (void)
 
DR_EXPORT bool drmgr_register_bb_app2app_event (drmgr_xform_cb_t func, drmgr_priority_t *priority)
 
DR_EXPORT bool drmgr_unregister_bb_app2app_event (drmgr_xform_cb_t func)
 
DR_EXPORT bool drmgr_register_bb_instrumentation_event (drmgr_analysis_cb_t analysis_func, drmgr_insertion_cb_t insertion_func, drmgr_priority_t *priority)
 
DR_EXPORT bool drmgr_unregister_bb_instrumentation_event (drmgr_analysis_cb_t func)
 
DR_EXPORT bool drmgr_unregister_bb_insertion_event (drmgr_insertion_cb_t func)
 
DR_EXPORT bool drmgr_register_bb_instru2instru_event (drmgr_xform_cb_t func, drmgr_priority_t *priority)
 
DR_EXPORT bool drmgr_unregister_bb_instru2instru_event (drmgr_xform_cb_t func)
 
DR_EXPORT bool drmgr_register_bb_instrumentation_ex_event (drmgr_app2app_ex_cb_t app2app_func, drmgr_ilist_ex_cb_t analysis_func, drmgr_insertion_cb_t insertion_func, drmgr_ilist_ex_cb_t instru2instru_func, drmgr_priority_t *priority)
 
DR_EXPORT bool drmgr_unregister_bb_instrumentation_ex_event (drmgr_app2app_ex_cb_t app2app_func, drmgr_ilist_ex_cb_t analysis_func, drmgr_insertion_cb_t insertion_func, drmgr_ilist_ex_cb_t instru2instru_func)
 
DR_EXPORT bool drmgr_register_opcode_instrumentation_event (drmgr_opcode_insertion_cb_t func, int opcode, drmgr_priority_t *priority, void *user_data)
 
DR_EXPORT bool drmgr_unregister_opcode_instrumentation_event (drmgr_opcode_insertion_cb_t func, int opcode)
 
DR_EXPORT bool drmgr_register_bb_meta_instru_event (drmgr_xform_cb_t func, drmgr_priority_t *priority)
 
DR_EXPORT bool drmgr_unregister_bb_meta_instru_event (drmgr_xform_cb_t func)
 
DR_EXPORT bool drmgr_register_bb_instrumentation_all_events (drmgr_instru_events_t *events, drmgr_priority_t *priority)
 
DR_EXPORT bool drmgr_unregister_bb_instrumentation_all_events (drmgr_instru_events_t *events)
 
DR_EXPORT drmgr_bb_phase_t drmgr_current_bb_phase (void *drcontext)
 
DR_EXPORT bool drmgr_is_first_instr (void *drcontext, instr_t *instr)
 
DR_EXPORT bool drmgr_is_first_nonlabel_instr (void *drcontext, instr_t *instr)
 
DR_EXPORT bool drmgr_is_last_instr (void *drcontext, instr_t *instr)
 
DR_EXPORT int drmgr_register_tls_field (void)
 
DR_EXPORT bool drmgr_unregister_tls_field (int idx)
 
DR_EXPORT void * drmgr_get_tls_field (void *drcontext, int idx)
 
DR_EXPORT bool drmgr_set_tls_field (void *drcontext, int idx, void *value)
 
DR_EXPORT bool drmgr_insert_read_tls_field (void *drcontext, int idx, instrlist_t *ilist, instr_t *where, reg_id_t reg)
 
DR_EXPORT bool drmgr_insert_write_tls_field (void *drcontext, int idx, instrlist_t *ilist, instr_t *where, reg_id_t reg, reg_id_t scratch)
 
DR_EXPORT int drmgr_register_cls_field (void(*cb_init_func)(void *drcontext, bool new_depth), void(*cb_exit_func)(void *drcontext, bool thread_exit))
 
DR_EXPORT bool drmgr_unregister_cls_field (void(*cb_init_func)(void *drcontext, bool new_depth), void(*cb_exit_func)(void *drcontext, bool thread_exit), int idx)
 
DR_EXPORT void * drmgr_get_cls_field (void *drcontext, int idx)
 
DR_EXPORT bool drmgr_set_cls_field (void *drcontext, int idx, void *value)
 
DR_EXPORT bool drmgr_insert_read_cls_field (void *drcontext, int idx, instrlist_t *ilist, instr_t *where, reg_id_t reg)
 
DR_EXPORT bool drmgr_insert_write_cls_field (void *drcontext, int idx, instrlist_t *ilist, instr_t *where, reg_id_t reg, reg_id_t scratch)
 
DR_EXPORT bool drmgr_push_cls (void *drcontext)
 
DR_EXPORT bool drmgr_pop_cls (void *drcontext)
 
DR_EXPORT void * drmgr_get_parent_cls_field (void *drcontext, int idx)
 
DR_EXPORT ptr_uint_t drmgr_reserve_note_range (size_t size)
 
DR_EXPORT bool drmgr_insert_emulation_start (void *drcontext, instrlist_t *ilist, instr_t *where, emulated_instr_t *instr)
 
DR_EXPORT void drmgr_insert_emulation_end (void *drcontext, instrlist_t *ilist, instr_t *where)
 
DR_EXPORT bool drmgr_is_emulation_start (instr_t *instr)
 
DR_EXPORT bool drmgr_is_emulation_end (instr_t *instr)
 
DR_EXPORT bool drmgr_get_emulated_instr_data (instr_t *instr, DR_PARAM_OUT emulated_instr_t *emulated)
 
DR_EXPORT bool drmgr_in_emulation_region (void *drcontext, DR_PARAM_OUT const emulated_instr_t **emulation_info)
 
DR_EXPORT instr_tdrmgr_orig_app_instr_for_fetch (void *drcontext)
 
DR_EXPORT instr_tdrmgr_orig_app_instr_for_operands (void *drcontext)
 
DR_EXPORT int drmgr_decode_sysnum_from_wrapper (app_pc entry)
 
DR_EXPORT bool drmgr_register_thread_init_event (void(*func)(void *drcontext))
 
DR_EXPORT bool drmgr_register_thread_init_event_ex (void(*func)(void *drcontext), drmgr_priority_t *priority)
 
DR_EXPORT bool drmgr_register_thread_init_event_user_data (void(*func)(void *drcontext, void *user_data), drmgr_priority_t *priority, void *user_data)
 
DR_EXPORT bool drmgr_unregister_thread_init_event (void(*func)(void *drcontext))
 
DR_EXPORT bool drmgr_unregister_thread_init_event_user_data (void(*func)(void *drcontext, void *user_data))
 
DR_EXPORT bool drmgr_register_thread_exit_event (void(*func)(void *drcontext))
 
DR_EXPORT bool drmgr_register_thread_exit_event_ex (void(*func)(void *drcontext), drmgr_priority_t *priority)
 
DR_EXPORT bool drmgr_register_thread_exit_event_user_data (void(*func)(void *drcontext, void *user_data), drmgr_priority_t *priority, void *user_data)
 
DR_EXPORT bool drmgr_unregister_thread_exit_event (void(*func)(void *drcontext))
 
DR_EXPORT bool drmgr_unregister_thread_exit_event_user_data (void(*func)(void *drcontext, void *user_data))
 
DR_EXPORT bool drmgr_register_pre_syscall_event (bool(*func)(void *drcontext, int sysnum))
 
DR_EXPORT bool drmgr_register_pre_syscall_event_ex (bool(*func)(void *drcontext, int sysnum), drmgr_priority_t *priority)
 
DR_EXPORT bool drmgr_register_pre_syscall_event_user_data (bool(*func)(void *drcontext, int sysnum, void *user_data), drmgr_priority_t *priority, void *user_data)
 
DR_EXPORT bool drmgr_unregister_pre_syscall_event (bool(*func)(void *drcontext, int sysnum))
 
DR_EXPORT bool drmgr_unregister_pre_syscall_event_user_data (bool(*func)(void *drcontext, int sysnum, void *user_data))
 
DR_EXPORT bool drmgr_register_post_syscall_event (void(*func)(void *drcontext, int sysnum))
 
DR_EXPORT bool drmgr_register_post_syscall_event_ex (void(*func)(void *drcontext, int sysnum), drmgr_priority_t *priority)
 
DR_EXPORT bool drmgr_register_post_syscall_event_user_data (void(*func)(void *drcontext, int sysnum, void *user_data), drmgr_priority_t *priority, void *user_data)
 
DR_EXPORT bool drmgr_unregister_post_syscall_event (void(*func)(void *drcontext, int sysnum))
 
DR_EXPORT bool drmgr_unregister_post_syscall_event_user_data (void(*func)(void *drcontext, int sysnum, void *user_data))
 
DR_EXPORT bool drmgr_register_module_load_event (void(*func)(void *drcontext, const module_data_t *info, bool loaded))
 
DR_EXPORT bool drmgr_register_module_load_event_ex (void(*func)(void *drcontext, const module_data_t *info, bool loaded), drmgr_priority_t *priority)
 
DR_EXPORT bool drmgr_register_module_load_event_user_data (void(*func)(void *drcontext, const module_data_t *info, bool loaded, void *user_data), drmgr_priority_t *priority, void *user_data)
 
DR_EXPORT bool drmgr_unregister_module_load_event (void(*func)(void *drcontext, const module_data_t *info, bool loaded))
 
DR_EXPORT bool drmgr_unregister_module_load_event_user_data (void(*func)(void *drcontext, const module_data_t *info, bool loaded, void *user_data))
 
DR_EXPORT bool drmgr_register_module_unload_event (void(*func)(void *drcontext, const module_data_t *info))
 
DR_EXPORT bool drmgr_register_module_unload_event_ex (void(*func)(void *drcontext, const module_data_t *info), drmgr_priority_t *priority)
 
DR_EXPORT bool drmgr_register_module_unload_event_user_data (void(*func)(void *drcontext, const module_data_t *info, void *user_data), drmgr_priority_t *priority, void *user_data)
 
DR_EXPORT bool drmgr_unregister_module_unload_event (void(*func)(void *drcontext, const module_data_t *info))
 
DR_EXPORT bool drmgr_unregister_module_unload_event_user_data (void(*func)(void *drcontext, const module_data_t *info, void *user_data))
 
DR_EXPORT bool drmgr_register_kernel_xfer_event (void(*func)(void *drcontext, const dr_kernel_xfer_info_t *info))
 
DR_EXPORT bool drmgr_register_kernel_xfer_event_ex (void(*func)(void *drcontext, const dr_kernel_xfer_info_t *info), drmgr_priority_t *priority)
 
DR_EXPORT bool drmgr_unregister_kernel_xfer_event (void(*func)(void *drcontext, const dr_kernel_xfer_info_t *info))
 
DR_EXPORT bool drmgr_register_signal_event (dr_signal_action_t(*func)(void *drcontext, dr_siginfo_t *siginfo))
 
DR_EXPORT bool drmgr_register_signal_event_ex (dr_signal_action_t(*func)(void *drcontext, dr_siginfo_t *siginfo), drmgr_priority_t *priority)
 
DR_EXPORT bool drmgr_register_signal_event_user_data (dr_signal_action_t(*func)(void *drcontext, dr_siginfo_t *siginfo, void *user_data), drmgr_priority_t *priority, void *user_data)
 
DR_EXPORT bool drmgr_unregister_signal_event (dr_signal_action_t(*func)(void *drcontext, dr_siginfo_t *siginfo))
 
DR_EXPORT bool drmgr_unregister_signal_event_user_data (dr_signal_action_t(*func)(void *drcontext, dr_siginfo_t *siginfo, void *user_data))
 
DR_EXPORT bool drmgr_register_exception_event (bool(*func)(void *drcontext, dr_exception_t *excpt))
 
DR_EXPORT bool drmgr_register_exception_event_ex (bool(*func)(void *drcontext, dr_exception_t *excpt), drmgr_priority_t *priority)
 
DR_EXPORT bool drmgr_unregister_exception_event (bool(*func)(void *drcontext, dr_exception_t *excpt))
 
DR_EXPORT bool drmgr_register_restore_state_event (void(*func)(void *drcontext, void *tag, dr_mcontext_t *mcontext, bool restore_memory, bool app_code_consistent))
 
DR_EXPORT bool drmgr_register_restore_state_ex_event (bool(*func)(void *drcontext, bool restore_memory, dr_restore_state_info_t *info))
 
DR_EXPORT bool drmgr_register_restore_state_ex_event_ex (bool(*func)(void *drcontext, bool restore_memory, dr_restore_state_info_t *info), drmgr_priority_t *priority)
 
DR_EXPORT bool drmgr_unregister_restore_state_event (void(*func)(void *drcontext, void *tag, dr_mcontext_t *mcontext, bool restore_memory, bool app_code_consistent))
 
DR_EXPORT bool drmgr_unregister_restore_state_ex_event (bool(*func)(void *drcontext, bool restore_memory, dr_restore_state_info_t *info))
 
DR_EXPORT bool drmgr_register_low_on_memory_event (void(*func)())
 
DR_EXPORT bool drmgr_register_low_on_memory_event_ex (void(*func)(), drmgr_priority_t *priority)
 
DR_EXPORT bool drmgr_register_low_on_memory_event_user_data (void(*func)(void *user_data), drmgr_priority_t *priority, void *user_data)
 
DR_EXPORT bool drmgr_unregister_low_on_memory_event (void(*func)())
 
DR_EXPORT bool drmgr_unregister_low_on_memory_event_user_data (void(*func)(void *user_data))
 
DR_EXPORT bool drmgr_disable_auto_predication (void *drcontext, instrlist_t *ilist)
 

Detailed Description

Header for DynamoRIO Multi-Instrumentation Manager Extension.