|
Rizin
unix-like reverse engineering framework and cli tools
|
#include <rz_util/rz_serialize.h>#include <rz_list.h>#include <rz_vector.h>#include <rz_type.h>#include <sdb.h>Go to the source code of this file.
Classes | |
| struct | typedb_sdb |
|
static |
Definition at line 254 of file serialize_functions.c.
References rz_type_db_t::callables, export_callable_cb(), and typedb_sdb::typedb.
Referenced by rz_serialize_callables_save().
Definition at line 247 of file serialize_functions.c.
References s, save_callable(), and v.
Referenced by callable_export_sdb().
Definition at line 132 of file serialize_functions.c.
References v.
Referenced by sdb_load_callables().
|
static |
Definition at line 43 of file serialize_functions.c.
References rz_callable_at::args, eprintf, error(), free(), i, key, arg::name, rz_callable_at::noret, NULL, parse_type_string_cached(), rz_type_db_t::parser, rz_callable_at::ret, rz_list_free(), rz_list_newf(), RZ_NEW0, rz_pvector_push(), rz_pvector_reserve(), rz_return_val_if_fail, RZ_STR_ISNOTEMPTY, rz_strbuf_fini(), rz_strbuf_initf(), rz_strbuf_setf(), rz_strf, rz_type_callable_arg_free(), rz_type_callable_free(), rz_type_free(), rz_type_func_new(), sdb_anext(), sdb_bool_get(), sdb_const_get(), sdb_get(), sdb_num_get(), strdup(), and type_string_cache_rollback().
Referenced by sdb_load_callables().
|
static |
Parse a type or take it from the cache if it has been parsed before already. This cache is really only relevant because types are stored in the sdb as their C expression, making them extremely slow to load. If they will be e.g. json in the future, this cache can be removed.
| newly_added | list of strings where str is appended if it has been added to the cache in this pass |
Definition at line 17 of file serialize_functions.c.
References NULL, cmd_descs_generate::parser, r, rz_list_push(), rz_return_val_if_fail, rz_type_clone(), rz_type_parse_string_single(), cmd_descs_generate::str, and strdup().
Referenced by get_callable_type().
| RZ_API bool rz_serialize_callables_load | ( | RZ_NONNULL Sdb * | db, |
| RZ_NONNULL RzTypeDB * | typedb, | ||
| RZ_NULLABLE RzSerializeResultInfo * | res | ||
| ) |
Loads the callable types from SDB.
| db | A SDB database object |
| typedb | RzTypeDB instance |
| res | A structure where the result is stored |
Definition at line 306 of file serialize_functions.c.
References rz_return_val_if_fail, sdb_load_callables(), and typedb_sdb::typedb.
Referenced by rz_serialize_analysis_callables_load().
| RZ_API void rz_serialize_callables_save | ( | RZ_NONNULL Sdb * | db, |
| RZ_NONNULL RzTypeDB * | typedb | ||
| ) |
Saves the callable types into SDB.
| db | A SDB database object |
| typedb | RzTypeDB instance |
Definition at line 294 of file serialize_functions.c.
References callable_export_sdb(), rz_return_if_fail, and typedb_sdb::typedb.
Referenced by rz_serialize_analysis_callables_save().
| RZ_API bool rz_type_db_load_callables_sdb | ( | RzTypeDB * | typedb, |
| RZ_NONNULL const char * | path | ||
| ) |
Loads the callable types from compiled SDB specified by path.
| typedb | RzTypeDB instance |
| path | A path to the compiled SDB containing serialized types |
Definition at line 266 of file serialize_functions.c.
References path, rz_file_exists(), rz_return_val_if_fail, sdb_load_by_path(), and typedb_sdb::typedb.
Referenced by rz_type_db_init().
| RZ_API bool rz_type_db_load_callables_sdb_str | ( | RzTypeDB * | typedb, |
| RZ_NONNULL const char * | str | ||
| ) |
Loads the callable types from SDB KV string.
| typedb | RzTypeDB instance |
| str | A string in Key-Value format as for non-compiled SDB |
Definition at line 280 of file serialize_functions.c.
References rz_return_val_if_fail, RZ_STR_ISEMPTY, sdb_load_from_string(), cmd_descs_generate::str, and typedb_sdb::typedb.
|
static |
Definition at line 184 of file serialize_functions.c.
References rz_callable_at::args, free(), i, key, arg::name, rz_callable_at::name, rz_callable_at::noret, rz_callable_at::ret, rz_pvector_foreach, rz_pvector_len(), rz_return_if_fail, rz_str_newf(), rz_str_sanitize_sdb_key(), rz_strbuf_fini(), rz_strbuf_init(), rz_strbuf_setf(), rz_type_as_string(), sdb_bool_set(), sdb_num_set(), and sdb_set().
Referenced by export_callable_cb().
|
static |
Definition at line 159 of file serialize_functions.c.
References path, rz_return_val_if_fail, RZ_STR_ISEMPTY, sdb_close(), sdb_free(), sdb_load_callables(), and sdb_new().
Referenced by rz_type_db_load_callables_sdb().
Definition at line 136 of file serialize_functions.c.
References rz_type_db_t::callables, filter_func(), get_callable_type(), ls_foreach, ls_free(), rz_callable_at::name, RZ_LOG_DEBUG, rz_return_val_if_fail, sdb_foreach_list_filter(), and sdbkv_key().
Referenced by rz_serialize_callables_load(), sdb_load_by_path(), and sdb_load_from_string().
|
static |
Definition at line 171 of file serialize_functions.c.
References rz_return_val_if_fail, RZ_STR_ISEMPTY, sdb_close(), sdb_free(), sdb_load_callables(), sdb_new0(), and sdb_query_lines().
Referenced by rz_type_db_load_callables_sdb_str().
|
static |
Definition at line 35 of file serialize_functions.c.
References s.
Referenced by get_callable_type().