add pib command for basic block level disassembly (#7508)

This commit is contained in:
Ayman Khamouma 2017-05-17 08:28:57 +02:00 committed by radare
parent 7d7c9cb5a7
commit a68254d76a

View File

@ -3317,7 +3317,7 @@ static int cmd_print(void *data, const char *input) {
// r_cons_printf ("|Usage: pi[defj] [num]\n");
{
const char *help_msg[] = {
"Usage:", "pi[defrj] [num]", "",
"Usage:", "pi[bdefrj] [num]", "",
"pir", "", "like 'pdr' but with 'pI' output",
NULL
};
@ -3374,6 +3374,17 @@ static int cmd_print(void *data, const char *input) {
}
}
break;
case 'b': //pib
{
RAnalBlock *b = r_anal_bb_from_offset (core->anal, core->offset);
if (b) {
r_core_print_disasm_instructions (core, b->size - (core->offset - b->addr), 0);
} else {
eprintf ("Cannot find function at 0x%08"PFMT64x "\n", core->offset);
core->num->value = 0;
}
}
break;
default:
if (l != 0) {
r_core_print_disasm_instructions (core, 0, l);