Rizin
unix-like reverse engineering framework and cli tools
|
#include <rz_util/rz_str_search.h>
#include <rz_util/rz_utf8.h>
#include <rz_util/rz_utf16.h>
#include <rz_util/rz_utf32.h>
#include <rz_util/rz_ebcdic.h>
Go to the source code of this file.
Classes | |
struct | UTF8StringInfo |
Enumerations | |
enum | FalsePositiveResult { SKIP_STRING , RETRY_ASCII , STRING_OK } |
Variables | |
static const ut8 | LATIN1_CLASS [256] |
static const ut8 | LATIN1 [49] |
enum FalsePositiveResult |
Definition at line 165 of file str_search.c.
References p, RZ_STRING_ENC_UTF16BE, RZ_STRING_ENC_UTF16LE, RZ_STRING_ENC_UTF32BE, and RZ_STRING_ENC_UTF32LE.
Referenced by process_one_string().
|
static |
Definition at line 85 of file str_search.c.
References UTF8StringInfo::num_ascii, UTF8StringInfo::num_ascii_extended, UTF8StringInfo::num_chars, rz_utf8_decode(), and cmd_descs_generate::str.
Referenced by reduce_false_positives().
Definition at line 346 of file str_search.c.
Referenced by rz_scan_strings_raw().
Definition at line 314 of file str_search.c.
References NULL, rz_utf8_decode(), and w.
Referenced by rz_scan_strings_raw().
Definition at line 330 of file str_search.c.
References NULL, rz_utf8_decode(), and w.
Referenced by rz_scan_strings_raw().
|
inlinestatic |
Definition at line 81 of file str_search.c.
Referenced by process_one_string(), and reduce_false_positives().
|
static |
Definition at line 206 of file str_search.c.
References RzDetectedString::addr, adjust_offset(), RzUtilStrScanOptions::buf_size, from, i, is_c_escape_sequence(), RzDetectedString::length, RzUtilStrScanOptions::min_str_length, NULL, r, reduce_false_positives(), RETRY_ASCII, RZ_NEW0, rz_return_val_if_fail, rz_rune_is_printable(), rz_str_ebcdic_es_to_unicode(), rz_str_ebcdic_uk_to_unicode(), rz_str_ebcdic_us_to_unicode(), rz_str_ibm037_to_unicode(), rz_str_ibm290_to_unicode(), rz_str_ndup(), RZ_STRING_ENC_EBCDIC_ES, RZ_STRING_ENC_EBCDIC_UK, RZ_STRING_ENC_EBCDIC_US, RZ_STRING_ENC_GUESS, RZ_STRING_ENC_IBM037, RZ_STRING_ENC_IBM290, RZ_STRING_ENC_UTF16BE, RZ_STRING_ENC_UTF16LE, RZ_STRING_ENC_UTF32BE, RZ_STRING_ENC_UTF32LE, RZ_STRING_ENC_UTF8, rz_utf16be_decode(), rz_utf16le_decode(), rz_utf32be_decode(), rz_utf32le_decode(), rz_utf8_decode(), rz_utf8_encode(), RzDetectedString::size, SKIP_STRING, RzDetectedString::string, to, RzDetectedString::type, and ut64().
Referenced by rz_scan_strings_raw().
|
static |
Definition at line 115 of file str_search.c.
References calculate_utf8_string_info(), RzUtilStrScanOptions::check_ascii_freq, free(), i, is_c_escape_sequence(), IS_PRINTABLE, RzUtilStrScanOptions::max_uni_blocks, NULL, UTF8StringInfo::num_ascii, UTF8StringInfo::num_ascii_extended, UTF8StringInfo::num_chars, RETRY_ASCII, RZ_STRING_ENC_8BIT, RZ_STRING_ENC_UTF16BE, RZ_STRING_ENC_UTF16LE, RZ_STRING_ENC_UTF32BE, RZ_STRING_ENC_UTF32LE, RZ_STRING_ENC_UTF8, rz_utf_block_list(), SKIP_STRING, cmd_descs_generate::str, and STRING_OK.
Referenced by process_one_string().
RZ_API void rz_detected_string_free | ( | RzDetectedString * | str | ) |
Free a RzDetectedString
Definition at line 73 of file str_search.c.
References free(), and cmd_descs_generate::str.
Referenced by rz_scan_strings_raw(), and to_bin_string().
RZ_API int rz_scan_strings | ( | RZ_NONNULL RzBuffer * | buf_to_scan, |
RZ_NONNULL RzList * | list, | ||
RZ_NONNULL const RzUtilStrScanOptions * | opt, | ||
const ut64 | from, | ||
const ut64 | to, | ||
RzStrEnc | type | ||
) |
Look for strings in an RzBuffer.
buf_to_scan | Pointer to a RzBuffer to scan |
list | Pointer to a list that will be populated with the found strings |
opt | Pointer to a RzUtilStrScanOptions that specifies search parameters |
from | Minimum address to scan |
to | Maximum address to scan |
type | Type of strings to search |
Used to look for strings in a give RzBuffer. The function can also automatically detect string types.
Definition at line 525 of file str_search.c.
References calloc(), count, free(), from, len, list(), PFMT64x, rz_buf_read_at(), RZ_LOG_ERROR, rz_return_val_if_fail, rz_scan_strings_raw(), rz_str_enc_as_string(), RZ_STRING_ENC_BASE64, RZ_STRING_ENC_MUTF8, to, type, and ut64().
Referenced by meta_string_guess_add().
RZ_API int rz_scan_strings_raw | ( | RZ_NONNULL const ut8 * | buf, |
RZ_NONNULL RzList * | list, | ||
RZ_NONNULL const RzUtilStrScanOptions * | opt, | ||
const ut64 | from, | ||
const ut64 | to, | ||
RzStrEnc | type | ||
) |
Look for strings in an RzBuffer.
buf | Pointer to a raw buffer to scan |
list | Pointer to a list that will be populated with the found strings |
opt | Pointer to a RzUtilStrScanOptions that specifies search parameters |
from | Minimum address to scan |
to | Maximum address to scan |
type | Type of strings to search |
Used to look for strings in a give RzBuffer. The function can also automatically detect string types.
Definition at line 362 of file str_search.c.
References calloc(), can_be_ebcdic(), can_be_utf16_be(), can_be_utf16_le(), can_be_utf32_be(), can_be_utf32_le(), count, free(), from, i, list(), NULL, PFMT64x, process_one_string(), rz_detected_string_free(), rz_list_append(), RZ_LOG_ERROR, RZ_MIN, rz_return_val_if_fail, rz_rune_is_printable(), rz_str_ibm037_to_unicode(), RZ_STRING_ENC_8BIT, RZ_STRING_ENC_GUESS, RZ_STRING_ENC_IBM037, RZ_STRING_ENC_UTF16BE, RZ_STRING_ENC_UTF16LE, RZ_STRING_ENC_UTF32BE, RZ_STRING_ENC_UTF32LE, RZ_STRING_ENC_UTF8, rz_utf8_decode(), s, score(), RzDetectedString::size, to, type, and ut64().
Referenced by rz_scan_strings(), and string_scan_range().
Definition at line 49 of file str_search.c.
References assert(), b1, b2, c1, c2, compute_index(), test_evm::end, i, LATIN1, LATIN1_CLASS, len, and src.
Referenced by rz_scan_strings_raw().
Definition at line 34 of file str_search.c.
Referenced by score().
Definition at line 23 of file str_search.c.
Referenced by score().