mirror of
https://github.com/radareorg/radare2.git
synced 2024-12-13 16:18:33 +00:00
Add iobind.section_vget
This commit is contained in:
parent
8abc606b5e
commit
83b9633ac2
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user