From e01660dc52556163b013556cbcb719e6176507c9 Mon Sep 17 00:00:00 2001 From: pancake Date: Thu, 18 Aug 2022 10:30:42 +0200 Subject: [PATCH] Rename to io.basemap --- libr/core/cconfig.c | 1 + libr/core/cfile.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/libr/core/cconfig.c b/libr/core/cconfig.c index 6c8623c260..5221695a93 100644 --- a/libr/core/cconfig.c +++ b/libr/core/cconfig.c @@ -4195,6 +4195,7 @@ R_API int r_core_config_init(RCore *core) { SETCB ("io.pcache.write", "false", &cb_iopcachewrite, "enable write-cache"); SETCB ("io.pcache.read", "false", &cb_iopcacheread, "enable read-cache"); SETCB ("io.ff", "true", &cb_ioff, "fill invalid buffers with 0xff instead of returning error"); + SETBPREF ("io.basemap", "true", "create a map at base address 0 when opening a file"); SETICB ("io.mask", 0, &cb_iomask, "mask addresses before resolving as maps"); SETBPREF ("io.exec", "true", "see !!r2 -h~-x"); SETICB ("io.0xff", 0xff, &cb_io_oxff, "use this value instead of 0xff to fill unallocated areas"); diff --git a/libr/core/cfile.c b/libr/core/cfile.c index e9fb6dfeef..40417f3de0 100644 --- a/libr/core/cfile.c +++ b/libr/core/cfile.c @@ -692,7 +692,8 @@ R_API bool r_core_bin_load(RCore *r, const char *filenameuri, ut64 baddr) { } } } else { - if (desc) { + bool basemap = r_config_get_b (r->config, "io.basemap"); + if (desc && basemap) { r_io_map_add (r->io, desc->fd, desc->perm, 0, laddr, r_io_desc_size (desc)); } if (binfile) {