Rizin
unix-like reverse engineering framework and cli tools
|
Go to the source code of this file.
Macros | |
#define | starts_with_flag(b, c) (!strncmp(b, c, strlen(c))) |
Generates RzFlirtNodes from data contained in RzAnalysis.
Definition in file create.c.
|
static |
Definition at line 216 of file create.c.
References a, b, rz_flirt_function_t::name, and rz_list_first().
Referenced by flirt_node_shorten_and_insert().
int flirt_compare_node | ( | const RzFlirtNode * | a, |
const RzFlirtNode * | b | ||
) |
Definition at line 225 of file create.c.
Referenced by flirt_node_optimize(), flirt_node_shorten_and_insert(), rz_sign_flirt_node_new(), and rz_sign_flirt_parse_string_pattern_from_buffer().
Definition at line 204 of file flirt.c.
References i, length, and POLY.
Referenced by flirt_module_new(), and module_match_buffer().
Definition at line 126 of file create.c.
References rz_flirt_node_t::child_list, fail, i, rz_flirt_node_t::length, malloc(), mask, memcpy(), module_free(), rz_flirt_node_t::module_list, NULL, rz_flirt_node_t::pattern_bytes, rz_flirt_node_t::pattern_mask, RZ_FLIRT_MAX_PRELUDE_SIZE, rz_list_newf(), RZ_LOG_ERROR, RZ_MIN, RZ_NEW0, rz_sign_flirt_node_free(), and rz_flirt_node_t::variant_mask.
Referenced by flirt_create_child_from_analysis(), and flirt_node_shorten_and_insert().
|
static |
Definition at line 177 of file create.c.
References fail, flirt_create_child(), flirt_module_new(), mask, module_free(), rz_flirt_node_t::module_list, NULL, RZ_FLIRT_MAX_PRELUDE_SIZE, rz_list_append(), RZ_LOG_ERROR, and rz_sign_flirt_node_free().
Referenced by rz_sign_flirt_node_new().
|
static |
Definition at line 29 of file create.c.
References flirt_function_sanitize_name(), NULL, PFMT64x, RZ_FLIRT_NAME_MAX, RZ_LOG_ERROR, RZ_LOG_WARN, RZ_NEW0, rz_strf, and starts_with_flag.
Referenced by flirt_module_new().
|
inlinestatic |
Definition at line 17 of file create.c.
References i, and RZ_FLIRT_NAME_MAX.
Referenced by flirt_function_new().
|
static |
Definition at line 63 of file create.c.
References rz_analysis_function_t::addr, fail, flirt_crc16(), flirt_function_new(), free(), i, mask, module_free(), rz_analysis_function_t::name, NULL, rz_flirt_tail_byte_t::offset, rz_analysis_function_linear_size(), rz_list_append(), rz_list_newf(), RZ_LOG_ERROR, RZ_MIN, RZ_NEW0, and rz_flirt_tail_byte_t::value.
Referenced by flirt_create_child_from_analysis().
bool flirt_node_optimize | ( | RzFlirtNode * | root | ) |
Definition at line 316 of file create.c.
References rz_list_iter_t::data, fail, flirt_compare_node(), flirt_node_shorten_and_insert(), NULL, root, rz_list_free(), rz_list_length(), rz_list_newf(), rz_list_sort(), RZ_LOG_ERROR, and rz_sign_flirt_node_free().
Referenced by rz_sign_flirt_node_new(), and rz_sign_flirt_parse_string_pattern_from_buffer().
|
static |
Definition at line 244 of file create.c.
References rz_flirt_node_t::child_list, rz_list_iter_t::data, flirt_compare_module(), flirt_compare_node(), flirt_create_child(), flirt_node_shorten_pattern(), i, rz_flirt_node_t::length, rz_flirt_node_t::module_list, rz_flirt_node_t::pattern_bytes, rz_flirt_node_t::pattern_mask, root, rz_list_append(), rz_list_join(), rz_list_sort(), RZ_LOG_ERROR, and rz_sign_flirt_node_free().
Referenced by flirt_node_optimize().
|
static |
Definition at line 232 of file create.c.
References from, rz_flirt_node_t::length, rz_flirt_node_t::pattern_bytes, rz_flirt_node_t::pattern_mask, ut64(), UT64_MAX, and rz_flirt_node_t::variant_mask.
Referenced by flirt_node_shorten_and_insert().
Definition at line 207 of file create.c.
References i, RZ_FLIRT_MAX_PRELUDE_SIZE, and RZ_MIN.
Referenced by rz_sign_flirt_node_new().
void module_free | ( | RzFlirtModule * | module | ) |
Definition at line 284 of file flirt.c.
References free(), and rz_list_free().
Referenced by flirt_create_child(), flirt_create_child_from_analysis(), and flirt_module_new().
RZ_API RZ_OWN RzFlirtNode* rz_sign_flirt_node_new | ( | RZ_NONNULL RzAnalysis * | analysis, |
ut32 | optimization | ||
) |
Generates the FLIRT signatures and returns an RzFlirtNode.
analysis | The RzAnalysis structure to derive the signatures. |
optimization | Optimization to apply after creation of the flatten nodes. |
Definition at line 355 of file create.c.
References rz_analysis_function_t::addr, fail, flirt_compare_node(), flirt_create_child_from_analysis(), flirt_node_optimize(), free(), i, is_valid_mask_prelude(), malloc(), mask, rz_analysis_function_t::name, NULL, PFMT64x, root, RZ_ANALYSIS_FCN_TYPE_FCN, RZ_ANALYSIS_FCN_TYPE_LOC, RZ_ANALYSIS_FCN_TYPE_SYM, rz_analysis_function_linear_size(), rz_analysis_mask(), RZ_FLIRT_NODE_OPTIMIZE_MAX, RZ_FLIRT_NODE_OPTIMIZE_NONE, RZ_FREE, rz_list_append(), rz_list_length(), rz_list_newf(), rz_list_sort(), RZ_LOG_ERROR, RZ_LOG_WARN, RZ_NEW0, rz_return_val_if_fail, rz_sign_flirt_node_free(), ST32_MAX, starts_with_flag, rz_analysis_function_t::type, and ut64().
Referenced by rz_core_flirt_create_file().