Exemple #1
0
static bool
sr_gdb_is_exit_frame(struct sr_gdb_frame *frame)
{
    return
        sr_gdb_frame_calls_func(frame, "__run_exit_handlers", "exit.c", NULL) ||
        sr_gdb_frame_calls_func(frame, "raise", "pt-raise.c", "libc.so", "libc-", "libpthread.so", NULL) ||
        sr_gdb_frame_calls_func(frame, "__GI_raise", "raise.c", NULL) ||
        sr_gdb_frame_calls_func(frame, "exit", "exit.c", NULL) ||
        sr_gdb_frame_calls_func(frame, "abort", "abort.c", "libc.so", "libc-", NULL) ||
        sr_gdb_frame_calls_func(frame, "__GI_abort", "abort.c", NULL) ||
        /* Terminates a function in case of buffer overflow. */
        sr_gdb_frame_calls_func(frame, "__chk_fail", "chk_fail.c", "libc.so", NULL) ||
        sr_gdb_frame_calls_func(frame, "__stack_chk_fail", "stack_chk_fail.c", "libc.so", NULL) ||
        sr_gdb_frame_calls_func(frame, "kill", "syscall-template.S", NULL);
}
Exemple #2
0
PyObject *
sr_py_gdb_frame_calls_func_in_file(PyObject *self, PyObject *args)
{
    char *func_name, *file_name;
    if (!PyArg_ParseTuple(args, "ss", &func_name, &file_name))
        return NULL;

    struct sr_gdb_frame *frame = ((struct sr_py_gdb_frame*)self)->frame;
    return Py_BuildValue("i", sr_gdb_frame_calls_func(frame, func_name, file_name, NULL));
}