Rizin
unix-like reverse engineering framework and cli tools
|
#include <rz_types.h>
#include <rz_util.h>
#include <rz_syscall.h>
#include <stdio.h>
#include <string.h>
Go to the source code of this file.
Definition at line 399 of file syscall.c.
References k, list(), rz_list_append(), rz_syscall_item_free(), rz_syscall_item_new_from_string(), si, and v.
Referenced by rz_syscall_list().
|
static |
Definition at line 33 of file syscall.c.
References rz_sysreg_item_free().
Referenced by rz_sysregs_db_new().
Definition at line 334 of file syscall.c.
References rz_syscall_get_swi(), and s.
Referenced by rz_syscall_get(), and rz_syscall_get_i().
Definition at line 107 of file syscall.c.
References file_name, free(), rz_file_exists(), rz_file_path_join(), rz_path_system(), rz_return_val_if_fail, RZ_SDB, rz_str_newf(), sdb_new(), sdb_open(), and sdb_reset().
Referenced by rz_syscall_setup().
RZ_LIB_VERSION | ( | rz_syscall | ) |
Frees an RzSyscall type.
Definition at line 79 of file syscall.c.
References free(), rz_sysregs_db_free(), s, and sdb_free().
Referenced by resolve_syscalls(), rz_analysis_free(), rz_asm_free(), and rz_egg_free().
RZ_API RzSyscallItem* rz_syscall_get | ( | RzSyscall * | s, |
int | num, | ||
int | swi | ||
) |
Definition at line 345 of file syscall.c.
References getswi(), key, NULL, num, rz_return_val_if_fail, rz_syscall_item_new_from_string(), s, sdb_const_get(), and sdb_fmt().
Referenced by do_syscall_search(), filter(), resolve_syscalls(), rz_analysis_syscall_number_handler(), rz_core_analysis_esil(), rz_core_syscall_as_string(), rz_egg_syscall(), show_syscall(), and syscalls_dump().
Definition at line 388 of file syscall.c.
References foo, getswi(), NULL, num, rz_return_val_if_fail, s, sdb_const_get(), and snprintf.
Definition at line 376 of file syscall.c.
References int, NULL, rz_return_val_if_fail, s, sdb_array_get_num(), and cmd_descs_generate::str.
Referenced by cmd_debug_cont_syscall(), rz_analysis_syscall_name_handler(), rz_asm_massemble(), rz_core_syscall(), rz_egg_syscall(), and syscalls_dump().
Definition at line 341 of file syscall.c.
References NULL, s, and sdb_num_get().
Referenced by getswi(), and rz_core_syscall_as_string().
RZ_API void rz_syscall_item_free | ( | RzSyscallItem * | si | ) |
Definition at line 325 of file syscall.c.
Referenced by callback_list(), do_syscall_search(), filter(), resolve_syscalls(), rz_core_analysis_esil(), rz_core_syscall_as_string(), rz_egg_syscall(), rz_syscall_list(), show_syscall(), and syscalls_dump().
RZ_API RzSyscallItem* rz_syscall_item_new_from_string | ( | const char * | name, |
const char * | s | ||
) |
Definition at line 290 of file syscall.c.
References calloc(), free(), int, NULL, RZ_NEW0, rz_num_get(), rz_str_split(), rz_str_word_get0(), s, si, and strdup().
Referenced by callback_list(), and rz_syscall_get().
Definition at line 415 of file syscall.c.
References callback_list(), list(), NULL, rz_list_newf(), rz_return_val_if_fail, rz_syscall_item_free(), s, and sdb_foreach().
Referenced by do_analysis_search(), rz_analysis_syscall_print_handler(), and syscalls_dump().
Creates a new RzSyscall type.
Definition at line 67 of file syscall.c.
References rs, RZ_NEW0, rz_sysregs_db_new(), and sdb_new0().
Referenced by resolve_syscalls(), rz_analysis_new(), rz_egg_new(), and rz_main_rz_asm().
RZ_API bool rz_syscall_setup | ( | RzSyscall * | s, |
const char * | arch, | ||
int | bits, | ||
const char * | cpu, | ||
const char * | os | ||
) |
Definition at line 234 of file syscall.c.
References arch, bits(), cpu, rz_socket_t::fd, free(), load_sdb(), NULL, RZ_JOIN_2_PATHS, rz_path_system(), RZ_SDB_REG, rz_str_newf(), RZ_SYS_ARCH, RZ_SYS_OS, rz_sysreg_set_arch(), s, sdb_free(), strdup(), syscall_reload_needed(), and sysregs_reload_needed().
Referenced by cb_asmarch(), cb_asmbits(), cb_asmos(), resolve_syscalls(), rz_asm_massemble(), rz_egg_setup(), and rz_main_rz_asm().
Searches the sysregs SDB database inside librz/reg/d for the type (mmio/reg) and returns its value as a string.
s | reference to RzSyscall |
type | reference to the type of key: mmio/reg |
port | reference to the io port |
Definition at line 433 of file syscall.c.
References rz_sysreg_item_t::comment, NULL, rz_socket_t::port, rz_return_val_if_fail, s, type, and rz_sysreg_item_t::type.
Referenced by ds_print_sysregs().
RZ_API void rz_sysreg_item_free | ( | RzSysregItem * | s | ) |
RZ_API RZ_OWN RzSysregItem* rz_sysreg_item_new | ( | RZ_NULLABLE const char * | name | ) |
Creates a new RzSysregItem type.
name | Name of the SysregItem (sysregitem->name) |
Definition at line 22 of file syscall.c.
References rz_sysreg_item_t::comment, rz_sysreg_item_t::name, NULL, RZ_NEW0, strdup(), and rz_sysreg_item_t::type.
Referenced by sdb_load_sysregs().
RZ_API bool rz_sysreg_load_sdb | ( | RzSysregsDB * | sysregdb, |
const char * | path | ||
) |
Loads the RzSysregDB from the path to the hashtable.
s | reference to RzSysregDB |
path | reference to path of the SDB file |
Definition at line 198 of file syscall.c.
References path, rz_file_exists(), and sdb_load_by_path().
Referenced by rz_sysreg_set_arch().
RZ_API bool rz_sysreg_set_arch | ( | RzSyscall * | s, |
RZ_NONNULL const char * | arch, | ||
RZ_NONNULL const char * | regs_dir | ||
) |
Sets the architecture for sysregs during analysis and loads up the sysregs SDB database.
s | reference to RzSyscall |
arch | reference to value of asm.arch |
regs_dir | path where registers SDB files are located |
Definition at line 213 of file syscall.c.
References arch, free(), path, rz_file_path_join(), rz_return_val_if_fail, rz_strf, rz_sysreg_load_sdb(), rz_sysregs_db_free(), rz_sysregs_db_new(), and s.
Referenced by rz_syscall_setup().
RZ_API void rz_sysregs_db_free | ( | RzSysregsDB * | sysregdb | ) |
Frees a RzSysregDB type.
Definition at line 56 of file syscall.c.
References free(), and rz_sysreg_db_t::port.
Referenced by rz_syscall_free(), and rz_sysreg_set_arch().
RZ_API RzSysregsDB* rz_sysregs_db_new | ( | ) |
Creates a new RzSysregDB type.
Definition at line 40 of file syscall.c.
References free(), free_port_kv(), NULL, rz_sysreg_db_t::port, and RZ_NEW0.
Referenced by rz_syscall_new(), and rz_sysreg_set_arch().
|
static |
Definition at line 184 of file syscall.c.
References path, sdb_close(), sdb_free(), sdb_load_sysregs(), and sdb_new().
Referenced by rz_sysreg_load_sdb().
|
static |
Definition at line 148 of file syscall.c.
References rz_sysreg_item_t::comment, free(), ls_foreach, ls_free(), name, NULL, rz_sysreg_db_t::port, rz_return_val_if_fail, rz_str_newf(), rz_sysreg_item_free(), rz_sysreg_item_new(), sdb_foreach_list(), sdb_get(), sdb_num_get(), sdbkv_key(), sdbkv_value(), strdup(), rz_sysreg_item_t::type, and ut64().
Referenced by sdb_load_by_path().