mirror of
https://github.com/radareorg/radare2.git
synced 2024-11-25 06:09:50 +00:00
Fix r_bin.h (should fix bindings) and more MAKE_JOBS
This commit is contained in:
parent
f285f098b3
commit
a0da04cb16
@ -1,4 +1,4 @@
|
||||
/* radare - LGPL - Copyright 2009-2014 - pancake, nibble */
|
||||
/* radare - LGPL - Copyright 2009-2014 - pancake, nibble, dso */
|
||||
|
||||
// TODO: dlopen library and show address
|
||||
|
||||
@ -317,6 +317,7 @@ static void set_bin_items(RBinFile *binfile, RBinPlugin *cp) {
|
||||
|
||||
// XXX - this is a rather hacky way to do things, there may need to be a better way.
|
||||
R_API int r_bin_load(RBin *bin, const char *file, ut64 baseaddr, ut64 loadaddr, int xtr_idx, int fd, int rawstr) {
|
||||
// ALIAS? return r_bin_load_as (bin, file, baseaddr, loadaddr, xtr_idx, fd, rawstr, 0, file);
|
||||
RIOBind *iob = &(bin->iob);
|
||||
RIO *io = iob ? iob->get_io(iob) : NULL;
|
||||
RIODesc *desc = NULL;
|
||||
@ -333,9 +334,12 @@ R_API int r_bin_load_as(RBin *bin, const char *file, ut64 baseaddr, ut64 loadadd
|
||||
RIODesc *desc = NULL;
|
||||
if (!io) return R_FALSE;
|
||||
|
||||
desc = fd == -1 ? iob->desc_open (io, file, O_RDONLY, 0644) : iob->desc_get_by_fd (io, fd);
|
||||
desc = fd == -1 ?
|
||||
iob->desc_open (io, file, O_RDONLY, 0644) :
|
||||
iob->desc_get_by_fd (io, fd);
|
||||
if (!desc) return R_FALSE;
|
||||
return r_bin_load_io_at_offset_as (bin, desc, baseaddr, loadaddr, xtr_idx, fileoffset, name);
|
||||
return r_bin_load_io_at_offset_as (bin, desc, baseaddr,
|
||||
loadaddr, xtr_idx, fileoffset, name);
|
||||
}
|
||||
|
||||
R_API int r_bin_load_io(RBin *bin, RIODesc *desc, ut64 baseaddr, ut64 loadaddr, int xtr_idx) {
|
||||
@ -360,8 +364,6 @@ R_API int r_bin_load_io_at_offset_as(RBin *bin, RIODesc *desc, ut64 baseaddr, ut
|
||||
if (sz == UT64_MAX || sz>(64*1024*1024)) // too big, probably wrong
|
||||
return R_FALSE;
|
||||
|
||||
|
||||
|
||||
buf_bytes = iob->desc_read (io, desc, &len_bytes);
|
||||
if (!buf_bytes || offset >= sz) {
|
||||
free (buf_bytes);
|
||||
|
@ -329,11 +329,16 @@ typedef struct r_bin_bind_t {
|
||||
|
||||
/* bin.c */
|
||||
// XXX - delete r_bin_load after June 2014 if no issues arise
|
||||
//R_API int r_bin_load(RBin *bin, const char *file, ut64 baseaddr, ut64 loadaddr, int xtr_idx, int fd, int rawstr);
|
||||
R_API int r_bin_load(RBin *bin, const char *file, ut64 baseaddr, ut64 loadaddr, int xtr_idx, int fd, int rawstr);
|
||||
R_API int r_bin_load_as(RBin *bin, const char *file, ut64 baseaddr, ut64 loadaddr, int xtr_idx, int fd, int rawstr, int fileoffset, const char *name);
|
||||
R_API int r_bin_load_io(RBin *bin, RIODesc *desc, ut64 baseaddr, ut64 loadaddr, int xtr_idx);
|
||||
R_API int r_bin_load_io_at_offset_as(RBin *bin, RIODesc *desc, ut64 baseaddr, ut64 loadaddr, int xtr_idx, ut64 offset, const char *name);
|
||||
R_API int r_bin_load_io_at_offset(RBin *bin, RIODesc *desc, ut64 baseaddr, ut64 loadaddr, int xtr_idx);
|
||||
R_API void r_bin_bind(RBin *b, RBinBind *bnd);
|
||||
R_API int r_bin_add(RBin *bin, RBinPlugin *foo);
|
||||
R_API int r_bin_xtr_add(RBin *bin, RBinXtrPlugin *foo);
|
||||
R_API void* r_bin_free(RBin *bin);
|
||||
// ref
|
||||
R_API int r_bin_file_deref_by_bind (RBinBind * binb);
|
||||
R_API int r_bin_file_deref (RBin *bin, RBinFile * a);
|
||||
R_API int r_bin_file_ref_by_bind (RBinBind * binb);
|
||||
|
@ -38,4 +38,4 @@ ${MAKE} mrproper > /dev/null 2>&1
|
||||
[ "`uname`" = Linux ] && export LDFLAGS="-Wl,--as-needed"
|
||||
rm -f plugins.cfg
|
||||
./configure ${CFGARG} --prefix=${PREFIX} || exit 1
|
||||
exec ${MAKE} -s -j ${MAKE_JOBS}
|
||||
exec ${MAKE} -s -j${MAKE_JOBS} MAKE_JOBS=${MAKE_JOBS}
|
||||
|
Loading…
Reference in New Issue
Block a user