Rizin
unix-like reverse engineering framework and cli tools
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include <rz_socket.h>
#include <rz_util.h>
#include <rz_lib.h>
#include <rz_cons.h>
#include <sys/stat.h>
#include <sys/types.h>
Go to the source code of this file.
Macros | |
#define | DUP(x) |
Functions | |
RZ_API RzRunProfile * | rz_run_new (const char *str) |
RZ_API void | rz_run_reset (RzRunProfile *p) |
RZ_API bool | rz_run_parse (RzRunProfile *pf, const char *profile) |
RZ_API void | rz_run_free (RzRunProfile *r) |
static char * | getstr (const char *src) |
static int | parseBool (const char *e) |
static void | setASLR (RzRunProfile *r, int enabled) |
static int | handle_redirection_proc (const char *cmd, bool in, bool out, bool err) |
static int | handle_redirection (const char *cmd, bool in, bool out, bool err) |
RZ_API bool | rz_run_parsefile (RzRunProfile *p, const char *b) |
RZ_API bool | rz_run_parseline (RzRunProfile *p, const char *b) |
RZ_API const char * | rz_run_help (void) |
static int | redirect_socket_to_stdio (RzSocket *sock) |
static int | redirect_socket_to_pty (RzSocket *sock) |
RZ_API int | rz_run_config_env (RzRunProfile *p) |
RZ_API int | rz_run_start (RzRunProfile *p) |
RZ_API char * | rz_run_get_environ_profile (char **env) |
#define DUP | ( | x | ) |
|
static |
Definition at line 152 of file run.c.
References a, eprintf, free(), i, len, malloc(), msg, NULL, rz_file_slurp(), rz_hex_str2bin(), rz_str_trim_tail(), rz_str_unescape(), rz_sys_cmd_str(), src, and strdup().
Referenced by rz_run_config_env(), and rz_run_parseline().
Definition at line 389 of file run.c.
References close, cmd, DUP, dup2, EINTR, eprintf, err, f, handle_redirection_proc(), in, O_CREAT, O_RDONLY, O_WRONLY, out, rz_sys_pipe(), rz_sys_pipe_close(), STDIN_FILENO, and write.
Referenced by rz_run_config_env().
Definition at line 303 of file run.c.
References close, cmd, dup, dup2, test-lz4-list::exit, in, NULL, O_RDWR, out, pid, rz_sys_system(), status, STDIN_FILENO, STDOUT_FILENO, and TCSANOW.
Referenced by handle_redirection().
Definition at line 731 of file run.c.
References close, eprintf, test-lz4-list::exit, rz_socket_t::fd, FD_ISSET, FD_SET, FD_ZERO, free(), NULL, readfds, redirect_socket_to_stdio(), rz_socket_close_fd(), rz_socket_free(), rz_sys_fork(), select, sockfd, and TCSANOW.
Referenced by rz_run_config_env().
RZ_API int rz_run_config_env | ( | RzRunProfile * | p | ) |
Definition at line 809 of file run.c.
References chdir, chroot, close, dup2, eprintf, test-lz4-list::exit, autogen_x86imm::f2, fd, free(), getstr(), handle_redirection(), kill, NULL, p, redirect_socket_to_pty(), redirect_socket_to_stdio(), rz_file_path_join(), RZ_LIB_EXT, rz_path_libdir(), rz_socket_accept(), rz_socket_close_fd(), rz_socket_connect_tcp, rz_socket_free(), rz_socket_listen(), rz_socket_new(), rz_str_newf(), rz_sys_fork(), rz_sys_getenv(), rz_sys_pipe(), rz_sys_pipe_close(), rz_sys_setenv(), rz_sys_sleep(), rz_th_new(), setASLR(), setgid, setgroups, SIGKILL, and write.
Referenced by rz_main_rz_run().
RZ_API void rz_run_free | ( | RzRunProfile * | r | ) |
RZ_API char* rz_run_get_environ_profile | ( | char ** | env | ) |
Definition at line 1329 of file run.c.
References env, RzStrEscOptions::esc_bslash, free(), k, NULL, rz_str_escape_8bit(), rz_strbuf_appendf(), rz_strbuf_drain(), rz_strbuf_new(), sb, RzStrEscOptions::show_asciidot, strdup(), and v.
Referenced by rz_main_rizin().
RZ_API RzRunProfile* rz_run_new | ( | const char * | str | ) |
Definition at line 86 of file run.c.
References p, RZ_NEW0, rz_run_parsefile(), rz_run_reset(), and cmd_descs_generate::str.
Referenced by rz_main_rz_run(), and rz_socket_spawn().
RZ_API bool rz_run_parse | ( | RzRunProfile * | pf, |
const char * | profile | ||
) |
Definition at line 103 of file run.c.
References free(), p, rz_return_val_if_fail, rz_run_parseline(), rz_str_replace_char(), cmd_descs_generate::str, and strdup().
Referenced by rz_run_parsefile().
RZ_API bool rz_run_parsefile | ( | RzRunProfile * | p, |
const char * | b | ||
) |
Definition at line 468 of file run.c.
References b, free(), NULL, p, rz_file_slurp(), rz_return_val_if_fail, rz_run_parse(), and s.
Referenced by rz_run_new().
RZ_API bool rz_run_parseline | ( | RzRunProfile * | p, |
const char * | b | ||
) |
Definition at line 479 of file run.c.
References b, e, eprintf, fd, benchmark::FILE, free(), getstr(), len, n, NULL, p, parseBool(), RZ_RUN_PROFILE_NARGS, rz_signal_from_string(), rz_sys_clearenv(), rz_sys_fopen(), rz_sys_getenv(), rz_sys_setenv(), strdup(), v, and V.
Referenced by rz_main_rz_run(), and rz_run_parse().
RZ_API void rz_run_reset | ( | RzRunProfile * | p | ) |
Definition at line 97 of file run.c.
References memset(), p, and rz_return_if_fail.
Referenced by rz_run_new().
RZ_API int rz_run_start | ( | RzRunProfile * | p | ) |
Definition at line 1081 of file run.c.
References addr, close, cpu, CPU_ARCH_ABI64, CPU_TYPE_ANY, CPU_TYPE_I386, eprintf, test-lz4-list::exit, free(), i, kill, nice, NULL, p, pid, rz_file_binsh(), rz_file_dump(), rz_file_exists(), rz_file_path(), rz_lib_dl_close(), rz_lib_dl_open(), rz_lib_dl_sym(), rz_run_call1(), rz_run_call10(), rz_run_call2(), rz_run_call3(), rz_run_call4(), rz_run_call5(), rz_run_call6(), rz_run_call7(), rz_run_call8(), rz_run_call9(), rz_sys_execl(), rz_sys_execv(), rz_sys_fork(), rz_sys_get_environ(), rz_sys_system(), setgid, SIGKILL, and snprintf.
Referenced by rz_main_rz_run(), and rz_socket_spawn().
|
static |
Definition at line 252 of file run.c.
References eprintf, personality, r, and rz_sys_aslr().
Referenced by rz_run_config_env().