Initial work to support entropy graphs in rahash2 via r2
- Wip. related to #9871
This commit is contained in:
parent
9796e09258
commit
154c638ec2
|
@ -1,4 +1,4 @@
|
|||
/* radare - LGPL - Copyright 2009-2017 - pancake */
|
||||
/* radare - LGPL - Copyright 2009-2018 - pancake */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
@ -429,6 +429,7 @@ int main(int argc, char **argv) {
|
|||
int ivlen = -1;
|
||||
char *ivseed = NULL;
|
||||
const char *compareStr = NULL;
|
||||
const char *ptype = NULL;
|
||||
ut8 *compareBin = NULL;
|
||||
int hashstr_len = -1;
|
||||
int hashstr_hex = 0;
|
||||
|
@ -437,7 +438,7 @@ int main(int argc, char **argv) {
|
|||
RHash *ctx;
|
||||
RIO *io;
|
||||
|
||||
while ((c = getopt (argc, argv, "jD:rveE:a:i:I:S:s:x:b:nBhf:t:kLqc:")) != -1) {
|
||||
while ((c = getopt (argc, argv, "p:jD:rveE:a:i:I:S:s:x:b:nBhf:t:kLqc:")) != -1) {
|
||||
switch (c) {
|
||||
case 'q': quiet++; break;
|
||||
case 'i':
|
||||
|
@ -457,6 +458,7 @@ int main(int argc, char **argv) {
|
|||
case 'e': ule = 1; break;
|
||||
case 'r': rad = 1; break;
|
||||
case 'k': rad = 2; break;
|
||||
case 'p': ptype = optarg; break;
|
||||
case 'a': algo = optarg; break;
|
||||
case 'B': incremental = 0; break;
|
||||
case 'b': bsize = (int) r_num_math (NULL, optarg); break;
|
||||
|
@ -523,6 +525,16 @@ int main(int argc, char **argv) {
|
|||
return 1;
|
||||
}
|
||||
}
|
||||
if (ptype) {
|
||||
// TODO: support p=%s (horizontal bars)
|
||||
// TODO: list supported statistical metrics
|
||||
// TODO: support -f and -t
|
||||
for (i = optind; i < argc; i++) {
|
||||
printf ("%s:\n", argv[i]);
|
||||
r_sys_cmdf ("r2 -qfnc \"p==%s 100\" \"%s\"", ptype, argv[i]);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
// convert iv to hex or string.
|
||||
if (ivseed) {
|
||||
iv = (ut8 *) malloc (strlen (ivseed) + 128);
|
||||
|
|
|
@ -10,11 +10,12 @@
|
|||
.Op Fl b Ar size
|
||||
.Op Fl D Ar algo
|
||||
.Op Fl E Ar algo
|
||||
.Op Fl s Ar string
|
||||
.Op Fl f Ar from
|
||||
.Op Fl i Ar iterations
|
||||
.Op Fl I Ar IV
|
||||
.Op Fl s Ar string
|
||||
.Op Fl S Ar seed
|
||||
.Op Fl f Ar from
|
||||
.Op Fl p Ar type
|
||||
.Op Fl x Ar hexstr
|
||||
.Op Fl t Ar to
|
||||
.Op Fl c Ar hash
|
||||
|
@ -60,6 +61,8 @@ Set seed to hash with, use ^to prefix seed, otherwise its suffixed. If the seed
|
|||
Start hashing at given address
|
||||
.It Fl t Ar to
|
||||
Stop hashing at given address
|
||||
.It Fl p Ar arg
|
||||
Show vertical entropy/statistical entropy graphs
|
||||
.It Fl q
|
||||
Quiet mode (-qq for even quieter!)
|
||||
.It Fl r
|
||||
|
|
Loading…
Reference in New Issue