Пример #1
0
static
void module_unload_event1(void *drcontext, const module_data_t *info)
{
    inc_count_first(EVENT_MODULE_UNLOAD_1, EVENT_MODULE_UNLOAD_2);
    if (!dr_unregister_module_unload_event(module_unload_event1))
        dr_fprintf(STDERR, "unregister failed!\n");
}
Пример #2
0
static
void post_syscall_event1(void *drcontext, int sysnum)
{
    inc_count_first(EVENT_POST_SYSCALL_1, EVENT_POST_SYSCALL_2);
    if (!dr_unregister_post_syscall_event(post_syscall_event1))
        dr_fprintf(STDERR, "unregister failed!\n");
}
Пример #3
0
static
void fork_init_event1(void *drcontext)
{
    inc_count_first(EVENT_FORK_INIT_1, EVENT_FORK_INIT_2);
    if (!dr_unregister_fork_init_event(fork_init_event1))
        dr_fprintf(STDERR, "unregister failed!\n");
}
Пример #4
0
static
void delete_event1(void *dcontext, void *tag)
{
    inc_count_first(EVENT_DELETE_1, EVENT_DELETE_2);
    if (!dr_unregister_delete_event(delete_event1))
        dr_fprintf(STDERR, "unregister failed!\n");
}
Пример #5
0
static
void thread_exit_event1(void *drcontext)
{
    inc_count_first(EVENT_THREAD_EXIT_1, EVENT_THREAD_EXIT_2);
    if (!dr_unregister_thread_exit_event(thread_exit_event1))
        dr_fprintf(STDERR, "unregister failed!\n");
}
Пример #6
0
static
bool filter_syscall_event1(void *drcontext, int sysnum)
{
    inc_count_first(EVENT_FILTER_SYSCALL_1, EVENT_FILTER_SYSCALL_2);
    if (!dr_unregister_filter_syscall_event(filter_syscall_event1))
        dr_fprintf(STDERR, "unregister failed!\n");
    return true;
}
Пример #7
0
static
dr_custom_trace_action_t end_trace_event1(void *dcontext, void *trace_tag, void *next_tag)
{
    inc_count_first(EVENT_END_TRACE_1, EVENT_END_TRACE_2);
    if (!dr_unregister_end_trace_event(end_trace_event1))
        dr_fprintf(STDERR, "unregister failed!\n");
    return CUSTOM_TRACE_DR_DECIDES;
}
Пример #8
0
static void
restore_state_event1(void *drcontext, void *tag, dr_mcontext_t *mcontext,
                     bool restore_memory, bool app_code_consistent)
{
    inc_count_first(EVENT_RESTORE_STATE_1, EVENT_RESTORE_STATE_2);

    if (!dr_unregister_restore_state_event(restore_state_event1))
        dr_fprintf(STDERR, "unregister failed!\n");
}
Пример #9
0
static
dr_emit_flags_t trace_event1(void *dcontext, void *tag, instrlist_t *trace,
                             bool translating)
{
    inc_count_first(EVENT_TRACE_1, EVENT_TRACE_2);
    if (!dr_unregister_trace_event(trace_event1))
        dr_fprintf(STDERR, "unregister failed!\n");
    return DR_EMIT_DEFAULT;
}
Пример #10
0
static bool
restore_state_ex_event1(void *drcontext, bool restore_memory,
                        dr_restore_state_info_t *info)
{
    inc_count_first(EVENT_RESTORE_STATE_EX_1, EVENT_RESTORE_STATE_EX_2);

    if (!dr_unregister_restore_state_ex_event(restore_state_ex_event1))
        dr_fprintf(STDERR, "unregister failed!\n");
    return true;
}
Пример #11
0
static
bool exception_event1(void *dcontext, dr_exception_t *excpt)
{
    if (excpt->record->ExceptionCode == STATUS_ACCESS_VIOLATION)
        inc_count_first(EVENT_EXCEPTION_1, EVENT_EXCEPTION_2);

    if (!dr_unregister_exception_event(exception_event1))
        dr_fprintf(STDERR, "unregister failed!\n");

    /* ensure we get our deletion events */
    dr_flush_region((app_pc)excpt->record->ExceptionAddress, 1);
    return true;
}
Пример #12
0
static
dr_signal_action_t signal_event1(void *dcontext, dr_siginfo_t *info)
{
    inc_count_first(EVENT_SIGNAL_1, EVENT_SIGNAL_2);
    if (info->sig == SIGUSR2) 
        return DR_SIGNAL_SUPPRESS;
    else if (info->sig == SIGURG) {
        if (!dr_unregister_signal_event(signal_event1))
            dr_fprintf(STDERR, "unregister failed!\n");
        return DR_SIGNAL_BYPASS;
    }
    return DR_SIGNAL_DELIVER;
}
Пример #13
0
static bool
restore_state_ex_event1(void *drcontext, bool restore_memory,
                        dr_restore_state_info_t *info)
{
    /* i#488: test bool compatibility */
    bool is_trace = info->fragment_info.is_trace;
    if (sizeof(is_trace) != sizeof(info->fragment_info.is_trace))
        dr_fprintf(STDERR, "bool size incompatibility %d!\n", is_trace/*force ref*/);

    inc_count_first(EVENT_RESTORE_STATE_EX_1, EVENT_RESTORE_STATE_EX_2);

    if (!dr_unregister_restore_state_ex_event(restore_state_ex_event1))
        dr_fprintf(STDERR, "unregister failed!\n");
    return true;
}