add r_io-wrappers in r_bin

This commit is contained in:
condret 2015-08-24 00:30:05 +02:00
parent 5663e41177
commit 06076207fb
2 changed files with 20 additions and 0 deletions

View File

@ -1880,3 +1880,19 @@ R_API void r_bin_force_plugin (RBin *bin, const char *name) {
bin->force = strdup (name);
} else bin->force = NULL;
}
R_API int r_bin_read_at (RBin *bin, ut64 addr, ut8 *buf, int size)
{
RIOBind *iob;
if (!bin || !(iob = &(bin->iob)))
return R_FALSE;
return iob->read_at (iob->io, addr, buf, size);
}
R_API int r_bin_write_at (RBin *bin, ut64 addr, const ut8 *buf, int size)
{
RIOBind *iob;
if (!bin || !(iob = &(bin->iob)))
return R_FALSE;
return iob->write_at (iob->io, addr, buf, size);
}

View File

@ -392,6 +392,10 @@ R_API int r_bin_xtr_add(RBin *bin, RBinXtrPlugin *foo);
R_API void* r_bin_free(RBin *bin);
R_API int r_bin_load_languages(RBinFile *binfile);
R_API int r_bin_dump_strings(RBinFile *a, int min);
//io-wrappers
R_API int r_bin_read_at (RBin *bin, ut64 addr, ut8 *buf, int size);
R_API int r_bin_write_at (RBin *bin, ut64 addr, const ut8 *buf, int size);
// ref
R_API int r_bin_file_deref_by_bind (RBinBind * binb);
R_API int r_bin_file_deref (RBin *bin, RBinFile * a);