diff --git a/libr/include/r_io.h b/libr/include/r_io.h index 949cb15f7b..c630b0e239 100644 --- a/libr/include/r_io.h +++ b/libr/include/r_io.h @@ -198,6 +198,7 @@ typedef ut8 * (*RIODescRead)(RIO *io, RIODesc *desc, ut64 *sz); typedef ut64 (*RIODescSeek)(RIO *io, RIODesc *desc, ut64 offset); typedef ut64 (*RIODescSize)(RIO *io, RIODesc *desc); typedef int (*RIOIsValidOffset)(RIO *io, ut64 addr, int hasperm); +typedef RIOSection* (*RIOSectionVGet)(RIO *io, ut64 addr); typedef RIOSection* (*RIOSectionAdd)(RIO *io, ut64 offset, ut64 vaddr, ut64 size, ut64 vsize, int rwx, const char *name, ut32 bin_id, int fd); typedef int (*RIOSectionSetArchBinID)(RIO *io, ut64 addr, const char *arch, int bits, ut32 bin_id); @@ -215,6 +216,7 @@ typedef struct r_io_bind_t { RIOSeek seek; RIOIsValidOffset is_valid_offset; + RIOSectionVGet section_vget; RIOSectionAdd section_add; RIOSectionSetArchBin section_set_arch; RIOSectionSetArchBinID section_set_arch_bin_id; diff --git a/libr/io/io.c b/libr/io/io.c index 29f26c43e9..077e0ebdb5 100644 --- a/libr/io/io.c +++ b/libr/io/io.c @@ -299,7 +299,6 @@ R_API int r_io_read_internal(RIO *io, ut8 *buf, int len) { } else if (!io->desc) { if (io->files && r_list_length (io->files) != 0) { eprintf ("Something really bad has happened, and r2 is going to die soon. sorry! :-(\n"); - r_sys_backtrace (); } read_from = "FAILED"; bytes_read = 0; @@ -866,6 +865,7 @@ R_API int r_io_bind(RIO *io, RIOBind *bnd) { bnd->desc_get_by_fd = r_io_desc_get; bnd->section_add = r_io_section_add; + bnd->section_vget = r_io_section_vget; bnd->section_set_arch = r_io_section_set_archbits; bnd->section_set_arch_bin_id = r_io_section_set_archbits_bin_id; diff --git a/libr/io/p/io_default.c b/libr/io/p/io_default.c index 2144189f25..0c65dc86f6 100644 --- a/libr/io/p/io_default.c +++ b/libr/io/p/io_default.c @@ -147,7 +147,6 @@ static int r_io_def_mmap_read(RIO *io, RIODesc *fd, ut8 *buf, int count) { // in this case we fallback reopening in raw mode return -1; } - if (io->off==UT64_MAX) { memset (buf, 0xff, count); return count;