Skip to content

Commit

Permalink
Restore baddr after debug ends when oo'ing (#10774)
Browse files Browse the repository at this point in the history
  • Loading branch information
fcasal authored and radare committed Jul 18, 2018
1 parent 51e2936 commit f86af30
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions libr/core/cbin.c
Expand Up @@ -106,6 +106,7 @@ R_API int r_core_bin_set_env(RCore *r, RBinFile *binfile) {
ut16 bits = info->bits;
ut64 baseaddr = r_bin_get_baddr (r->bin);
r_config_set_i (r->config, "bin.baddr", baseaddr);
sdb_num_add (r->sdb, "orig_baddr", baseaddr, 0);
r_config_set (r->config, "asm.arch", arch);
r_config_set_i (r->config, "asm.bits", bits);
r_config_set (r->config, "anal.arch", arch);
Expand Down
4 changes: 4 additions & 0 deletions libr/core/cmd_open.c
Expand Up @@ -1486,6 +1486,10 @@ static int cmd_open(void *data, const char *input) {
r_core_cmd0 (core, "ob-*");
r_io_close_all (core->io);
r_config_set (core->config, "cfg.debug", "false");
ut64 orig_baddr = sdb_num_get (core->sdb, "orig_baddr", 0);
r_bin_set_baddr (core->bin, orig_baddr);
r_config_set_i (core->config, "bin.baddr", orig_baddr);
r_core_bin_rebase (core, orig_baddr);
r_core_cmdf (core, "o %s", file);
free (file);
} else {
Expand Down

0 comments on commit f86af30

Please sign in to comment.