Fix #4335 - radiff2 -A

This commit is contained in:
pancake 2016-03-19 02:57:53 +01:00
parent 0442a71fa8
commit 1aaa475298
2 changed files with 12 additions and 2 deletions

View File

@ -28,6 +28,7 @@ static bool disasm = false;
static RCore *core = NULL;
static const char *arch = NULL;
static int bits = 0;
static int anal_all = 0;
static RCore* opencore(const char *f) {
const ut64 baddr = UT64_MAX;
@ -43,6 +44,9 @@ static RCore* opencore(const char *f) {
r_core_bin_load (c, NULL, baddr);
}
// TODO: must enable io.va here if wanted .. r_config_set_i (c->config, "io.va", va);
if (anal_all) {
r_core_cmd0 (c, (anal_all>1)? "aaaa": "aaa");
}
return c;
}
@ -140,6 +144,7 @@ static int show_help(int v) {
printf ("Usage: radiff2 [-abcCdjrspOv] [-g sym] [-t %%] [file] [file]\n");
if (v) printf (
" -a [arch] specify architecture plugin to use (x86, arm, ..)\n"
" -A [-A] run aaa or aaaa after loading each binary\n"
" -b [bits] specify register size for arch (16 (thumb), 32, 64, ..)\n"
" -c count of changes\n"
" -C graphdiff code (columns: off-A, match-ratio, off-B)\n"
@ -213,11 +218,14 @@ int main(int argc, char **argv) {
int gdiff_mode = 0;
double sim;
while ((o = getopt (argc, argv, "a:b:CDnpg:Ojrhcdsvxt:")) != -1) {
while ((o = getopt (argc, argv, "Aa:b:CDnpg:Ojrhcdsvxt:")) != -1) {
switch (o) {
case 'a':
arch = optarg;
break;
case 'A':
anal_all++;
break;
case 'b':
bits = atoi (optarg);
break;

View File

@ -5,7 +5,7 @@
.Nd unified binary diffing utility
.Sh SYNOPSIS
.Nm radiff2
.Op Fl abcCDOdrspvh
.Op Fl AabcCDOdrspvh
.Op Fl t Ar 0-100
.Op Fl g Ar sym
.Ar file1
@ -14,6 +14,8 @@
radiff2 implements many binary diffing algorithms for data and code.
.Pp
.Bl -tag -width Fl
.It Fl A
Analyze binary after loading it with RCore (see -C) and use -AA to run aaaa instead of aaa.
.It Fl a
Specify architecture (x86, arm, ..)
.It Fl b