Remove radiff2 -CC because we already have -A, -AA, -AAA ...

This commit is contained in:
pancake 2016-03-22 12:55:36 +01:00
parent a461bbc536
commit f4618c0bbd
4 changed files with 11 additions and 15 deletions

View file

@ -45,7 +45,12 @@ static RCore* opencore(const char *f) {
}
// 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");
const char *cmd = "aac";
switch (anal_all) {
case 1: cmd = "aaa"; break;
case 2: cmd = "aaaa"; break;
}
r_core_cmd0 (c, cmd);
}
return c;
}
@ -148,7 +153,6 @@ static int show_help(int v) {
" -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"
" -CC same as above but run `aac` to find more functions\n"
" -d use delta diffing\n"
" -D show disasm instead of hexpairs\n"
" -g [sym|off1,off2] graph diff of given symbol, or between two offsets\n"
@ -215,7 +219,6 @@ int main(int argc, char **argv) {
int mode = MODE_DIFF;
int diffops = 0;
int threshold = -1;
int gdiff_mode = 0;
double sim;
while ((o = getopt (argc, argv, "Aa:b:CDnpg:Ojrhcdsvxt:")) != -1) {
@ -244,7 +247,6 @@ int main(int argc, char **argv) {
break;
case 'C':
mode = MODE_CODE;
gdiff_mode++;
break;
case 'n':
showbare = true;
@ -329,20 +331,20 @@ int main(int argc, char **argv) {
r_core_anal_fcn (c, off, UT64_MAX, R_ANAL_REF_TYPE_NULL, 0);
r_core_anal_fcn (c2, r_num_math (c2->num, second),
UT64_MAX, R_ANAL_REF_TYPE_NULL, 0);
r_core_gdiff (c, c2, false); // compute the diff
r_core_gdiff (c, c2);
r_core_anal_graph (c, off, R_CORE_ANAL_GRAPHBODY | R_CORE_ANAL_GRAPHDIFF);
} else {
r_core_anal_fcn (c, r_num_math (c->num, words),
UT64_MAX, R_ANAL_REF_TYPE_NULL, 0);
r_core_anal_fcn (c2, r_num_math (c2->num, words),
UT64_MAX, R_ANAL_REF_TYPE_NULL, 0);
r_core_gdiff (c, c2, gdiff_mode);
r_core_gdiff (c, c2);
r_core_anal_graph (c, r_num_math (c->num, addr),
R_CORE_ANAL_GRAPHBODY | R_CORE_ANAL_GRAPHDIFF);
}
free (words);
} else {
r_core_gdiff (c, c2, gdiff_mode);
r_core_gdiff (c, c2);
r_core_diff_show (c, c2);
}
r_cons_flush ();

View file

@ -23,7 +23,7 @@ R_API int r_core_gdiff_fcn(RCore *c, ut64 addr, ut64 addr2) {
/* Fingerprint functions and blocks, then diff.
* If `anal_all` is 1 analyse all the symbols, if its 2 runs `aac` */
R_API int r_core_gdiff(RCore *c, RCore *c2, int anal_all) {
R_API int r_core_gdiff(RCore *c, RCore *c2) {
RCore *cores[2] = {c, c2};
RAnalFunction *fcn;
RAnalBlock *bb;
@ -33,10 +33,6 @@ R_API int r_core_gdiff(RCore *c, RCore *c2, int anal_all) {
if (!c || !c2)
return false;
for (i = 0; i < 2; i++) {
if (anal_all>1)
r_core_cmd0 (cores[i], "aac");
if (anal_all>0)
r_core_anal_all (cores[i]);
/* remove strings */
r_list_foreach_safe (cores[i]->anal->fcns, iter, iter2, fcn) {
if (!strncmp (fcn->name, "str.", 4)) {

View file

@ -391,7 +391,7 @@ R_API int r_core_bin_refresh_strings(RCore *core);
R_API int r_core_pseudo_code (RCore *core, const char *input);
/* gdiff.c */
R_API int r_core_gdiff(RCore *core1, RCore *core2, int anal_all);
R_API int r_core_gdiff(RCore *core1, RCore *core2);
R_API int r_core_gdiff_fcn(RCore *c, ut64 addr, ut64 addr2);
R_API int r_core_project_open(RCore *core, const char *file);

View file

@ -24,8 +24,6 @@ Select register size bits for given arch
Count number of differences.
.It Fl C
Code diffing using graphdiff algorithm. Output columns are: file-a-address, percentatge of most similar function in B file | file-b-address.
.It Fl CC
Perform a code diffing of all the functions. Run aac instead of just diffing the symbols.
.It Fl d
Use delta diffing (slower).
.It Fl D