24 0,0,0,0,0,0,0,0, 0,1,1,0,0,1,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,
25 1,6,6,6,6,6,6,6, 6,6,6,6,6,6,6,6, 2,2,2,2,2,2,2,2, 2,2,6,6,6,6,6,6,
26 6,3,3,3,3,3,3,3, 3,3,3,3,3,3,3,3, 3,3,3,3,3,3,3,3, 3,3,3,6,6,6,6,6,
27 6,4,4,4,4,4,4,4, 4,4,4,4,4,4,4,4, 4,4,4,4,4,4,4,4, 4,4,4,6,6,6,6,0,
29 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,
30 1,6,6,6,6,6,6,6, 6,6,6,6,6,6,6,6, 6,6,6,6,6,6,6,6, 6,6,6,6,6,6,6,6,
31 5,5,5,5,5,5,5,5, 5,5,5,5,5,5,5,5, 5,5,5,5,5,5,5,5, 5,5,5,5,5,5,5,6,
32 5,5,5,5,5,5,5,5, 5,5,5,5,5,5,5,5, 5,5,5,5,5,5,5,6, 5,5,5,5,5,5,5,5,
82 return strchr(
"\b\v\f\n\r\t\a\033\\", ch);
88 .num_ascii_extended = 0,
95 while (str_ptr < str_end) {
119 for (
int i = 0;
i <
size;
i++) {
137 for (
int i = 0; block_list[
i] != -1;
i++) {
148 int expected_ascii = num_blocks ? str_info.
num_chars / num_blocks : 0;
169 const ut8 *
p =
buf + str_start - 2;
170 if (
p[0] == 0xff &&
p[1] == 0xfe) {
177 const ut8 *
p =
buf + str_start - 2;
178 if (
p[0] == 0xfe &&
p[1] == 0xff) {
185 const ut8 *
p =
buf + str_start - 4;
186 if (
p[0] == 0xff &&
p[1] == 0xfe && !
p[2] && !
p[3]) {
193 const ut8 *
p =
buf + str_start - 4;
194 if (!
p[0] && !
p[1] &&
p[2] == 0xfe &&
p[3] == 0xff) {
211 ut64 str_addr = needle;
212 int rc = 0,
i = 0, runes = 0;
256 if (!rc || (ascii_only &&
r > 0x7f)) {
300 ds->
size = needle - str_addr;
316 if (!rc || (
size - rc) < 5) {
319 char *
w = (
char *)
buf + rc;
320 return !
w[0] &&
w[1] && !
w[2] &&
w[3] && !
w[4];
332 if (!rc || (
size - rc) < 5) {
335 char *
w = (
char *)
buf + rc;
336 return !
w[0] && !
w[1] && !
w[2] &&
w[3] && !
w[4];
347 return buf[0] < 0x20 ||
buf[0] > 0x3f;
386 while (needle <
to) {
403 ut64 needle_offset = 0;
405 if (!ds_le && !ds_be) {
410 needle_offset = ds_le->
size + 3;
413 needle_offset = ds_be->
size;
414 }
else if (!opt->prefer_big_endian) {
417 needle_offset = ds_le->
size + 3;
421 needle_offset = ds_le->
size;
425 needle += needle_offset;
439 ut64 needle_offset = 0;
441 if (!ds_le && !ds_be) {
446 needle_offset = ds_le->
size + 1;
449 needle_offset = ds_be->
size;
450 }
else if (!opt->prefer_big_endian) {
453 needle_offset = ds_le->
size + 1;
457 needle_offset = ds_le->
size;
461 needle += needle_offset;
471 for (;
i < sz;
i++) {
lsl lsr asr ror lsl lsr asr ror lsl lsl lsr asr ror lsl lsr asr ror lsl lsr asr ror lsl lsr asr ror lsl lsr asr ror lsl lsr asr ror lsl lsr asr ror lsl lsr asr ror lsl lsr asr ror lsl lsr asr ror c1
lsl lsr asr ror lsl lsr asr ror lsl lsl lsr asr ror lsl lsr asr ror lsl lsr asr ror lsl lsr asr ror lsl lsr asr ror lsl lsr asr ror lsl lsr asr ror lsl lsr asr ror lsl lsr asr ror lsl lsr asr ror c2
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void count
RZ_API void Ht_() free(HtName_(Ht) *ht)
static void list(RzEgg *egg)
RZ_API RZ_BORROW RzListIter * rz_list_append(RZ_NONNULL RzList *list, void *data)
Appends at the end of the list a new element.
void * calloc(size_t number, size_t size)
assert(limit<=UINT32_MAX/2)
#define rz_return_val_if_fail(expr, val)
RZ_API st64 rz_buf_read_at(RZ_NONNULL RzBuffer *b, ut64 addr, RZ_NONNULL RZ_OUT ut8 *buf, ut64 len)
Read len bytes of the buffer at the specified address.
RZ_API int rz_str_ibm037_to_unicode(const ut8 src, RZ_NONNULL RZ_OUT RzRune *dst)
Convert an ibm037 char into an unicode RzRune.
RZ_API int rz_str_ibm290_to_unicode(const ut8 src, RZ_NONNULL RZ_OUT RzRune *dst)
Convert an ibm290 char into an unicode RzRune.
RZ_API int rz_str_ebcdic_es_to_unicode(const ut8 src, RZ_NONNULL RZ_OUT RzRune *dst)
Convert an ebcdic_es char into an unicode RzRune.
RZ_API int rz_str_ebcdic_us_to_unicode(const ut8 src, RZ_NONNULL RZ_OUT RzRune *dst)
Convert an ebcdic_us char into an unicode RzRune.
RZ_API int rz_str_ebcdic_uk_to_unicode(const ut8 src, RZ_NONNULL RZ_OUT RzRune *dst)
Convert an ebcdic_uk char into an unicode RzRune.
#define RZ_LOG_ERROR(fmtstr,...)
RZ_API char * rz_str_ndup(RZ_NULLABLE const char *ptr, int len)
Create new copy of string ptr limited to size len.
RZ_API const char * rz_str_enc_as_string(RzStrEnc enc)
@ RZ_STRING_ENC_EBCDIC_US
@ RZ_STRING_ENC_EBCDIC_UK
@ RZ_STRING_ENC_EBCDIC_ES
RZ_API int rz_utf16le_decode(const ut8 *ptr, int ptrlen, RzRune *ch)
RZ_API int rz_utf16be_decode(const ut8 *ptr, int ptrlen, RzRune *ch)
RZ_API int rz_utf32le_decode(const ut8 *ptr, int ptrlen, RzRune *ch)
RZ_API int rz_utf32be_decode(const ut8 *ptr, int ptrlen, RzRune *ch)
RZ_API int * rz_utf_block_list(const ut8 *str, int len, int **freq_list)
RZ_API int rz_utf8_decode(const ut8 *ptr, int ptrlen, RzRune *ch)
RZ_API bool rz_rune_is_printable(const RzRune c)
Returns true when the RzRune is a printable symbol.
RZ_API int rz_utf8_encode(ut8 *ptr, const RzRune ch)
static struct sockaddr static addrlen static backlog const void static flags void struct sockaddr from
static struct sockaddr static addrlen static backlog const void static flags void struct sockaddr socklen_t static fromlen const void const struct sockaddr to
static const ut8 LATIN1[49]
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.
static int compute_index(ut8 x, ut8 y)
static UTF8StringInfo calculate_utf8_string_info(ut8 *str, int size)
static const ut8 LATIN1_CLASS[256]
static bool can_be_utf16_le(const ut8 *buf, ut64 size)
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.
RZ_API void rz_detected_string_free(RzDetectedString *str)
static bool can_be_utf16_be(const ut8 *buf, ut64 size)
static RzDetectedString * process_one_string(const ut8 *buf, const ut64 from, ut64 needle, const ut64 to, RzStrEnc str_type, bool ascii_only, const RzUtilStrScanOptions *opt, ut8 *strbuf)
static FalsePositiveResult reduce_false_positives(const RzUtilStrScanOptions *opt, ut8 *str, int size, RzStrEnc str_type)
static st64 score(RzRune *buff, const int len)
static bool is_c_escape_sequence(char ch)
static ut64 adjust_offset(RzStrEnc str_type, const ut8 *buf, const ut64 str_start)
static bool can_be_ebcdic(const ut8 *buf, ut64 size)
static bool can_be_utf32_be(const ut8 *buf, ut64 size)
static bool can_be_utf32_le(const ut8 *buf, ut64 size)
RzStrEnc type
String type.
ut32 length
Length of string in chars.
char * string
Pointer to the string.
ut64 addr
Address of the string in the RzBuffer.
ut32 size
Size of buffer containing the string in bytes.
size_t min_str_length
Minimum string length.
size_t max_uni_blocks
Maximum number of unicode blocks.
bool check_ascii_freq
If true, perform check on ASCII frequencies when looking for false positives.
size_t buf_size
Maximum size of a detected string.
ut64(WINAPI *w32_GetEnabledXStateFeatures)()