10 #include "../core_private.h"
14 #define USE_EMULATION 0
16 #define AES_SEARCH_LENGTH 40
17 #define PRIVATE_KEY_SEARCH_LENGTH 11
20 "/E",
" [esil-expr]",
"search offsets matching a specific esil expression",
21 "/Ej",
" [esil-expr]",
"same as above but using the given magic file",
22 "/E?",
" ",
"show this help",
23 "\nExamples:",
"",
"",
24 "",
"/E $$,0x100001060,-,!",
"hit when address is 0x100001060",
29 "/m",
"",
"search for known magic patterns",
30 "/m",
" [file]",
"same as above but using the given magic file",
31 "/mb",
"",
"search recognized RzBin headers",
36 "Usage:",
"/[!bf] [arg]",
"Search stuff (see 'e??search' for options)\n"
37 "|Use io.va for searching in non virtual addressing spaces",
38 "/",
" foo\\x00",
"search for string 'foo\\0'",
39 "/j",
" foo\\x00",
"search for string 'foo\\0' (json output)",
40 "/!",
" ff",
"search for first occurrence not matching, command modifier",
41 "/!x",
" 00",
"inverse hexa search (find first byte != 0x00)",
42 "/+",
" /bin/sh",
"construct the string with chunks",
43 "//",
"",
"repeat last search",
44 "/a",
"[?][1aoditfmsltf] jmp eax",
"assemble opcode and search its bytes",
45 "/b",
"",
"search backwards, command modifier, followed by other command",
46 "/c",
"[?][adr]",
"search for crypto materials",
47 "/d",
" 101112",
"search for a deltified sequence of bytes",
48 "/e",
" /E.F/i",
"match regular expression",
49 "/E",
" esil-expr",
"offset matching given esil expressions $$ = here",
50 "/f",
"",
"search forwards, (command modifier)",
51 "/F",
" file [off] [sz]",
"search contents of file with offset and size",
53 "/g",
"[g] [from]",
"find all graph paths A to B (/gg follow jumps, see search.count and analysis.depth)",
54 "/h",
"[t] [hash] [len]",
"find block matching this hash. See ph",
55 "/i",
" foo",
"search for string 'foo' ignoring case",
56 "/m",
"[?][ebm] magicfile",
"search for magic, filesystems or binary headers",
57 "/o",
" [n]",
"show offset of n instructions backward",
58 "/O",
" [n]",
"same as /o, but with a different fallback if analysis cannot be used",
59 "/p",
" patternsize",
"search for pattern of given size",
60 "/P",
" patternsize",
"search similar blocks",
61 "/s",
"[*] [threshold]",
"find sections by grouping blocks with similar entropy",
62 "/r[rwx]",
"[?] sym.printf",
"analyze opcode reference an offset",
63 "/R",
" [grepopcode]",
"search for matching ROP gadgets, semicolon-separated",
65 "/v",
"[1248] value",
"look for an `cfg.bigendian` 32bit value",
66 "/V",
"[1248] min max",
"look for an `cfg.bigendian` 32bit value in range",
67 "/w",
" foo",
"search for wide string 'f\\0o\\0o\\0'",
68 "/wi",
" foo",
"search for wide string ignoring case 'f\\0o\\0o\\0'",
69 "/x",
" ff..33",
"search for hex string ignoring some nibbles",
70 "/x",
" ff0033",
"search for hex string",
71 "/x",
" ff43:ffd0",
"search for hexpair with mask",
72 "/z",
" min max",
"search for strings of given size",
73 "/*",
" [comment string]",
"add multiline comment, end it with '*/'",
75 "\nConfiguration:",
"",
" (type `e??search.` for a complete list)",
76 "e",
" cmd.hit = x",
"command to execute on every search hit",
77 "e",
" search.in = ?",
"specify where to search stuff (depends on .from/.to)",
78 "e",
" search.align = 4",
"only catch aligned search hits",
79 "e",
" search.from = 0",
"start address",
80 "e",
" search.to = 0",
"end address",
81 "e",
" search.flags = true",
"if enabled store flags on keyword hits",
87 "Usage:",
"/a[?] [arg]",
"Search for assembly instructions matching given properties",
88 "/a",
" push rbp",
"Assemble given instruction and search the bytes",
89 "/a1",
" [number]",
"Find valid assembly generated by changing only the nth byte",
90 "/aI",
"",
"Search for infinite loop instructions (jmp $$)",
91 "/aa",
" mov eax",
"Linearly find aproximated assembly (case insensitive strstr)",
92 "/ac",
" mov eax",
"Same as /aa, but case-sensitive",
93 "/ad",
"[/*j] push;mov",
"Match ins1 followed by ins2 in linear disasm",
94 "/ad/",
" ins1;ins2",
"Search for regex instruction 'ins1' followed by regex 'ins2'",
95 "/ad/a",
" instr",
"Search for every byte instruction that matches regexp 'instr'",
96 "/ae",
" esil",
"Search for esil expressions matching substring",
97 "/af",
"[l] family",
"Search for instruction of specific family (afl=list",
98 "/ai",
"[j] 0x300 [0x500]",
"Find all the instructions using that immediate (in range)",
99 "/al",
"",
"Same as aoml, list all opcodes",
100 "/am",
" opcode",
"Search for specific instructions of specific mnemonic",
101 "/ao",
" instr",
"Search for instruction 'instr' (in all offsets)",
102 "/as",
"[l] ([type])",
"Search for syscalls (See /at swi and /af priv)",
103 "/at",
"[l] ([type])",
"Search for instructions of given type",
108 "Usage: /c",
"",
"Search for crypto materials",
109 "/ca",
"",
"Search for AES keys expanded in memory",
110 "/cc",
"[algo] [digest]",
"Find collisions (bruteforce block length values until given checksum is found)",
111 "/cd",
"",
"Search for ASN1/DER certificates",
112 "/cr",
"",
"Search for ASN1/DER private keys (RSA and ECC)",
117 "Usage:",
"/r[acerwx] [address]",
" search references to this specific address",
118 "/r",
" [addr]",
"search references to this specific address",
119 "/ra",
"",
"search all references",
120 "/rc",
"",
"search for call references",
121 "/rr",
"",
"Find read references",
122 "/rw",
"",
"Find write references",
123 "/rx",
"",
"Find exec references",
128 "Usage: /R",
"",
"Search for ROP gadgets",
129 "/R",
" [filter-by-string]",
"Show gadgets",
130 "/R/",
" [filter-by-regexp]",
"Show gadgets [regular expression]",
131 "/R/j",
" [filter-by-regexp]",
"JSON output [regular expression]",
132 "/R/q",
" [filter-by-regexp]",
"Show gadgets in a quiet manner [regular expression]",
133 "/Rj",
" [filter-by-string]",
"JSON output",
134 "/Rk",
" [select-by-class]",
"Query stored ROP gadgets",
135 "/Rq",
" [filter-by-string]",
"Show gadgets in a quiet manner",
140 "Usage: /Rk",
"",
"Query stored ROP gadgets",
141 "/Rk",
" [nop|mov|const|arithm|arithm_ct]",
"Show gadgets",
142 "/Rkj",
"",
"JSON output",
143 "/Rkq",
"",
"List Gadgets offsets",
148 "Usage:",
"/x [hexpairs]:[binmask]",
"Search in memory",
149 "/x ",
"9090cd80",
"search for those bytes",
150 "/x ",
"9090cd80:ffff7ff0",
"search with binary mask",
182 if (!minlen || minlen ==
UT32_MAX) {
190 for (j = minlen; j <=
maxlen; j++) {
192 eprintf(
"Searching %s for %d byte length.\n", hashname, j);
226 if (!strcmp(
s, hashstr)) {
229 hashname, hashstr,
from +
i);
263 .pluginname = plug->
name,
334 int keyword_length = 0;
350 keyword =
malloc(strlen(prelude) + 1);
352 RZ_LOG_ERROR(
"aap: cannot allocate 'analysis.prelude' buffer\n");
359 if (!arch_preludes) {
371 if (keyword && keyword_length > 0) {
374 rz_list_foreach (arch_preludes, iter2, kw) {
394 for (
i = 0,
r = res;
i < l;
b++,
i++) {
412 int len,
i, extra, mallocsize;
415 const char *
type =
"hexpair";
424 char *pre, *
pos, *wrd;
425 const int len = keyword_len;
452 mallocsize = (
len * 2) + extra;
472 eprintf(
"Cannot allocate %d\n", mallocsize);
496 pj_ki(param->
pj,
"len", keyword_len);
528 at,
n, (
c % 2) ?
"[ #]" :
"[# ]");
531 at,
to,
n, (
c % 2) ?
"[ #]" :
"[# ]");
540 if (io && io->
desc) {
547 eprintf(
"Warning: Invalid range. Use different search.in=? or analysis.in=dbg.maps.x\n");
570 return ((perm & 7) !=
mask);
589 snprintf(bound_from,
sizeof(bound_from),
"%s.%s",
prefix,
"from");
593 const RzInterval search_itv = { search_from, search_to - search_from };
599 }
else if (!strcmp(
mode,
"file")) {
601 }
else if (!strcmp(
mode,
"block")) {
603 }
else if (!strcmp(
mode,
"io.map")) {
608 }
else if (!strcmp(
mode,
"io.maps")) {
611 #define USE_SKYLINE 0
621 int rwx =
m ?
m->perm : part->map->perm;
642 begin,
end - begin, rwx);
652 int len = strlen(
"io.maps.");
669 int len = strlen(
"io.sky.");
671 bool only = (
bool)(
size_t)strstr(
mode,
".only");
705 int len = strlen(
"bin.segments.");
707 bool only = (
bool)(
size_t)strstr(
mode,
".only");
713 if (!
s->is_segment) {
761 int len = strlen(
"bin.sections.");
763 bool only = (
bool)(
size_t)strstr(
mode,
".only");
780 }
else if (!strcmp(
mode,
"bin.segment")) {
786 if (!
s->is_segment) {
796 }
else if (!strcmp(
mode,
"bin.section")) {
812 }
else if (!strcmp(
mode,
"analysis.fcn") || !strcmp(
mode,
"analysis.bb")) {
819 if (!strcmp(
mode,
"analysis.bb")) {
823 rz_list_foreach (
f->bbs,
iter, bb) {
834 eprintf(
"WARNING: search.in = ( analysis.bb | analysis.fcn )"
835 "requires to seek into a valid function\n");
838 }
else if (!strncmp(
mode,
"dbg.", 4)) {
851 if (!strcmp(
mode,
"dbg.map")) {
856 if (
from >=
map->addr && from < map->addr_end) {
877 if (!strcmp(
mode,
"dbg.program")) {
880 }
else if (!strcmp(
mode,
"dbg.maps")) {
884 only = (
bool)(
size_t)strstr(
mode,
".only");
885 }
else if (!strcmp(
mode,
"dbg.heap")) {
887 }
else if (!strcmp(
mode,
"dbg.stack")) {
897 add = (
stack && strstr(
map->name,
"stack")) ? 1 : 0;
984 HtUU *ht = (HtUU *)user;
985 ht_uu_insert(ht,
k,
v);
995 char *grep_str =
NULL;
1004 HtUUOptions opt = { 0 };
1005 HtUU *localbadstart = ht_uu_new_opt(&opt);
1010 end = strchr(grep,
';');
1030 while (nb_instr < max_instr) {
1031 ht_uu_insert(localbadstart,
idx, 1);
1039 const int opsz = aop.
size;
1071 search_hit = (
end && grep && (grep_find < 1));
1073 search_hit = (
end && grep && strstr(opst, grep_str));
1078 if (
end[0] ==
';') {
1094 if (endaddr <= (
idx - opsz)) {
1106 ht_uu_free(localbadstart);
1111 ht_uu_free(localbadstart);
1114 ht_uu_foreach(localbadstart,
insert_into, badstart);
1115 ht_uu_free(localbadstart);
1117 if (branch_delay &&
rz_list_length(hitlist) < (1 + branch_delay)) {
1128 unsigned int size = 0;
1141 eprintf(
"Error: Could not create SDB 'rop' namespace\n");
1151 rz_list_foreach (hitlist,
iter,
hit) {
1191 ((RzCoreAsmHit *)hitlist->
head->
data)->addr);
1192 rz_list_foreach (hitlist,
iter,
hit) {
1205 }
else if (colorize) {
1225 rz_list_foreach (hitlist,
iter,
hit) {
1228 eprintf(
"Invalid hit length here\n");
1289 int i = 0,
end = 0,
mode = 0, increment = 1, ret, result =
true;
1294 char *tok, *gregexp =
NULL;
1295 char *grep_arg =
NULL;
1304 if (!(gadgetSdb =
sdb_ns(
core->
sdb,
"gadget_sdb",
false))) {
1311 if (max_instr <= 1) {
1313 eprintf(
"ROP length (rop.len) must be greater than 1.\n");
1314 if (max_instr == 1) {
1315 eprintf(
"For rop.len = 1, use /c to search for single "
1316 "instructions. See /c? for help.\n");
1321 if (!strcmp(
arch,
"mips")) {
1323 }
else if (!strcmp(
arch,
"arm")) {
1325 }
else if (!strcmp(
arch,
"avr")) {
1330 grep_arg = strchr(grep,
' ');
1333 mode = *(grep_arg - 1);
1340 grep_arg =
strdup(grep_arg);
1346 for (++grep; *grep ==
' '; grep++) {
1354 if (grep && regexp) {
1359 tok = strtok(gregexp,
";");
1363 tok = strtok(
NULL,
";");
1372 HtUUOptions opt = { 0 };
1373 HtUU *badstart = ht_uu_new_opt(&opt);
1391 for (
i = 0;
i + 32 <
delta;
i += increment) {
1410 if (end_gadget.
delay) {
1429 if (!rz_list_empty(end_list)) {
1430 int prev, next, ropdepth;
1431 const int max_inst_size_x86 = 15;
1435 ropdepth = increment == 1 ? max_instr * max_inst_size_x86 : max_instr * increment;
1443 for (
i = next - ropdepth;
i < (
delta - max_inst_size_x86) &&
max_count;
i += increment) {
1444 if (increment == 1) {
1446 if (
i < prev - max_inst_size_x86) {
1447 i = prev - max_inst_size_x86;
1468 i = next - ropdepth;
1486 rx_list, end_gadget, badstart);
1490 if (align && (0 != ((
from +
i) % align))) {
1496 RzCoreAsmHit *
hit = (RzCoreAsmHit *)hitlist->
head->
data;
1503 rz_list_foreach (hitlist,
iter,
hit) {
1519 if ((
mode ==
'q') && subchain) {
1523 }
while (hitlist->
head->
n);
1535 if (increment != 1) {
1578 if (
input[0] !=
'E') {
1581 if (
input[1] ==
'j') {
1586 if (
input[1] !=
' ') {
1594 eprintf(
"Cannot initialize the ESIL vm\n");
1604 bool hit_happens =
false;
1605 size_t hit_combo = 0;
1650 hit_happens =
false;
1684 pj_kn(param->
pj,
"value", nres);
1688 if (hit_combo > hit_combo_limit) {
1689 eprintf(
"Hit search.esilcombo reached (%d). Stopping search. Use f-\n", hit_combo_limit);
1706 #define SUMARRAY(arr, size, res) \
1708 (res) += (arr)[--(size)]; \
1713 static int emulateSyscallPrelude(
RzCore *core,
ut64 at,
ut64 curpc) {
1718 const int minopcode =
RZ_MAX(1, mininstrsz);
1726 eprintf(
"Cannot allocate %d byte(s)\n", bsize);
1731 for (
i = 0; curpc < at; curpc++,
i++) {
1732 if (
i >= (bsize - 32)) {
1774 const int minopcode =
RZ_MAX(1, mininstrsz);
1791 eprintf(
"Cannot allocate %d byte(s)\n", bsize);
1812 eprintf(
"Error: from must be lower than to\n");
1816 eprintf(
"Error: Invalid destination boundary\n");
1819 for (
i = 0, at =
from; at <
to; at++,
i++) {
1823 if (
i >= (bsize - 32)) {
1826 if (align && (at % align)) {
1834 previnstr[curpos] = ret;
1837 if (strstr(es, esp)) {
1838 if (aop.
val != -1) {
1841 }
else if (esp32 && strstr(es, esp32)) {
1842 if (aop.
val != -1) {
1855 curpc = at - (
nbytes - previnstr[curpos]);
1856 scNumber = emulateSyscallPrelude(core, at, curpc);
1860 scVector = (aop.
val > 0) ? aop.
val : -1;
1905 const int size = 12;
1914 rz_list_foreach (
list,
iter, xref) {
1925 const char *nl = comment ? strchr(comment,
'\n') :
NULL;
1929 char *buf_fcn = comment
1933 if (from <= xref->
from &&
to >= xref->
from) {
1968 for (
i = 0;
i < 64;
i++) {
1975 if (!strcmp(
str,
"undefined")) {
2029 for (
i = 0, at =
from; at <
to;
i++, at++) {
2044 }
else if (
type ==
'f') {
2046 if (fam && (!*
input || !strcmp(
input, fam))) {
2052 bool isCandidate = !*
input;
2053 if (!strcmp(
input,
"cswi")) {
2063 if (strstr(
input,
"swi")) {
2064 if (*
input ==
'c') {
2082 pj_ki(param->
pj,
"size", ret);
2101 snprintf(flag,
sizeof(flag),
"%s%d_%d",
2134 double threshold = 1;
2135 bool r2mode =
false;
2137 if (*
input ==
'*') {
2140 sscanf(
input,
"%lf", &threshold);
2141 if (threshold < 1) {
2156 bool lastBlock =
true;
2170 double diff = oe -
e;
2173 if (diff > threshold) {
2189 if (begin !=
UT64_MAX && lastBlock) {
2208 bool regexp =
input[0] ==
'/';
2209 bool everyByte = regexp &&
input[1] ==
'a';
2210 char *end_cmd = strchr(
input,
' ');
2211 switch ((end_cmd ? *(end_cmd - 1) :
input[0])) {
2243 if (maxhits &&
count >= maxhits) {
2250 rz_list_foreach (hits,
iter,
hit) {
2254 if (cmdhit && *cmdhit) {
2349 const char *bytestr = lenstr > 1 ?
"bytes" :
"byte";
2356 rz_list_foreach (core->
search->
kws, it, kw) {
2365 for (at = from1; at != to1; at =
search->bckwrds ? at -
len : at +
len) {
2412 eprintf(
"No keywords defined\n");
2430 eprintf(
"Error: could not find SDB 'rop' namespace\n");
2445 pj_ka(pj,
"gadgets");
2451 char *
size = strtok(
dup,
" ");
2452 char *tok = strtok(
NULL,
"{}");
2461 pj_ks(pj,
"effect", tok);
2473 if (!strcmp(
input + 1,
"nop")) {
2479 }
else if (!strcmp(
input + 1,
"mov")) {
2485 }
else if (!strcmp(
input + 1,
"const")) {
2491 }
else if (!strcmp(
input + 1,
"arithm")) {
2497 }
else if (!strcmp(
input + 1,
"arithm_ct")) {
2504 eprintf(
"Invalid ROP class\n");
2519 for (
i = 0;
i <
len;
i++) {
2520 if (
a[
i] ==
b[
i] &&
a[
i] == 0x00) {
2522 }
else if (
a[
i] !=
b[
i]) {
2542 if (equal >=
count) {
2568 if (as && as->
cur && as->
cur->arch) {
2570 if (as->
cur->bits < 64) {
2600 if (cmdHit && *cmdHit) {
2617 eprintf(
"Cannot allocate %d byte(s)\n", bsize);
2622 for (
i = 0;
i <
len;
i++) {
2627 ptr = (
ut8 *)ptr +
sizeof(
ut8);
2632 ptr = (
ut8 *)ptr +
sizeof(
ut16);
2637 ptr = (
ut8 *)ptr +
sizeof(
ut32);
2643 ptr = (
ut8 *)ptr +
sizeof(
ut64);
2646 if (ptr > ptr + bsize) {
2752 if (hashLength >
sizeof(cmphash)) {
2753 eprintf(
"Hashlength mismatch %d %d\n", hashLength, (
int)
sizeof(cmphash));
2757 memcpy(cmphash, hashValue, hashLength);
2759 if (hashLength != 4) {
2760 eprintf(
"Invalid hash size %d (expected 4)\n", hashLength);
2772 if (now < (prev + 1000000)) {
2802 for (
i = 0;
i < bufsz;
i++) {
2812 for (
i = 0;
i < hashLength;
i++) {
2815 eprintf(
" (%d h/s) \r", mount);
2816 if (!memcmp(hashValue, digest, hashLength)) {
2817 eprintf(
"\nCOLLISION FOUND!\n");
2836 ut64 map_begin =
map->itv.addr;
2837 ut64 map_size =
map->itv.size;
2838 ut64 map_end = map_begin + map_size;
2844 for (at =
map->itv.addr; at + 24 < map_end; at += 1) {
2861 if (nth < 0 || nth >=
sizeof(
buf) - 1) {
2864 for (
i = 0;
i <= 0xff;
i++) {
2868 if (!strstr(asmstr,
"invalid") && !strstr(asmstr,
"unaligned")) {
2876 bool dosearch =
false;
2884 .aes_search =
false,
2885 .privkey_search =
false,
2891 int ignorecase =
false;
2892 int param_offset = 2;
2895 eprintf(
"Can't search if we don't have an open file.\n");
2899 eprintf(
"Can't search from within a search.\n");
2902 if (
input[0] ==
'/') {
2906 eprintf(
"No previous search done\n");
2915 rz_flag_space_push(
core->
flags,
"search");
2918 if (search_from > search_to && search_to) {
2919 eprintf(
"search.from > search.to is not supported\n");
2924 RzInterval search_itv = { search_from, search_to - search_from };
2925 bool empty_search_itv = search_from == search_to && search_from !=
UT64_MAX;
2926 if (empty_search_itv) {
2927 eprintf(
"WARNING from == to?\n");
2933 search_itv.
addr = 0;
2976 if (*(++
input) ==
'?') {
2977 eprintf(
"Usage: /b<command> [value] backward search, see '/?'\n");
2994 if (((
st64)
n) < 1) {
3022 if (
input[1] ==
'?') {
3024 }
else if (
input[1] ==
'/') {
3026 }
else if (
input[1] ==
'k') {
3027 if (
input[2] ==
'?') {
3068 }
while (*(
s = strchr(
s,
')') + 1) !=
'\0');
3082 eprintf(
"Cannot find null references.\n");
3130 if (
input[param_offset - 1] ==
' ') {
3149 if (
input[1] ==
'?') {
3151 }
else if (
input[1] ==
'd') {
3154 }
else if (
input[1] ==
'e') {
3157 }
else if (
input[1] ==
'c') {
3160 }
else if (
input[1] ==
'o') {
3163 }
else if (
input[1] ==
'a') {
3166 }
else if (
input[1] ==
'i') {
3168 }
else if (
input[1] ==
'1') {
3170 }
else if (
input[1] ==
'I') {
3172 }
else if (
input[1] ==
' ') {
3173 if (
input[param_offset - 1]) {
3186 }
else if (
input[1] ==
's') {
3187 if (
input[2] ==
'l') {
3203 char *space = strchr(
input,
' ');
3206 eprintf(
"Usage: /cc[aAdlpb] [hashname] [hexpairhashvalue]\n");
3207 eprintf(
" /cca - lowercase alphabet chars only\n");
3208 eprintf(
" /ccA - uppercase alphabet chars only\n");
3209 eprintf(
" /ccl - letters (lower + upper alphabet chars)\n");
3210 eprintf(
" /ccd - digits (only numbers)\n");
3211 eprintf(
" /ccp - printable (alpha + digit)\n");
3212 eprintf(
" /ccb - binary (any number is valid)\n");
3216 char *
sp = strchr(
s,
' ');
3232 if (hashLength > 0) {
3235 eprintf(
"Invalid expected hash hexpairs.\n");
3240 eprintf(
"Cannot allocate memory.\n");
3244 eprintf(
"Usage: /cc [hashname] [hexpairhashvalue]\n");
3245 eprintf(
"Usage: /CC to search ascii collisions\n");
3296 if (
input[1] ==
'?') {
3298 }
else if (
input[1] ==
'b') {
3330 if (maxHits && hits >= maxHits) {
3342 eprintf(
"Usage: /m [file]\n");
3348 if (
input[param_offset - 1]) {
3349 int ps = atoi(
input + param_offset);
3363 eprintf(
"Invalid pattern size (must be > 0)\n");
3370 if (
input[2] ==
'j') {
3373 }
else if (strchr(
input + 1,
'*')) {
3376 int err = 1, vsize = atoi(
input + 1);
3377 const char *num_str =
input + param_offset + 1;
3378 if (vsize &&
input[2] && num_str) {
3382 char *
w = strchr(num_str,
' ');
3406 eprintf(
"Usage: /V[1|2|4|8] [minval] [maxval]\n");
3413 if (
input[1] ==
'?') {
3414 rz_cons_print(
"Usage: /v[1|2|4|8] [value]\n");
3417 if (
input[2] ==
'j') {
3431 if (
input[param_offset]) {
3435 eprintf(
"Usage: /v8 value\n");
3439 if (
input[param_offset]) {
3440 bsize =
sizeof(
ut8) *
len;
3443 eprintf(
"Usage: /v1 value\n");
3447 if (
input[param_offset]) {
3451 eprintf(
"Usage: /v2 value\n");
3456 if (
input[param_offset - 1]) {
3457 if (
input[param_offset]) {
3462 eprintf(
"Usage: /v4 value\n");
3486 size_t shift = 1 + ignorecase;
3493 strstart =
shift + 1;
3496 for (p2 =
input + strstart,
p = inp; *p2;
p += 2, p2++) {
3510 skw->
icase = ignorecase;
3520 if (
input[param_offset - 1] !=
' ') {
3521 eprintf(
"Missing ' ' after /i\n");
3539 for (
i = 0;
i <
len;
i++) {
3552 skw->
icase = ignorecase;
3564 if (
input[1] ==
'?') {
3565 eprintf(
"Usage: /e /foo/i or /e/foo/i\n");
3566 }
else if (
input[1]) {
3570 eprintf(
"Invalid regexp specified\n");
3603 p = strchr(
arg,
' ');
3607 eprintf(
"Usage: /h md5 [hash] [datalen]\n");
3611 char *pmax, *pmin = strchr(
p,
' ');
3614 pmax = strchr(pmin,
' ');
3624 eprintf(
"Missing hash. See ph?\n");
3640 if (
input[1] ==
'?') {
3642 rz_cons_printf(
"(find all graph paths A to B (/gg follow jumps, see search.count and analysis.depth)");
3657 if (
input[1] !=
'\0') {
3663 if (
input[param_offset - 1] ==
' ') {
3711 eprintf(
"Usage: /F[j] [file]Â ([offset] ([sz]))\n");
3715 if (
input[1] ==
'?') {
3744 if (
input[1] ==
' ') {
3778 eprintf(
"Usage: /+ [string]\n");
3786 eprintf(
"Usage: /z min max\n");
3789 if ((
p = strchr(
input + 2,
' '))) {
3793 eprintf(
"Usage: /z min max\n");
3798 eprintf(
"Error: min must be lower than max\n");
3815 eprintf(
"See /? for help.\n");
static void print_comment(const aarch64_inst *inst, struct disassemble_info *info)
RZ_API RzAnalysisFunction * rz_analysis_get_function_at(RzAnalysis *analysis, ut64 addr)
RZ_API ut64 rz_analysis_function_size_from_entry(RzAnalysisFunction *fcn)
RZ_API RzList * rz_analysis_preludes(RzAnalysis *analysis)
RZ_API int rz_analysis_archinfo(RzAnalysis *analysis, int query)
static int analop(RzAnalysis *a, RzAnalysisOp *op, ut64 addr, const ut8 *buf, int len, RzAnalysisOpMask mask)
RZ_API void rz_asm_op_fini(RzAsmOp *op)
RZ_API char * rz_asm_op_get_hex(RzAsmOp *op)
RZ_API char * rz_asm_op_get_asm(RzAsmOp *op)
static RZ_NULLABLE RzILOpBitVector * shift(RzILOpBitVector *val, RZ_NULLABLE RzILOpBool **carry_out, arm_shifter type, RZ_OWN RzILOpBitVector *dist)
RZ_API RZ_OWN RzAsmParseParam * rz_asm_get_parse_param(RZ_NULLABLE const RzReg *reg, ut32 ana_op_type)
Does all kinds of NULL checks on the parameters and returns an initialized RzAsmParseParam or NULL on...
RZ_DEPRECATE RZ_API RZ_OWN RzStrBuf * rz_asm_colorize_asm_str(RZ_BORROW RzStrBuf *asm_str, RZ_BORROW RzPrint *p, RZ_NULLABLE const RzAsmParseParam *param, RZ_NULLABLE const RzAsmTokenString *toks)
Colors a given asm string and returns it. If toks is not NULL it uses the tokens to color the asm str...
RZ_API int rz_asm_set_pc(RzAsm *a, ut64 pc)
RZ_API int rz_asm_disassemble(RzAsm *a, RzAsmOp *op, const ut8 *buf, int len)
static int opstr(RzAsm *a, ut8 *data, const Opcode *op)
RZ_API RzBinObject * rz_bin_cur_object(RzBin *bin)
RZ_API RzBinPlugin * rz_bin_get_binplugin_by_buffer(RzBin *bin, RzBuffer *buf)
RZ_API RzBinFile * rz_bin_open_io(RzBin *bin, RzBinOptions *opt)
static RzList * maps(RzBinFile *bf)
const lzma_allocator const uint8_t size_t uint8_t * out
RZ_API int rz_search_pattern(RzSearch *s, ut64 from, ut64 to)
RZ_API ut64 rz_core_analysis_address(RzCore *core, ut64 addr)
RZ_API int rz_core_analysis_search(RzCore *core, ut64 from, ut64 to, ut64 ref, int mode)
RZ_API void rz_core_analysis_paths(RzCore *core, ut64 from, ut64 to, bool followCalls, int followDepth, bool is_json)
RZ_API int rz_core_analysis_fcn(RzCore *core, ut64 at, ut64 from, int reftype, int depth)
RZ_API int rz_core_search_value_in_range(RzCore *core, RzInterval search_itv, ut64 vmin, ut64 vmax, int vsize, inRangeCb cb, void *cb_user)
RZ_API char * rz_core_asm_search(RzCore *core, const char *input)
RZ_API ut32 rz_core_asm_bwdis_len(RzCore *core, int *instr_len, ut64 *start_addr, ut32 nb)
RZ_API RzList * rz_core_asm_strsearch(RzCore *core, const char *input, ut64 from, ut64 to, int maxhits, int regexp, int everyByte, int mode)
RZ_API RzCoreAsmHit * rz_core_asm_hit_new(void)
RZ_API RzList * rz_core_asm_hit_list_new(void)
RZ_API void rz_core_analysis_esil_reinit(RZ_NONNULL RzCore *core)
Reinitialize ESIL.
RZ_API int rz_core_cmd0(RzCore *core, const char *cmd)
RZ_API void rz_core_cmd_help(const RzCore *core, const char *help[])
RZ_API int rz_core_cmd(RzCore *core, const char *cstr, int log)
RZ_API int rz_core_cmdf(RzCore *core, const char *fmt,...)
static const char * syscallNumber(int n)
RZ_API int rz_core_esil_step(RzCore *core, ut64 until_addr, const char *until_expr, ut64 *prev_addr, bool stepOver)
static int rz_core_magic_at(RzCore *core, const char *file, ut64 addr, int depth, int v, PJ *pj, int *hits)
static void rz_core_magic_reset(RzCore *core)
static void do_string_search(RzCore *core, RzInterval search_itv, struct search_parameters *param)
static bool is_end_gadget(const RzAnalysisOp *aop, const ut8 crop)
static const char * help_msg_slash[]
static void __core_cmd_search_asm_infinite(RzCore *core, const char *arg)
static const char * help_msg_slash_m[]
static void do_asm_search(RzCore *core, struct search_parameters *param, const char *input, int mode, RzInterval search_itv)
static int search_hash(RzCore *core, const char *hashname, const char *hashstr, ut32 minlen, ut32 maxlen, struct search_parameters *param)
static void incDigitBuffer(ut8 *buf, int bufsz)
static ut8 * v_writebuf(RzCore *core, RzList *nums, int len, char ch, int bsize)
static void incAlphaBuffer(ut8 *buf, int bufsz)
RZ_IPI int rz_cmd_search(void *data, const char *input)
static void do_esil_search(RzCore *core, struct search_parameters *param, const char *input)
static bool isArm(RzCore *core)
static int _cb_hit(RzSearchKeyword *kw, void *user, ut64 addr)
static char * getstring(char *b, int l)
static void incLowerBuffer(ut8 *buf, int bufsz)
static void print_search_progress(ut64 at, ut64 to, int n, struct search_parameters *param)
static const char * searchprefix
static void do_syscall_search(RzCore *core, struct search_parameters *param)
#define SUMARRAY(arr, size, res)
static void print_rop(RzCore *core, RzList *hitlist, PJ *pj, int mode)
static void search_similar_pattern(RzCore *core, int count, struct search_parameters *param)
static const char * help_msg_slash_x[]
static const char * help_msg_slash_c[]
static void do_section_search(RzCore *core, struct search_parameters *param, const char *input)
RZ_API RZ_OWN RzList * rz_core_get_boundaries_prot(RzCore *core, int perm, const char *mode, const char *prefix)
static const char * help_msg_slash_r[]
static const char * help_msg_slash_Rk[]
#define AES_SEARCH_LENGTH
static bool maskMatches(int perm, int mask, bool only)
static int __prelude_cb_hit(RzSearchKeyword *kw, void *user, ut64 addr)
void _CbInRangeSearchV(RzCore *core, ut64 from, ut64 to, int vsize, void *user)
static bool do_analysis_search(RzCore *core, struct search_parameters *param, const char *input)
static const char * help_msg_slash_a[]
static void __core_cmd_search_asm_byteswap(RzCore *core, int nth)
static void incUpperBuffer(ut8 *buf, int bufsz)
static RzList * construct_rop_gadget(RzCore *core, ut64 addr, ut8 *buf, int buflen, int idx, const char *grep, int regex, RzList *rx_list, struct endlist_pair *end_gadget, HtUU *badstart)
static void do_ref_search(RzCore *core, ut64 addr, ut64 from, ut64 to, struct search_parameters *param)
static void incBuffer(ut8 *buf, int bufsz)
static void search_similar_pattern_in(RzCore *core, int count, ut64 from, ut64 to)
static const char * help_msg_slash_R[]
static bool esil_addrinfo(RzAnalysisEsil *esil)
static void cmd_search_bin(RzCore *core, RzInterval itv)
#define PRIVATE_KEY_SEARCH_LENGTH
RZ_API int rz_core_search_preludes(RzCore *core, bool log)
static void incPrintBuffer(ut8 *buf, int bufsz)
static int memcmpdiff(const ut8 *a, const ut8 *b, int len)
RZ_API int rz_core_search_prelude(RzCore *core, ut64 from, ut64 to, const ut8 *buf, int blen, const ut8 *mask, int mlen)
static void append_bound(RzList *list, RzIO *io, RzInterval search_itv, ut64 from, ut64 size, int perms)
static void search_collisions(RzCore *core, const char *hashName, const ut8 *hashValue, int hashLength, int mode)
static bool insert_into(void *user, const ut64 k, const ut64 v)
static void rop_kuery(void *data, const char *input, PJ *pj)
static const char * help_msg_search_esil[]
static int rz_core_search_rop(RzCore *core, RzInterval search_itv, int opt, const char *grep, int regexp, struct search_parameters *param)
static void rop_classify(RzCore *core, Sdb *db, RzList *ropList, const char *key, unsigned int size)
RZ_API ut64 rz_config_get_i(RzConfig *cfg, RZ_NONNULL const char *name)
RZ_API bool rz_config_get_b(RzConfig *cfg, RZ_NONNULL const char *name)
RZ_API RzConfigNode * rz_config_set_i(RzConfig *cfg, RZ_NONNULL const char *name, const ut64 i)
RZ_API RZ_BORROW const char * rz_config_get(RzConfig *cfg, RZ_NONNULL const char *name)
RZ_API RzCons * rz_cons_singleton(void)
RZ_API void rz_cons_clear_line(int std_err)
RZ_API void rz_cons_newline(void)
RZ_API void rz_cons_break_pop(void)
RZ_API void rz_cons_break_push(RzConsBreak cb, void *user)
RZ_API int rz_cons_printf(const char *format,...)
RZ_API void rz_cons_flush(void)
RZ_API bool rz_cons_is_breaked(void)
RZ_API void rz_cons_println(const char *str)
RZ_IPI void rz_core_print_hexdump(RZ_NONNULL RzCore *core, ut64 addr, RZ_NONNULL const ut8 *buf, int len, int base, int step, size_t zoomsz)
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 static offset struct stat static buf void nbytes
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
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 static offset struct stat static buf void long static basep static whence static length const void static len static semflg const void static shmflg const struct timespec struct timespec static rem const char static group const void start
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 static offset struct stat static buf void long static basep static whence static length const void static len key
RZ_API bool rz_debug_map_sync(RzDebug *dbg)
RZ_API ut64 rz_debug_reg_get(RzDebug *dbg, const char *name)
size_t map(int syms, int left, int len)
RZ_API void rz_analysis_esil_stack_free(RzAnalysisEsil *esil)
RZ_API RzAnalysisEsil * rz_analysis_esil_new(int stacksize, int iotrap, unsigned int addrsize)
RZ_API int rz_analysis_esil_get_parm(RzAnalysisEsil *esil, const char *str, ut64 *num)
RZ_API bool rz_analysis_esil_pushnum(RzAnalysisEsil *esil, ut64 num)
RZ_API bool rz_analysis_esil_set_pc(RzAnalysisEsil *esil, ut64 addr)
RZ_API bool rz_analysis_esil_set_op(RzAnalysisEsil *esil, const char *op, RzAnalysisEsilOpCb code, ut32 push, ut32 pop, ut32 type)
RZ_API char * rz_analysis_esil_pop(RzAnalysisEsil *esil)
RZ_API bool rz_analysis_esil_setup(RzAnalysisEsil *esil, RzAnalysis *analysis, int romem, int stats, int nonull)
RZ_API bool rz_analysis_esil_parse(RzAnalysisEsil *esil, const char *str)
RZ_API void rz_analysis_esil_free(RzAnalysisEsil *esil)
RZ_DEPRECATE RZ_API RzAnalysisFunction * rz_analysis_get_fcn_in(RzAnalysis *analysis, ut64 addr, int type)
RZ_API RzFlagItem * rz_flag_set(RzFlag *f, const char *name, ut64 off, ut32 size)
RZ_API char * sdb_fmt(const char *fmt,...)
unsigned short prefix[65536]
RZ_API RZ_OWN char * rz_hash_cfg_calculate_small_block_string(RZ_NONNULL RzHash *rh, RZ_NONNULL const char *name, RZ_NONNULL const ut8 *buffer, ut64 bsize, RZ_NULLABLE ut32 *size, bool invert)
RZ_API RZ_BORROW const RzHashPlugin * rz_hash_plugin_by_name(RZ_NONNULL RzHash *rh, RZ_NONNULL const char *name)
RZ_API double rz_hash_entropy(RZ_NONNULL RzHash *rh, RZ_NONNULL const ut8 *data, ut64 len)
RZ_API RzAnalysisHint * rz_analysis_hint_get(RzAnalysis *a, ut64 addr)
RZ_API void rz_analysis_hint_free(RzAnalysisHint *h)
RZ_API void Ht_() free(HtName_(Ht) *ht)
RZ_API const KEY_TYPE bool * found
RZ_API RzSearchKeyword * rz_search_keyword_new_hex(const char *kwstr, const char *bmstr, const char *data)
RZ_API RzSearchKeyword * rz_search_keyword_new_regexp(const char *str, const char *data)
RZ_API RzSearchKeyword * rz_search_keyword_new(const ut8 *kwbuf, int kwlen, const ut8 *bmbuf, int bmlen, const char *data)
RZ_API RzSearchKeyword * rz_search_keyword_new_hexmask(const char *kwstr, const char *data)
return memset(p, 0, total)
memcpy(mem, inblock.get(), min(CONTAINING_RECORD(inblock.get(), MEMBLOCK, data) ->size, size))
RZ_API char * rz_core_op_str(RzCore *core, ut64 addr)
static int hit(RzSearchKeyword *kw, void *user, ut64 addr)
static void list(RzEgg *egg)
RZ_API void rz_list_reverse(RZ_NONNULL RzList *list)
Reverses the list.
RZ_API RZ_OWN RzList * rz_list_newf(RzListFree f)
Returns a new initialized RzList pointer and sets the free method.
RZ_API RZ_OWN void * rz_list_pop(RZ_NONNULL RzList *list)
Removes and returns the last element of the list.
RZ_API RZ_BORROW void * rz_list_first(RZ_NONNULL const RzList *list)
Returns the first element of the list.
RZ_API RZ_BORROW void * rz_list_get_n(RZ_NONNULL const RzList *list, ut32 n)
Returns the N-th element of the list.
RZ_API ut32 rz_list_length(RZ_NONNULL const RzList *list)
Returns the length of the list.
RZ_API RZ_OWN void * rz_list_pop_head(RZ_NONNULL RzList *list)
Removes and returns the first element of the list.
RZ_API RZ_BORROW RzListIter * rz_list_append(RZ_NONNULL RzList *list, void *data)
Appends at the end of the list a new element.
RZ_API void rz_list_free(RZ_NONNULL RzList *list)
Empties the list and frees the list pointer.
RZ_API void rz_list_purge(RZ_NONNULL RzList *list)
Empties the list without freeing the list pointer.
RZ_API char * sdb_querys(Sdb *r, char *buf, size_t len, const char *_cmd)
void * malloc(size_t size)
void * calloc(size_t number, size_t size)
static static fork const void static count static fd const char const char static newpath char char char static envp time_t static t const char static mode static whence const char static dir time_t static t unsigned static seconds const char struct utimbuf static buf static inc static sig const char static mode static oldfd struct tms static buf static getgid static geteuid const char static filename static arg static mask struct ustat static ubuf static getppid static setsid static egid sigset_t static set struct timeval struct timezone static tz fd_set fd_set fd_set struct timeval static timeout const char char static bufsiz const char static swapflags void static offset const char static length static mode static who const char struct statfs static buf unsigned unsigned num
static static fork const void static count static fd const char const char static newpath char char char static envp time_t static t const char static mode static whence const char static dir time_t static t unsigned static seconds const char struct utimbuf static buf static inc static sig const char static mode dup
return strdup("=SP r13\n" "=LR r14\n" "=PC r15\n" "=A0 r0\n" "=A1 r1\n" "=A2 r2\n" "=A3 r3\n" "=ZF zf\n" "=SF nf\n" "=OF vf\n" "=CF cf\n" "=SN or0\n" "gpr lr .32 56 0\n" "gpr pc .32 60 0\n" "gpr cpsr .32 64 0 ____tfiae_________________qvczn\n" "gpr or0 .32 68 0\n" "gpr tf .1 64.5 0 thumb\n" "gpr ef .1 64.9 0 endian\n" "gpr jf .1 64.24 0 java\n" "gpr qf .1 64.27 0 sticky_overflow\n" "gpr vf .1 64.28 0 overflow\n" "gpr cf .1 64.29 0 carry\n" "gpr zf .1 64.30 0 zero\n" "gpr nf .1 64.31 0 negative\n" "gpr itc .4 64.10 0 if_then_count\n" "gpr gef .4 64.16 0 great_or_equal\n" "gpr r0 .32 0 0\n" "gpr r1 .32 4 0\n" "gpr r2 .32 8 0\n" "gpr r3 .32 12 0\n" "gpr r4 .32 16 0\n" "gpr r5 .32 20 0\n" "gpr r6 .32 24 0\n" "gpr r7 .32 28 0\n" "gpr r8 .32 32 0\n" "gpr r9 .32 36 0\n" "gpr r10 .32 40 0\n" "gpr r11 .32 44 0\n" "gpr r12 .32 48 0\n" "gpr r13 .32 52 0\n" "gpr r14 .32 56 0\n" "gpr r15 .32 60 0\n" "gpr r16 .32 64 0\n" "gpr r17 .32 68 0\n")
#define ls_foreach(list, it, pos)
RZ_API Sdb * sdb_ns(Sdb *s, const char *name, int create)
RZ_API bool rz_analysis_op_fini(RzAnalysisOp *op)
RZ_API const char * rz_analysis_optype_to_string(int type)
RZ_API bool rz_analysis_op_nonlinear(int t)
RZ_API int rz_analysis_op(RzAnalysis *analysis, RzAnalysisOp *op, ut64 addr, const ut8 *data, int len, RzAnalysisOpMask mask)
RZ_API const char * rz_analysis_op_family_to_string(int id)
RZ_API bool rz_parse_filter(RzParse *p, ut64 addr, RzFlag *f, RzAnalysisHint *hint, char *data, char *str, int len, bool big_endian)
filter the opcode in data into str by following the flags and hints information
RZ_API void rz_print_fill(RzPrint *p, const ut8 *arr, int size, ut64 addr, int step)
RZ_API RzRegItem * rz_reg_get(RzReg *reg, const char *name, int type)
RZ_API const char * rz_reg_64_to_32(RzReg *reg, const char *rreg64)
RZ_API const char * rz_reg_get_name(RzReg *reg, int role)
RZ_API bool rz_reg_set_value(RzReg *reg, RzRegItem *item, ut64 value)
@ RZ_ANALYSIS_FCN_TYPE_SYM
@ RZ_ANALYSIS_FCN_TYPE_FCN
@ RZ_ANALYSIS_XREF_TYPE_NULL
@ RZ_ANALYSIS_OP_FAMILY_SECURITY
@ RZ_ANALYSIS_ESIL_OP_TYPE_UNKNOWN
@ RZ_ANALYSIS_OP_MASK_DISASM
@ RZ_ANALYSIS_OP_MASK_BASIC
@ RZ_ANALYSIS_OP_MASK_ESIL
@ RZ_ANALYSIS_OP_MASK_HINT
#define RZ_ANALYSIS_ARCHINFO_MIN_OP_SIZE
@ RZ_ANALYSIS_OP_TYPE_ICALL
@ RZ_ANALYSIS_OP_TYPE_JMP
@ RZ_ANALYSIS_OP_TYPE_UJMP
@ RZ_ANALYSIS_OP_TYPE_IJMP
@ RZ_ANALYSIS_OP_TYPE_UCCALL
@ RZ_ANALYSIS_OP_TYPE_SWI
@ RZ_ANALYSIS_OP_TYPE_TRAP
@ RZ_ANALYSIS_OP_TYPE_CCALL
@ RZ_ANALYSIS_OP_TYPE_CALL
@ RZ_ANALYSIS_OP_TYPE_CRET
@ RZ_ANALYSIS_OP_TYPE_IRJMP
@ RZ_ANALYSIS_OP_TYPE_RJMP
@ RZ_ANALYSIS_OP_TYPE_CJMP
@ RZ_ANALYSIS_OP_TYPE_UCJMP
@ RZ_ANALYSIS_OP_TYPE_MOV
@ RZ_ANALYSIS_OP_TYPE_UCALL
@ RZ_ANALYSIS_OP_TYPE_RET
@ RZ_ANALYSIS_OP_TYPE_NOP
@ RZ_ANALYSIS_OP_TYPE_RCALL
@ RZ_ANALYSIS_OP_TYPE_IRCALL
#define rz_warn_if_reached()
#define rz_return_val_if_fail(expr, val)
RZ_API RZ_OWN RzBuffer * rz_buf_new_with_io_fd(RZ_NONNULL void *iob, int fd)
Creates a new buffer wrapping a file descriptor accessed through RzIOBind.
RZ_API void rz_buf_free(RzBuffer *b)
Free all internal data hold by the buffer and the buffer.
RZ_API RZ_OWN RzBuffer * rz_buf_new_slice(RzBuffer *b, ut64 offset, ut64 size)
Creates a new buffer from a slice of another buffer.
static void rz_write_le32(void *dest, ut32 val)
static void rz_write_le16(void *dest, ut16 val)
static void rz_write_le64(void *dest, ut64 val)
static void rz_write_le8(void *dest, ut8 val)
RZ_API RZ_OWN char * rz_file_slurp(const char *str, RZ_NULLABLE size_t *usz)
RZ_API int rz_hex_str2bin(const char *in, ut8 *out)
Convert an input string in into the binary form in out.
RZ_API int rz_hex_bin2str(const ut8 *in, int len, char *out)
RZ_API ut64 rz_io_fd_size(RzIO *io, int fd)
RZ_API bool rz_io_read_at(RzIO *io, ut64 addr, ut8 *buf, int len)
RZ_API ut64 rz_io_size(RzIO *io)
RZ_API RzIOMap * rz_io_map_get(RzIO *io, ut64 addr)
RZ_API RZ_BORROW RzPVector * rz_io_maps(RzIO *io)
Returns the pointer to vector containing maps list.
RZ_API bool rz_io_is_valid_offset(RzIO *io, ut64 offset, int hasperm)
RZ_API int rz_io_fd_get_current(RzIO *io)
static ut64 rz_itv_begin(RzInterval itv)
static ut64 rz_itv_end(RzInterval itv)
static bool rz_itv_overlap(RzInterval itv, RzInterval x)
static RzInterval rz_itv_intersect(RzInterval itv, RzInterval x)
static ut64 rz_itv_size(RzInterval itv)
#define RZ_LOG_WARN(fmtstr,...)
#define RZ_LOG_ERROR(fmtstr,...)
RZ_API RzList * rz_num_str_split_list(char *str)
RZ_API ut64 rz_num_get(RzNum *num, const char *str)
RZ_API ut64 rz_num_math(RzNum *num, const char *str)
RZ_API PJ * pj_ka(PJ *j, const char *k)
RZ_API PJ * pj_ki(PJ *j, const char *k, int d)
RZ_API PJ * pj_end(PJ *j)
RZ_API const char * pj_string(PJ *pj)
RZ_API void pj_free(PJ *j)
RZ_API PJ * pj_ks(PJ *j, const char *k, const char *v)
RZ_API PJ * pj_kn(PJ *j, const char *k, ut64 n)
RZ_API PJ * pj_kN(PJ *j, const char *k, st64 n)
#define RZ_PRINT_FLAGS_COLOR
RZ_API int rz_regex_match(const char *pattern, const char *flags, const char *text)
#define RZ_SEARCH_KEYWORD_TYPE_STRING
#define RZ_STR_ISNOTEMPTY(x)
RZ_API char * rz_str_newf(const char *fmt,...) RZ_PRINTF_CHECK(1
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 int rz_str_rwx(const char *str)
RZ_API char * rz_str_trim_dup(const char *str)
RZ_API char * rz_str_utf16_encode(const char *s, int len)
RZ_API const char * rz_str_trim_head_ro(const char *str)
RZ_API char * rz_str_replace(char *str, const char *key, const char *val, int g)
RZ_API char ** rz_str_argv(const char *str, int *_argc)
RZ_API bool rz_str_startswith(RZ_NONNULL const char *str, RZ_NONNULL const char *needle)
Checks if a string starts with a specifc sequence of characters (case sensitive)
RZ_API int rz_str_unescape(char *buf)
RZ_API int rz_str_ncasecmp(const char *dst, const char *orig, size_t n)
RZ_API void rz_str_argv_free(char **argv)
#define RZ_STRBUF_SAFEGET(sb)
RZ_API char * rz_strbuf_get(RzStrBuf *sb)
RZ_API RzStrBuf * rz_strbuf_new(const char *s)
RZ_API void rz_strbuf_free(RzStrBuf *sb)
RZ_API ut64 rz_time_now_mono(void)
Returns the current time in microseconds, using the monotonic clock.
#define RZ_BETWEEN(x, y, z)
typedef RZ_ALIGNED(1) ut16 uut16
static void * rz_vector_index_ptr(RzVector *vec, size_t index)
static size_t rz_pvector_len(const RzPVector *vec)
static size_t rz_vector_len(const RzVector *vec)
static void * rz_pvector_at(const RzPVector *vec, size_t index)
#define rz_pvector_foreach(vec, it)
RZ_API SdbList * sdb_foreach_list(Sdb *s, bool sorted)
RZ_API int sdb_concat(Sdb *s, const char *key, const char *value, ut32 cas)
static char * sdbkv_key(const SdbKv *kv)
static char * sdbkv_value(const SdbKv *kv)
RZ_API void rz_search_string_prepare_backward(RzSearch *s)
RZ_API int rz_search_update(RzSearch *s, ut64 from, const ut8 *buf, long len)
RZ_API void rz_search_set_callback(RzSearch *s, RzSearchCallback(callback), void *user)
RZ_API int rz_search_begin(RzSearch *s)
RZ_API void rz_search_kw_reset(RzSearch *s)
RZ_API int rz_search_set_string_limits(RzSearch *s, ut32 min, ut32 max)
RZ_API void rz_search_reset(RzSearch *s, int mode)
RZ_API void rz_search_pattern_size(RzSearch *s, int size)
RZ_API int rz_search_kw_add(RzSearch *s, RzSearchKeyword *kw)
RZ_API void rz_search_set_distance(RzSearch *s, int dist)
RZ_API bool rz_core_seek(RzCore *core, ut64 addr, bool rb)
Seek to addr.
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
RzAnalysisEsilCallbacks cb
RzAnalysisOpFamily family
struct rz_analysis_plugin_t * cur
struct rz_analysis_esil_t * esil
RzAsmTokenString * asm_toks
Tokenized asm string.
ut64(* size)(RzBinFile *bin)
RZ_DEPRECATE RzBinFile * cur
never use this in new code! Get a file from the binfiles list or track it yourself.
struct rz_io_desc_t * desc
struct rz_list_iter_t * n
RZ_API void rz_syscall_item_free(RzSyscallItem *si)
RZ_API RzSyscallItem * rz_syscall_get(RzSyscall *s, int num, int swi)
RZ_API RzList * rz_syscall_list(RzSyscall *s)
void error(const char *msg)
RZ_API bool rz_core_prevop_addr(RzCore *core, ut64 start_addr, int numinstrs, ut64 *prev_addr)
RZ_API ut64 rz_core_prevop_addr_force(RzCore *core, ut64 start_addr, int numinstrs)
if(dbg->bits==RZ_SYS_BITS_64)
ut64(WINAPI *w32_GetEnabledXStateFeatures)()
RZ_API RzList * rz_analysis_xrefs_get_to(RzAnalysis *analysis, ut64 addr)
RZ_API const char * rz_analysis_xrefs_type_tostring(RzAnalysisXRefType type)
static const z80_opcode fd[]
static bool input(void *ud, zip_uint8_t *data, zip_uint64_t length)
unsigned long ZEXPORT crc32(unsigned long crc, const unsigned char FAR *buf, uInt len)