@@ -51,7 +51,7 @@ typedef struct {
51
51
int delta ;
52
52
bool json_started ;
53
53
int diffmode ;
54
- int diffops ;
54
+ bool diffops ;
55
55
int mode ;
56
56
int gmode ;
57
57
bool disasm ;
@@ -147,7 +147,7 @@ static void readstr(char *s, int sz, const ut8 *buf, int len) {
147
147
148
148
static int cb (RDiff * d , void * user , RDiffOp * op ) {
149
149
int i ;
150
- RadiffOptions * ro = user ;
150
+ RadiffOptions * ro = ( RadiffOptions * ) user ;
151
151
char s [256 ] = {0 };
152
152
if (ro -> showcount ) {
153
153
ro -> count ++ ;
@@ -455,9 +455,9 @@ static int show_help(int v) {
455
455
" -d use delta diffing\n"
456
456
" -D show disasm instead of hexpairs\n"
457
457
" -e [k=v] set eval config var value for all RCore instances\n"
458
- " -f [ofmt ] select output format (see '-f help' for details)\n"
458
+ " -f [help ] select output format (see '-f help' for details)\n"
459
459
" -g [arg] graph diff of [sym] or functions in [off1,off2]\n"
460
- " -i [what ] compare bin information (symbols, strings, classes, ..)\n"
460
+ " -i [help ] compare bin information (symbols, strings, classes, ..)\n"
461
461
" -j output in json format (see -f json)\n"
462
462
" -m [mode] choose the graph output mode (aditsjJ)\n"
463
463
" -n count of changes\n"
@@ -471,13 +471,10 @@ static int show_help(int v) {
471
471
" -t [0-100] set threshold for code diff (default is 70%%)\n"
472
472
" -T analyze files in threads (EXPERIMENTAL, 30%% faster and crashy)\n"
473
473
" -x show two column hexdump diffing\n"
474
- " -X show two column hexII diffing\n"
475
474
" -u unified output (---+++)\n"
476
475
" -U unified output using system 'diff'\n"
477
476
" -v show version information\n"
478
477
" -V be verbose (current only for -s)\n"
479
- " -z diff on extracted strings (see -i)\n"
480
- " -Z diff code comparing zignatures (see -i)\n\n"
481
478
);
482
479
}
483
480
return 1 ;
@@ -1091,8 +1088,6 @@ static bool select_input_data(RadiffOptions *ro, const char *arg) {
1091
1088
ch0 = 'i' ;
1092
1089
} else if (!strcmp (arg , "classes" )) {
1093
1090
ch0 = 'c' ;
1094
- } else if (!strcmp (arg , "symbols" )) {
1095
- ch0 = 's' ;
1096
1091
} else if (!strcmp (arg , "fields" )) {
1097
1092
ch0 = 'f' ;
1098
1093
} else if (!strcmp (arg , "methods" )) {
@@ -1155,7 +1150,6 @@ static bool select_input_data(RadiffOptions *ro, const char *arg) {
1155
1150
default :
1156
1151
return false;
1157
1152
}
1158
- ro -> diffmode = 'U' ;
1159
1153
return true;
1160
1154
}
1161
1155
@@ -1315,7 +1309,7 @@ R_API int r_main_radiff2(int argc, const char **argv) {
1315
1309
1316
1310
radiff_options_init (& ro );
1317
1311
1318
- r_getopt_init (& opt , argc , argv , "Aa:b:B:CDe:f:npg:m:G:Oi:jrhcdsS:uUvVxXt:TzqZ " );
1312
+ r_getopt_init (& opt , argc , argv , "Aa:b:B:c:CdDe:f:g:hi:jm:nOprst:TxuUqvV " );
1319
1313
while ((o = r_getopt_next (& opt )) != -1 ) {
1320
1314
switch (o ) {
1321
1315
case 'a' :
@@ -1361,6 +1355,13 @@ R_API int r_main_radiff2(int argc, const char **argv) {
1361
1355
return 1 ;
1362
1356
}
1363
1357
break ;
1358
+ case 'g' :
1359
+ ro .mode = MODE_GRAPH ;
1360
+ // ro.pdc = true;
1361
+ addr = opt .arg ;
1362
+ break ;
1363
+ case 'h' :
1364
+ return show_help (1 );
1364
1365
case 'i' :
1365
1366
if (!select_input_data (& ro , opt .arg )) {
1366
1367
R_LOG_ERROR ("Invalid input data selected (see -i help)" );
@@ -1371,17 +1372,6 @@ R_API int r_main_radiff2(int argc, const char **argv) {
1371
1372
ro .diffmode = 'j' ;
1372
1373
ro .pj = pj_new ();
1373
1374
break ;
1374
- case 'p' :
1375
- ro .useva = false;
1376
- break ;
1377
- case 'r' :
1378
- ro .diffmode = 'r' ;
1379
- break ;
1380
- case 'g' :
1381
- ro .mode = MODE_GRAPH ;
1382
- // ro.pdc = true;
1383
- addr = opt .arg ;
1384
- break ;
1385
1375
case 'm' :
1386
1376
if (!select_graph_type (& ro , opt .arg )) {
1387
1377
R_LOG_ERROR ("Invalid input data selected (see -i help)" );
@@ -1391,33 +1381,35 @@ R_API int r_main_radiff2(int argc, const char **argv) {
1391
1381
case 'n' :
1392
1382
ro .showcount = true;
1393
1383
break ;
1394
- case 'O' :
1395
- ro .diffops = 1 ;
1384
+ case 'O' : // move to options
1385
+ ro .diffops = true ;
1396
1386
break ;
1397
- case 'T' : // imho `t <=> T`
1398
- ro .thready = true;
1399
- // printf ("%s\n", opt.arg);
1387
+ case 'p' :
1388
+ ro .useva = false;
1400
1389
break ;
1401
- case 't' :
1402
- ro .threshold = atoi (opt .arg );
1403
- // printf ("%s\n", opt.arg);
1390
+ case 'r' :
1391
+ ro .diffmode = 'r' ;
1404
1392
break ;
1405
- case 'h' :
1406
- return show_help (1 );
1407
1393
case 's' :
1394
+ // TODO: maybe use -a to select algorithm?
1408
1395
ro .mode = (ro .mode == MODE_DIST_MYERS )
1409
1396
? MODE_DIST_LEVENSHTEIN
1410
1397
: MODE_DIST_MYERS ;
1411
1398
break ;
1412
1399
case 'S' :
1413
1400
columnSort = opt .arg ;
1414
1401
break ;
1402
+ case 't' :
1403
+ ro .threshold = atoi (opt .arg );
1404
+ // printf ("%s\n", opt.arg);
1405
+ break ;
1406
+ case 'T' : // imho `t <=> T`
1407
+ ro .thready = true;
1408
+ // printf ("%s\n", opt.arg);
1409
+ break ;
1415
1410
case 'x' :
1416
1411
ro .mode = MODE_COLS ;
1417
1412
break ;
1418
- case 'X' :
1419
- ro .mode = MODE_COLSII ;
1420
- break ;
1421
1413
case 'u' :
1422
1414
ro .diffmode = 'u' ;
1423
1415
break ;
@@ -1432,12 +1424,6 @@ R_API int r_main_radiff2(int argc, const char **argv) {
1432
1424
case 'V' :
1433
1425
ro .verbose = true;
1434
1426
break ;
1435
- case 'z' :
1436
- ro .mode = MODE_DIFF_STRS ;
1437
- break ;
1438
- case 'Z' :
1439
- ro .zignatures = true;
1440
- break ;
1441
1427
default :
1442
1428
return show_help (0 );
1443
1429
}
0 commit comments