Rizin
unix-like reverse engineering framework and cli tools
|
Go to the source code of this file.
Classes | |
struct | map_string_value_t |
Typedefs | |
typedef struct map_string_value_t | MapStringValue |
Functions | |
RZ_API ut8 | rz_core_flirt_arch_from_name (RZ_NONNULL const char *arch) |
Returns the FLIRT arch id from a given arch name Returns RZ_FLIRT_SIG_ARCH_ANY if name is not found. More... | |
RZ_API const char * | rz_core_flirt_arch_from_id (ut8 arch) |
Returns the FLIRT arch name (string format) from a given arch id Returns "unknown" if name is not found. More... | |
RZ_API ut32 | rz_core_flirt_file_from_option_list (RZ_NONNULL const char *file_list) |
Returns the FLIRT file flags from a given list (comma spaced) of file types Returns RZ_FLIRT_SIG_FILE_ALL if file_list is "any" and 0 if no valid value is not found. More... | |
RZ_API ut16 | rz_core_flirt_os_from_option_list (RZ_NONNULL const char *os_list) |
Returns the FLIRT file flags from a given list (comma spaced) of file types Returns RZ_FLIRT_SIG_OS_ALL if file_list is "any" and 0 if no valid value is not found. More... | |
RZ_API ut16 | rz_core_flirt_app_from_option_list (RZ_NONNULL const char *app_list) |
Returns the FLIRT file flags from a given list (comma spaced) of file types Returns RZ_FLIRT_SIG_APP_ALL if file_list is "any" and 0 if no valid value is not found. More... | |
static void | flirt_print_module (const RzFlirtModule *module) |
static void | flirt_print_node_pattern (const RzFlirtNode *node) |
static void | flirt_print_indentation (int indent) |
static void | flirt_print_node (const RzFlirtNode *node, int indent) |
RZ_API bool | rz_core_flirt_dump_file (RZ_NONNULL const char *flirt_file) |
Dumps the contents of a FLIRT file. More... | |
RZ_API bool | rz_core_flirt_create_file (RZ_NONNULL RzCore *core, RZ_NONNULL const char *output_file, RZ_NULLABLE ut32 *written_nodes) |
Generates a new FLIRT file from a given RzCore structure. More... | |
RZ_API bool | rz_core_flirt_convert_file (RZ_NONNULL RzCore *core, RZ_NONNULL const char *input_file, RZ_NONNULL const char *output_file) |
converts a FLIRT file to the other format. More... | |
Variables | |
const MapStringValue | arch_map [29] |
const MapStringValue | file_map [25] |
const MapStringValue | os_map [6] |
const MapStringValue | app_map [10] |
typedef struct map_string_value_t MapStringValue |
|
static |
Definition at line 338 of file csign.c.
References rz_cons_printf(), and rz_str_pad().
Referenced by flirt_print_node().
|
static |
Definition at line 287 of file csign.c.
References rz_flirt_function_t::is_collision, rz_flirt_function_t::is_local, rz_list_iter_t::n, rz_flirt_function_t::name, rz_flirt_tail_byte_t::offset, rz_flirt_function_t::offset, rz_cons_printf(), and rz_flirt_tail_byte_t::value.
Referenced by flirt_print_node().
|
static |
Definition at line 342 of file csign.c.
References rz_flirt_node_t::child_list, flirt_print_indentation(), flirt_print_module(), flirt_print_node_pattern(), i, rz_flirt_node_t::module_list, rz_flirt_node_t::pattern_bytes, and rz_cons_printf().
Referenced by rz_core_flirt_dump_file().
|
static |
Definition at line 327 of file csign.c.
References i, rz_flirt_node_t::length, rz_flirt_node_t::pattern_bytes, rz_flirt_node_t::pattern_mask, and rz_cons_printf().
Referenced by flirt_print_node().
RZ_API ut16 rz_core_flirt_app_from_option_list | ( | RZ_NONNULL const char * | app_list | ) |
Returns the FLIRT file flags from a given list (comma spaced) of file types Returns RZ_FLIRT_SIG_APP_ALL if file_list is "any" and 0 if no valid value is not found.
app_list | The app list to convert to flags |
Definition at line 258 of file csign.c.
References app_map, flags, i, NULL, RZ_ARRAY_SIZE, RZ_FLIRT_SIG_APP_ALL, rz_list_free(), RZ_LOG_ERROR, rz_return_val_if_fail, RZ_STR_ISNOTEMPTY, rz_str_split_duplist(), and map_string_value_t::value.
Returns the FLIRT arch name (string format) from a given arch id Returns "unknown" if name is not found.
arch | The arch to convert to string |
Definition at line 168 of file csign.c.
References arch, arch_map, i, map_string_value_t::name, RZ_ARRAY_SIZE, and value.
Referenced by rz_core_flirt_dump_file().
RZ_API ut8 rz_core_flirt_arch_from_name | ( | RZ_NONNULL const char * | arch | ) |
Returns the FLIRT arch id from a given arch name Returns RZ_FLIRT_SIG_ARCH_ANY if name is not found.
arch | The arch to convert to id |
Definition at line 148 of file csign.c.
References arch, arch_map, i, RZ_ARRAY_SIZE, RZ_FLIRT_SIG_ARCH_ANY, rz_return_val_if_fail, RZ_STR_ISNOTEMPTY, and map_string_value_t::value.
Referenced by rz_core_analysis_sigdb_apply(), rz_core_flirt_convert_file(), rz_core_flirt_create_file(), and rz_flirt_scan_handler().
RZ_API bool rz_core_flirt_convert_file | ( | RZ_NONNULL RzCore * | core, |
RZ_NONNULL const char * | input_file, | ||
RZ_NONNULL const char * | output_file | ||
) |
converts a FLIRT file to the other format.
input_file | Input file |
output_file | Output file |
optimize | Optimization value (expects an RZ_FLIRT_NODE_OPTIMIZE_* value) |
Definition at line 510 of file csign.c.
References deflate(), fail, NULL, O_CREAT, O_RDWR, O_TRUNC, options, rz_buf_free(), rz_buf_new_file(), rz_buf_new_slurp(), rz_config_get(), rz_config_get_b(), rz_config_get_i(), rz_core_flirt_arch_from_name(), rz_core_flirt_file_from_option_list(), rz_core_flirt_os_from_option_list(), RZ_FLIRT_LIBRARY_NAME_DFL, RZ_FLIRT_NODE_OPTIMIZE_MAX, RZ_FLIRT_SIG_APP_ALL, RZ_FLIRT_SIG_ARCH_ANY, RZ_LOG_ERROR, RZ_LOG_WARN, rz_return_val_if_fail, rz_sign_flirt_node_free(), rz_sign_flirt_parse_compressed_pattern_from_buffer(), rz_sign_flirt_parse_string_pattern_from_buffer(), rz_sign_flirt_write_compressed_pattern_to_buffer(), rz_sign_flirt_write_string_pattern_to_buffer(), RZ_STR_ISEMPTY, RZ_STR_ISNOTEMPTY, rz_str_lchr(), and ut64().
Referenced by rz_main_rz_sign().
RZ_API bool rz_core_flirt_create_file | ( | RZ_NONNULL RzCore * | core, |
RZ_NONNULL const char * | output_file, | ||
RZ_NULLABLE ut32 * | written_nodes | ||
) |
Generates a new FLIRT file from a given RzCore structure.
core | RzCore to use. |
output_file | Output file. |
written_nodes | When not NULL, returns the number of nodes written in the file. |
Definition at line 431 of file csign.c.
References deflate(), fail, O_CREAT, O_RDWR, O_TRUNC, options, rz_buf_free(), rz_buf_new_file(), rz_config_get(), rz_config_get_b(), rz_config_get_i(), rz_core_flirt_arch_from_name(), rz_core_flirt_file_from_option_list(), rz_core_flirt_os_from_option_list(), RZ_FLIRT_LIBRARY_NAME_DFL, RZ_FLIRT_NODE_OPTIMIZE_MAX, RZ_FLIRT_SIG_APP_ALL, RZ_FLIRT_SIG_ARCH_ANY, RZ_LOG_ERROR, RZ_LOG_WARN, rz_return_val_if_fail, rz_sign_flirt_node_count_nodes(), rz_sign_flirt_node_free(), rz_sign_flirt_node_new(), rz_sign_flirt_write_compressed_pattern_to_buffer(), rz_sign_flirt_write_string_pattern_to_buffer(), RZ_STR_ISEMPTY, RZ_STR_ISNOTEMPTY, rz_str_lchr(), and ut64().
Referenced by rz_flirt_create_handler(), and rz_main_rz_sign().
RZ_API bool rz_core_flirt_dump_file | ( | RZ_NONNULL const char * | flirt_file | ) |
Dumps the contents of a FLIRT file.
flirt_file | FLIRT file name to dump |
Definition at line 372 of file csign.c.
References flirt_print_node(), info(), NULL, rz_buf_free(), rz_buf_new_slurp(), rz_cons_printf(), rz_core_flirt_arch_from_id(), RZ_FLIRT_FILE_TYPE_PAT, RZ_FLIRT_FILE_TYPE_SIG, RZ_FLIRT_NODE_OPTIMIZE_NORMAL, RZ_FLIRT_SIG_ARCH_ANY, RZ_LOG_ERROR, rz_return_val_if_fail, rz_sign_flirt_info_fini(), rz_sign_flirt_node_free(), rz_sign_flirt_parse_compressed_pattern_from_buffer(), rz_sign_flirt_parse_string_pattern_from_buffer(), RZ_STR_ISEMPTY, RZ_STR_ISNOTEMPTY, rz_str_lchr(), rz_warn_if_reached, and rz_bin_info_t::type.
Referenced by rz_flirt_dump_handler(), and rz_main_rz_sign().
RZ_API ut32 rz_core_flirt_file_from_option_list | ( | RZ_NONNULL const char * | file_list | ) |
Returns the FLIRT file flags from a given list (comma spaced) of file types Returns RZ_FLIRT_SIG_FILE_ALL if file_list is "any" and 0 if no valid value is not found.
file_list | The file list to convert to flags |
Definition at line 186 of file csign.c.
References file_map, flags, i, NULL, RZ_ARRAY_SIZE, RZ_FLIRT_SIG_FILE_ALL, rz_list_free(), RZ_LOG_ERROR, rz_return_val_if_fail, RZ_STR_ISNOTEMPTY, rz_str_split_duplist(), and map_string_value_t::value.
Referenced by rz_core_flirt_convert_file(), and rz_core_flirt_create_file().
RZ_API ut16 rz_core_flirt_os_from_option_list | ( | RZ_NONNULL const char * | os_list | ) |
Returns the FLIRT file flags from a given list (comma spaced) of file types Returns RZ_FLIRT_SIG_OS_ALL if file_list is "any" and 0 if no valid value is not found.
os_list | The os list to convert to flags |
Definition at line 222 of file csign.c.
References flags, i, NULL, os_map, RZ_ARRAY_SIZE, RZ_FLIRT_SIG_OS_ALL, rz_list_free(), RZ_LOG_ERROR, rz_return_val_if_fail, RZ_STR_ISNOTEMPTY, rz_str_split_duplist(), and map_string_value_t::value.
Referenced by rz_core_flirt_convert_file(), and rz_core_flirt_create_file().
const MapStringValue app_map[10] |
Definition at line 128 of file csign.c.
Referenced by rz_core_flirt_app_from_option_list().
const MapStringValue arch_map[29] |
Definition at line 14 of file csign.c.
Referenced by rz_core_flirt_arch_from_id(), and rz_core_flirt_arch_from_name().
const MapStringValue file_map[25] |
Definition at line 91 of file csign.c.
Referenced by rz_core_flirt_file_from_option_list().
const MapStringValue os_map[6] |
Definition at line 119 of file csign.c.
Referenced by rz_core_flirt_os_from_option_list().