Rizin
unix-like reverse engineering framework and cli tools
|
Go to the source code of this file.
Classes | |
struct | basefind_addresses_t |
struct | basefind_data_t |
struct | basefind_thread_data_t |
struct | basefind_ui_info_t |
Typedefs | |
typedef struct basefind_addresses_t | BaseFindArray |
typedef struct basefind_data_t | BaseFindData |
typedef struct basefind_thread_data_t | BaseFindThreadData |
typedef struct basefind_ui_info_t | BaseFindUIInfo |
typedef struct basefind_addresses_t BaseFindArray |
typedef struct basefind_data_t BaseFindData |
typedef struct basefind_thread_data_t BaseFindThreadData |
typedef struct basefind_ui_info_t BaseFindUIInfo |
|
static |
Definition at line 91 of file basefind.c.
References free(), and basefind_addresses_t::ptr.
Referenced by basefind_create_array_of_addresses(), and rz_basefind().
|
static |
Definition at line 99 of file basefind.c.
References i, basefind_addresses_t::ptr, basefind_addresses_t::size, and value.
Referenced by basefind_pointer_map_iter().
|
static |
Definition at line 109 of file basefind.c.
References basefind_array_free(), basefind_new_bin_file(), rz_core_t::bin, rz_bin_file_t::buf, error(), rz_bin_file_t::file, free(), i, NULL, rz_bin_string_t::paddr, PFMT64x, basefind_addresses_t::ptr, rz_bin_cur(), rz_bin_file_strings(), rz_buf_free(), rz_list_free(), rz_list_length(), RZ_LOG_ERROR, RZ_LOG_INFO, RZ_LOG_VERBOSE, RZ_NEW0, RZ_NEWS0, basefind_addresses_t::size, rz_bin_string_t::string, strings(), and ut64().
Referenced by rz_basefind().
Definition at line 164 of file basefind.c.
References rz_core_t::config, rz_core_t::io, map(), NULL, pos, rz_config_get_b(), rz_io_pread_at(), rz_io_size(), RZ_LOG_ERROR, RZ_LOG_INFO, rz_read_ble32(), rz_read_ble64(), rz_return_val_if_fail, ut64(), and value.
Referenced by rz_basefind().
Definition at line 60 of file basefind.c.
References rz_core_t::bin, rz_bin_file_t::buf, desc, rz_core_file_t::fd, rz_bin_file_t::file, rz_core_t::file, free(), rz_core_t::io, rz_bin_t::iob, NULL, rz_bin_file_t::rbin, rz_buf_new_with_io_fd(), rz_io_desc_get(), rz_io_desc_size(), RZ_LOG_ERROR, RZ_NEW0, rz_bin_file_t::size, strdup(), and UT64_MAX.
Referenced by basefind_create_array_of_addresses().
|
static |
Definition at line 189 of file basefind.c.
References basefind_array_has(), rz_cons_is_breaked(), start, and ut64().
Referenced by basefind_thread_runner().
|
static |
|
static |
Definition at line 262 of file basefind.c.
References basefind_thread_data_t::base_end, basefind_thread_data_t::base_start, rz_basefind_info_t::begin_address, basefind_thread_data_t::current, rz_basefind_info_t::current_address, rz_basefind_info_t::end_address, rz_basefind_info_t::percentage, percentage, and rz_basefind_info_t::thread_idx.
Referenced by basefind_thread_ui(), and rz_basefind().
|
static |
Definition at line 48 of file basefind.c.
References i, basefind_thread_data_t::loop, rz_atomic_bool_set(), rz_th_get_user(), rz_th_pool_get_thread(), and rz_th_pool_size().
Referenced by basefind_thread_ui(), and rz_basefind().
|
static |
Definition at line 217 of file basefind.c.
References basefind_thread_data_t::alignment, basefind_thread_data_t::array, basefind_thread_data_t::base_start, basefind_pointer_map_iter(), rz_basefind_t::candidate, basefind_thread_data_t::current, free(), basefind_thread_data_t::io_size, basefind_thread_data_t::lock, basefind_thread_data_t::loop, loop, NULL, PFMT64x, basefind_thread_data_t::pointers, rz_atomic_bool_get(), rz_list_append(), RZ_LOG_DEBUG, RZ_LOG_ERROR, RZ_NEW0, rz_th_lock_enter(), rz_th_lock_leave(), rz_basefind_t::score, basefind_thread_data_t::score_min, basefind_thread_data_t::scores, and ut64().
Referenced by create_thread_interval().
|
static |
Definition at line 277 of file basefind.c.
References basefind_set_thread_info(), basefind_stop_all_search_threads(), basefind_ui_info_t::callback, test_evm::end, i, basefind_ui_info_t::loop, loop, rz_basefind_info_t::n_threads, NULL, basefind_ui_info_t::pool, rz_atomic_bool_get(), rz_sys_usleep(), rz_th_get_user(), rz_th_pool_get_thread(), rz_th_pool_size(), and basefind_ui_info_t::user.
Referenced by rz_basefind().
|
inlinestatic |
Definition at line 305 of file basefind.c.
References basefind_thread_runner(), RZ_LOG_ERROR, rz_th_free(), rz_th_new(), and rz_th_pool_add_thread().
Referenced by rz_basefind().
RZ_API RZ_OWN RzList* rz_basefind | ( | RZ_NONNULL RzCore * | core, |
RZ_NONNULL RzBaseFindOpt * | options | ||
) |
Calculates a list of possible base addresses candidates using the strings position.
The code finds all the strings in memory with a minimum acceptable size (via opt.min_string_len) and calculates all possible words 32 or 64 bit large sizes (endianness via cfg.bigendian) in the given binary. These addresses are then compared with the strings and a variable base address which is increased over time by opt.alignment.
The scores are added to the result list with the associated base address if their score are higher than opt.min_score, otherwise they are ignored.
It is possible via opt.callback to set a callback function that can stop the search (when returning false) or display the thread statuses (the callback will be called N-times for N spawned threads.
core | RzCore struct to use. |
options | Pointer to the RzBaseFindOpt structure. |
Definition at line 336 of file basefind.c.
References basefind_thread_data_t::alignment, basefind_thread_data_t::array, basefind_thread_data_t::base_end, basefind_thread_data_t::base_start, basefind_array_free(), basefind_create_array_of_addresses(), basefind_create_pointer_map(), basefind_score_compare(), basefind_set_thread_info(), basefind_stop_all_search_threads(), basefind_thread_ui(), basefind_ui_info_t::callback, create_thread_interval(), basefind_thread_data_t::current, free(), i, basefind_thread_data_t::io_size, basefind_thread_data_t::lock, lock(), basefind_thread_data_t::loop, basefind_ui_info_t::loop, rz_basefind_info_t::n_threads, NULL, options, basefind_thread_data_t::pointers, basefind_ui_info_t::pool, rz_atomic_bool_free(), rz_atomic_bool_new(), rz_atomic_bool_set(), RZ_BASEFIND_BASE_ALIGNMENT, rz_io_size(), rz_list_newf(), rz_list_sort(), RZ_LOG_ERROR, RZ_LOG_VERBOSE, RZ_LOG_WARN, RZ_NEW, rz_return_val_if_fail, rz_th_free(), rz_th_get_user(), rz_th_lock_free(), rz_th_lock_new(), rz_th_new(), rz_th_pool_free(), rz_th_pool_get_thread(), rz_th_pool_new(), rz_th_pool_size(), rz_th_pool_wait(), rz_th_wait(), basefind_thread_data_t::score_min, basefind_thread_data_t::scores, basefind_ui_info_t::user, and ut64().
Referenced by rz_core_bin_basefind_print().