Rizin
unix-like reverse engineering framework and cli tools
|
#include <pthread.h>
#include <semaphore.h>
#include <sys/ptrace.h>
Go to the source code of this file.
Classes | |
struct | ptrace_wrap_request_t |
struct | ptrace_wrap_instance_t |
Typedefs | |
typedef int | ptrace_wrap_ptrace_request |
typedef void *(* | ptrace_wrap_func_func) (void *) |
typedef struct ptrace_wrap_request_t | ptrace_wrap_request |
typedef struct ptrace_wrap_instance_t | ptrace_wrap_instance |
Enumerations | |
enum | ptrace_wrap_request_type { PTRACE_WRAP_REQUEST_TYPE_STOP , PTRACE_WRAP_REQUEST_TYPE_PTRACE , PTRACE_WRAP_REQUEST_TYPE_FORK , PTRACE_WRAP_REQUEST_TYPE_FUNC } |
Functions | |
int | ptrace_wrap_instance_start (ptrace_wrap_instance *inst) |
void | ptrace_wrap_instance_stop (ptrace_wrap_instance *inst) |
long | ptrace_wrap (ptrace_wrap_instance *inst, ptrace_wrap_ptrace_request request, pid_t pid, void *addr, void *data) |
pid_t | ptrace_wrap_fork (ptrace_wrap_instance *inst, void(*child_callback)(void *), void *child_callback_user) |
void * | ptrace_wrap_func (ptrace_wrap_instance *inst, ptrace_wrap_func_func func, void *user) |
typedef void*(* ptrace_wrap_func_func) (void *) |
Definition at line 24 of file ptrace_wrap.h.
typedef struct ptrace_wrap_instance_t ptrace_wrap_instance |
typedef int ptrace_wrap_ptrace_request |
Definition at line 14 of file ptrace_wrap.h.
typedef struct ptrace_wrap_request_t ptrace_wrap_request |
Enumerator | |
---|---|
PTRACE_WRAP_REQUEST_TYPE_STOP | |
PTRACE_WRAP_REQUEST_TYPE_PTRACE | |
PTRACE_WRAP_REQUEST_TYPE_FORK | |
PTRACE_WRAP_REQUEST_TYPE_FUNC |
Definition at line 17 of file ptrace_wrap.h.
long ptrace_wrap | ( | ptrace_wrap_instance * | inst, |
ptrace_wrap_ptrace_request | request, | ||
pid_t | pid, | ||
void * | addr, | ||
void * | data | ||
) |
Definition at line 90 of file ptrace_wrap.c.
References addr, pid, ptrace, ptrace_wrap_request_t::ptrace, ptrace_wrap_instance_t::ptrace_result, PTRACE_WRAP_REQUEST_TYPE_PTRACE, request, ptrace_wrap_instance_t::request, ptrace_wrap_instance_t::request_sem, ptrace_wrap_instance_t::result_sem, sem_post(), sem_wait(), ptrace_wrap_instance_t::th, and ptrace_wrap_request_t::type.
pid_t ptrace_wrap_fork | ( | ptrace_wrap_instance * | inst, |
void(*)(void *) | child_callback, | ||
void * | child_callback_user | ||
) |
Definition at line 108 of file ptrace_wrap.c.
References ptrace_wrap_request_t::fork, ptrace_wrap_instance_t::fork_result, PTRACE_WRAP_REQUEST_TYPE_FORK, r, ptrace_wrap_instance_t::request, ptrace_wrap_instance_t::request_sem, ptrace_wrap_instance_t::result_sem, sem_post(), sem_wait(), ptrace_wrap_instance_t::th, and ptrace_wrap_request_t::type.
void* ptrace_wrap_func | ( | ptrace_wrap_instance * | inst, |
ptrace_wrap_func_func | func, | ||
void * | user | ||
) |
Definition at line 130 of file ptrace_wrap.c.
References ptrace_wrap_request_t::func, ptrace_wrap_instance_t::func_result, PTRACE_WRAP_REQUEST_TYPE_FUNC, ptrace_wrap_instance_t::request, ptrace_wrap_instance_t::request_sem, ptrace_wrap_instance_t::result_sem, sem_post(), sem_wait(), ptrace_wrap_instance_t::th, and ptrace_wrap_request_t::type.
int ptrace_wrap_instance_start | ( | ptrace_wrap_instance * | inst | ) |
Definition at line 14 of file ptrace_wrap.c.
References NULL, r, ptrace_wrap_instance_t::request_sem, ptrace_wrap_instance_t::result_sem, sem_destroy(), sem_init(), ptrace_wrap_instance_t::th, and th_run().
void ptrace_wrap_instance_stop | ( | ptrace_wrap_instance * | inst | ) |
Definition at line 36 of file ptrace_wrap.c.
References NULL, PTRACE_WRAP_REQUEST_TYPE_STOP, ptrace_wrap_instance_t::request, ptrace_wrap_instance_t::request_sem, ptrace_wrap_instance_t::result_sem, sem_destroy(), sem_post(), ptrace_wrap_instance_t::th, and ptrace_wrap_request_t::type.
Referenced by rz_io_fini().