/az uses anal.in instead of search.in to improve scan results ##search
* Improve snes analysis (brk 0 must be a trap)
This commit is contained in:
parent
925756ddf2
commit
5102e86f1e
|
@ -83,6 +83,8 @@ static int snes_anop(RAnal *anal, RAnalOp *op, ut64 addr, const ut8 *data, int l
|
|||
op->type = R_ANAL_OP_TYPE_XCHG;
|
||||
break;
|
||||
case 0x00: // brk
|
||||
op->type = R_ANAL_OP_TYPE_TRAP;
|
||||
break;
|
||||
case 0x02: // cop
|
||||
op->type = R_ANAL_OP_TYPE_SWI;
|
||||
break;
|
||||
|
|
|
@ -11730,8 +11730,8 @@ static int cmd_anal_all(RCore *core, const char *input) {
|
|||
}
|
||||
|
||||
if (input[1] == 'a') { // "aaaa"
|
||||
R_LOG_INFO ("Scanning for strings constructed in code (/azq 5)");
|
||||
r_core_cmd0 (core, "/azq 5");
|
||||
R_LOG_INFO ("Scanning for strings constructed in code (/azs)");
|
||||
r_core_cmd0 (core, "/azs");
|
||||
if (!didAap) {
|
||||
didAap = true;
|
||||
R_LOG_INFO ("Finding function preludes (aap)");
|
||||
|
|
|
@ -2282,9 +2282,18 @@ static void search_hit_at(RCore *core, struct search_parameters *param, RCoreAsm
|
|||
static bool do_analstr_search(RCore *core, struct search_parameters *param, bool quiet, const char *input) {
|
||||
bool silent = false;
|
||||
if (!input) {
|
||||
input = "";
|
||||
input = "5";
|
||||
silent = true;
|
||||
}
|
||||
// const char *where = r_config_get (core->config, "anal.in");
|
||||
const char *where = "bin.sections.x";
|
||||
|
||||
r_list_free (param->boundaries);
|
||||
param->boundaries = r_core_get_boundaries_prot (core, R_PERM_X, where, "search");
|
||||
if (r_list_empty (param->boundaries)) {
|
||||
where = r_config_get (core->config, "anal.in");
|
||||
param->boundaries = r_core_get_boundaries_prot (core, R_PERM_X, where, "search");
|
||||
}
|
||||
ut64 at;
|
||||
RAnalOp aop;
|
||||
int hasch = 0;
|
||||
|
@ -2408,11 +2417,10 @@ static bool do_analstr_search(RCore *core, struct search_parameters *param, bool
|
|||
lastch = UT64_MAX;
|
||||
}
|
||||
int inc = (core->search->align > 0)? core->search->align - 1: ret - 1;
|
||||
if (inc < 0) {
|
||||
inc = 0;
|
||||
if (inc > 0) {
|
||||
i += inc;
|
||||
at += inc;
|
||||
}
|
||||
i += inc;
|
||||
at += inc;
|
||||
}
|
||||
r_anal_op_fini (&aop);
|
||||
}
|
||||
|
|
|
@ -13,11 +13,12 @@ RUN
|
|||
NAME=mozi aae functions
|
||||
FILE=bins/elf/analysis/loongarch64-curl
|
||||
CMDS=<<EOF
|
||||
e anal.depth=256
|
||||
aae
|
||||
aflc
|
||||
EOF
|
||||
EXPECT=<<EOF
|
||||
403
|
||||
400
|
||||
EOF
|
||||
RUN
|
||||
|
||||
|
|
|
@ -7,6 +7,6 @@ afr
|
|||
aflc
|
||||
EOF
|
||||
EXPECT=<<EOF
|
||||
102
|
||||
208
|
||||
EOF
|
||||
RUN
|
||||
|
|
|
@ -59,7 +59,7 @@ afi~complex[1]
|
|||
afb.@main
|
||||
EOF
|
||||
EXPECT=<<EOF
|
||||
165
|
||||
167
|
||||
0x0002bca0 0x0002bccc 00:0000 44 j 0x0002c534 f 0x0002bccc
|
||||
EOF
|
||||
RUN
|
||||
|
@ -160,7 +160,7 @@ af
|
|||
afl
|
||||
EOF
|
||||
EXPECT=<<EOF
|
||||
0x00018c08 350 7132 main
|
||||
0x00018c08 357 7340 main
|
||||
EOF
|
||||
RUN
|
||||
|
||||
|
@ -262,6 +262,10 @@ EXPECT=<<EOF
|
|||
0x0002c4c4 0x0002c4c8 00:0000 4 j 0x0002c4c8
|
||||
0x0002c4c8 0x0002c4d8 00:0000 16 j 0x0002c83c f 0x0002c4d8
|
||||
0x0002c4d8 0x0002c4e8 00:0000 16 j 0x0002c81c f 0x0002c4e8
|
||||
0x0002c4e8 0x0002c4f8 00:0000 16 j 0x0002c50c
|
||||
0x0002c4f8 0x0002c508 00:0000 16 j 0x0002c814 f 0x0002c508
|
||||
0x0002c508 0x0002c50c 00:0000 4 j 0x0002c50c
|
||||
0x0002c50c 0x0002c534 00:0000 40 j 0x0002c4f8 f 0x0002c534
|
||||
0x0002c534 0x0002c53c 00:0000 8
|
||||
0x0002c53c 0x0002c550 00:0000 20 j 0x0002bfdc f 0x0002c550
|
||||
0x0002c550 0x0002c560 00:0000 16 j 0x0002bed8 f 0x0002c560
|
||||
|
@ -292,6 +296,8 @@ EXPECT=<<EOF
|
|||
0x0002c7e8 0x0002c7f8 00:0000 16 j 0x0002c028 f 0x0002c7f8
|
||||
0x0002c7f8 0x0002c80c 00:0000 20 j 0x0002c028
|
||||
0x0002c80c 0x0002c814 00:0000 8 j 0x0002c200
|
||||
0x0002c814 0x0002c81c 00:0000 8 j 0x0002c81c
|
||||
0x0002c81c 0x0002c83c 00:0000 32 j 0x0002c83c
|
||||
0x0002c83c 0x0002c868 00:0000 44 j 0x0002cbfc f 0x0002c868
|
||||
0x0002c868 0x0002c898 00:0000 48 j 0x0002c8d4 f 0x0002c898
|
||||
0x0002c898 0x0002c8a8 00:0000 16 j 0x0002ce58 f 0x0002c8a8
|
||||
|
|
|
@ -210,7 +210,7 @@ EXPECT=<<EOF
|
|||
0x0045a8c0 132 flirt.__sigsetjmp
|
||||
0x0045abc0 6232 flirt._quicksort
|
||||
0x0045c620 19 flirt.__libc_secure_getenv
|
||||
0x0045ce30 10673 flirt.group_number
|
||||
0x0045ce30 10704 flirt.group_number
|
||||
0x0045f800 13172 flirt._IO_vfprintf_internal
|
||||
0x00462b80 976 flirt.hack_digit
|
||||
0x00465a50 11033 flirt.___printf_fp
|
||||
|
|
|
@ -396,8 +396,8 @@ EXPECT=<<EOF
|
|||
[38;2;58;150;221m|[0m [38;2;19;161;14m0x00005aed[0m [38;2;193;156;0m48[38;2;204;204;204m83[38;2;204;204;204me4[38;2;204;204;204mf0[0m [38;2;193;156;0mand[38;2;58;150;221m rsp[0m,[38;2;58;150;221m[38;2;58;150;221m [38;2;193;156;0m0xfffffffffffffff0[0m[0m[0m
|
||||
[38;2;58;150;221m|[0m [38;2;19;161;14m0x00005af1[0m [38;2;193;156;0m50[0m [38;2;136;23;152mpush[38;2;58;150;221m rax[0m[0m[0m
|
||||
[38;2;58;150;221m|[0m [38;2;19;161;14m0x00005af2[0m [38;2;193;156;0m54[0m [38;2;136;23;152mpush[38;2;58;150;221m rsp[0m[0m[0m
|
||||
[38;2;58;150;221m|[0m [38;2;19;161;14m0x00005af3[0m [38;2;193;156;0m4c[38;2;204;204;204m8d[38;2;204;204;204m05[38;2;193;156;0m66[38;2;204;204;204m0c[38;2;204;204;204m01[38;2;204;204;204m.[0m [38;2;204;204;204mlea[38;2;58;150;221m r8[0m,[38;2;58;150;221m[38;2;58;150;221m [0m[[38;2;193;156;0m0x00016760[0m][38;2;58;150;221m[0m[0m[0m
|
||||
[38;2;58;150;221m|[0m [38;2;19;161;14m0x00005afa[0m [38;2;193;156;0m48[38;2;204;204;204m8d[38;2;204;204;204m0d[38;2;204;204;204mef[38;2;204;204;204m0b[38;2;204;204;204m01[38;2;204;204;204m.[0m [38;2;204;204;204mlea[38;2;58;150;221m rcx[0m,[38;2;58;150;221m[38;2;58;150;221m [0m[[38;2;193;156;0m0x000166f0[0m][38;2;58;150;221m[0m[0m[0m
|
||||
[38;2;58;150;221m|[0m [38;2;19;161;14m0x00005af3[0m [38;2;193;156;0m4c[38;2;204;204;204m8d[38;2;204;204;204m05[38;2;193;156;0m66[38;2;204;204;204m0c[38;2;204;204;204m01[38;2;204;204;204m.[0m [38;2;204;204;204mlea[38;2;58;150;221m r8[0m,[38;2;58;150;221m[38;2;58;150;221m [0m[[38;2;58;150;221mfcn.00016760[0m][38;2;58;150;221m[0m[0m[38;2;197;15;31m [38;2;197;15;31m; 0x16760[0m
|
||||
[38;2;58;150;221m|[0m [38;2;19;161;14m0x00005afa[0m [38;2;193;156;0m48[38;2;204;204;204m8d[38;2;204;204;204m0d[38;2;204;204;204mef[38;2;204;204;204m0b[38;2;204;204;204m01[38;2;204;204;204m.[0m [38;2;204;204;204mlea[38;2;58;150;221m rcx[0m,[38;2;58;150;221m[38;2;58;150;221m [0m[[38;2;58;150;221mfcn.000166f0[0m][38;2;58;150;221m[0m[0m[38;2;197;15;31m [38;2;197;15;31m; 0x166f0[0m
|
||||
[38;2;58;150;221m|[0m [38;2;19;161;14m0x00005b01[0m [38;2;193;156;0m48[38;2;204;204;204m8d[38;2;193;156;0m3d[38;2;193;156;0m68[38;2;204;204;204me5[38;2;197;15;31mff[38;2;204;204;204m.[0m [38;2;204;204;204mlea[38;2;58;150;221m rdi[0m,[38;2;58;150;221m[38;2;58;150;221m main[0m[0m[38;2;197;15;31m [38;2;197;15;31m; 0x4070[38;2;197;15;31m [38;2;197;15;31m; "AWAVAUATU\x89\xfdSH\x89\xf3H\x83\xecXH\x8b>dH\x8b\x04%("[0m
|
||||
[38;2;58;150;221m\[0m [38;2;19;161;14m0x00005b08[0m [38;2;197;15;31mff[38;2;204;204;204m15[38;2;204;204;204m0a[38;2;204;204;204mc3[38;2;204;204;204m01[38;2;19;161;14m00[0m [38;2;19;161;14mcall qword[38;2;58;150;221m [0m[[38;2;58;150;221mreloc.__libc_start_main[0m][38;2;58;150;221m[0m[0m[38;2;197;15;31m [38;2;197;15;31m; [0x21e18:8]=0[0m
|
||||
[38;2;19;161;14m0x00005b0e[0m [38;2;204;204;204mf4[0m [1;38;2;231;72;86mhlt[0m[0m[0m
|
||||
|
|
|
@ -376,7 +376,7 @@ pd 20 @ dbg.palya
|
|||
EOF
|
||||
EXPECT=<<EOF
|
||||
;-- unit p(mozgkigyo palya(smallint,smallint)):
|
||||
; CALL XREFS from main @ +0x1a87(x), +0x1c7d(x), +0x23f3(x), +0x3679(x)
|
||||
; CALL XREFS from dbg.$main @ 0x405237(x), 0x40542d(x), 0x405ba3(x), 0x406e29(x)
|
||||
/ 439: dbg.palya() ();
|
||||
| ; var SmallInt mag @ rbp-0x8
|
||||
| ; var SmallInt szel @ rbp-0x10
|
||||
|
|
Loading…
Reference in New Issue