Enhancements for the p=ej

This commit is contained in:
pancake 2016-03-27 00:32:12 +01:00
parent e1c120e654
commit f641200bdc
2 changed files with 4 additions and 2 deletions

View File

@ -1733,11 +1733,13 @@ static void cmd_print_bars(RCore *core, const char *input) {
int i;
switch (submode) {
case 'j':
r_cons_printf ("{\"blocksize\":%d,\"entropy\":[", blocksize);
r_cons_printf ("{\"blocksize\":%d,\"address\":%"PFMT64d",\"size\":%"PFMT64d",\"entropy\":[",
blocksize, core->offset, totalsize);
for (i = 0; i < nblocks; i++) {
ut8 ep = ptr[i];
ut64 off = blocksize * i;
const char *comma = (i+1< (nblocks))?",": "";
off += core->offset;
r_cons_printf ("{\"addr\":%"PFMT64d",\"value\":%d}%s",
off, ep, comma);

View File

@ -315,7 +315,7 @@ static ut64 num_callback(RNum *userptr, const char *str, int *ok) {
if (!s->vaddr && s->offset) continue;
if (s->vaddr < lower) lower = s->vaddr;
}
return lower;
return (lower == UT64_MAX)? 0LL: lower;
}
break;
case 'v': return op.val; // immediate value