added ib to the cmd_info feature
This commit is contained in:
parent
223563a8ac
commit
22e04b7f6b
|
@ -1,5 +1,4 @@
|
|||
/* radare - LGPL - Copyright 2009-2013 - pancake */
|
||||
|
||||
static void r_core_file_info (RCore *core, int mode) {
|
||||
const char *fn = NULL;
|
||||
int dbg = r_config_get_i (core->config, "cfg.debug");
|
||||
|
@ -87,6 +86,17 @@ static int cmd_info(void *data, const char *input) {
|
|||
}
|
||||
|
||||
switch (*input) {
|
||||
case 'b':
|
||||
{
|
||||
ut64 baddr = r_config_get_i (core->config, "bin.baddr");
|
||||
// XXX: this will reload the bin using the buffer.
|
||||
// An assumption is made that assumes there is an underlying
|
||||
// plugin that will be used to load the bin (e.g. malloc://)
|
||||
// TODO: Might be nice to reload a bin at a specified offset?
|
||||
r_core_bin_reload (core, NULL, baddr);
|
||||
r_core_block_read (core, 0);
|
||||
}
|
||||
break;
|
||||
case 'k':
|
||||
db = core->bin->cur.o->kv;
|
||||
eprintf ("db = %p\n", db);
|
||||
|
@ -157,6 +167,7 @@ eprintf ("db = %p\n", db);
|
|||
"| iS sections\n"
|
||||
"| ir/iR relocs\n"
|
||||
"| iz strings\n"
|
||||
"| ib reload the current buffer for setting of the bin (use once only)\n"
|
||||
);
|
||||
break;
|
||||
case '*': mode = R_CORE_BIN_RADARE;
|
||||
|
|
|
@ -163,6 +163,13 @@ static ut64 get_base_from_maps(RCore *core, const char *file) {
|
|||
return b;
|
||||
}
|
||||
|
||||
R_API int r_core_bin_reload(RCore *r, const char *file, ut64 baddr) {
|
||||
r_bin_free (r->bin);
|
||||
r->bin = r_bin_new ();
|
||||
r_bin_set_user_ptr (r->bin, r);
|
||||
r_core_bin_load (r, file, baddr);
|
||||
}
|
||||
|
||||
R_API int r_core_bin_load(RCore *r, const char *file, ut64 baddr) {
|
||||
int i, va = r->io->va || r->io->debug;
|
||||
RListIter *iter;
|
||||
|
|
|
@ -275,6 +275,7 @@ R_API int r_core_print_disasm(RPrint *p, RCore *core, ut64 addr, ut8 *buf, int l
|
|||
R_API int r_core_print_disasm_json(RCore *core, ut64 addr, ut8 *buf, int len);
|
||||
R_API int r_core_print_disasm_instructions (RCore *core, int len, int l);
|
||||
|
||||
R_API int r_core_bin_reload(RCore *core, const char *file, ut64 baddr);
|
||||
R_API int r_core_bin_load(RCore *core, const char *file, ut64 baddr);
|
||||
R_API int r_core_hash_load(RCore *core, const char *file);
|
||||
|
||||
|
|
Loading…
Reference in New Issue