Fix #3471 - Show number of matches in 'z'

This commit is contained in:
pancake 2015-10-14 16:55:55 +02:00
parent b2df63cba2
commit b8224a153f
3 changed files with 8 additions and 2 deletions

View File

@ -1,4 +1,4 @@
/* radare - LGPL - Copyright 2009-2014 - pancake */
/* radare - LGPL - Copyright 2009-2015 - pancake */
#include <r_sign.h>
#include <r_anal.h>
@ -112,6 +112,7 @@ R_API void r_sign_list(RSign *sig, int rad) {
sig->cb_printf (" %d byte signatures\n", sig->s_byte);
sig->cb_printf (" %d head signatures\n", sig->s_head);
sig->cb_printf (" %d func signatures\n", sig->s_func);
sig->cb_printf ("Found %d matches\n", sig->matches);
}
}

View File

@ -164,7 +164,11 @@ static int cmd_zign(void *data, const char *input) {
} else eprintf ("Cannot read %d bytes at 0x%08"PFMT64x"\n", len, ini);
r_cons_break_end ();
free (buf);
} else eprintf ("Cannot alloc %d bytes\n", len);
core->sign->matches = count;
} else {
eprintf ("Cannot alloc %d bytes\n", len);
core->sign->matches = 0;
}
}
break;
case '\0':

View File

@ -37,6 +37,7 @@ typedef struct r_sign_t {
char ns[32]; // namespace
PrintfCallback cb_printf;
RList *items;
int matches;
} RSign;
typedef int (*RSignCallback)(RSignItem *si, void *user);