Fixed issue where strings were not loaded from bin_strings, because r->bin->minstrlen is zero (set from r_config) (fixed in set_items and r_bin_io_load)

This commit is contained in:
Adam Pridgen 2013-12-02 22:46:19 -06:00 committed by pancake
parent 44a959fa78
commit b71bf37622
3 changed files with 54 additions and 425 deletions

View File

@ -253,6 +253,9 @@ R_API int r_bin_io_load(RBin *bin, RIO *io, RIODesc *desc, int dummy) {
}
}
if (bin->minstrlen<=0 && a->curplugin && a->curplugin->minstrlen)
bin->minstrlen = a->curplugin->minstrlen;
if (a->curplugin && a->curplugin->load ) {
if ( a->curplugin->load(a) )
set_bin_items(bin, a->curplugin);
@ -280,7 +283,7 @@ R_API int r_bin_init_items(RBin *bin, int dummy) {
}
}
cp = a->curplugin;
if (minlen<0) {
if (minlen<=0) {
if (cp && cp->minstrlen)
minlen = cp->minstrlen;
else minlen = -minlen;

View File

@ -164,17 +164,19 @@ R_API int r_core_bin_load(RCore *r, const char *file, ut64 baddr) {
/* r_bin_select, r_bin_select_idx and r_bin_load end up loading the bin */
r->bin->cur.rawstr = r_config_get_i (r->config, "bin.rawstr");
if( is_io_load ) {
// XXX - May need to set r_config stuff in the basic bin.
// XXX - May need to handle additional extraction here as well
r->bin->minstrlen = r_config_get_i (r->config, "bin.minstr");
// XXX - May need to handle additional extraction here as well
r_bin_io_load(r->bin, r->io, r->file->fd, R_FALSE);
{ // Making sure the RBinObject gets set
RBinObject *_obj = r_bin_get_object (r->bin);
if (_obj && _obj->info && _obj->info->bits) {
r_config_set_i (r->config, "asm.bits", _obj->info->bits);
r->file->obj = _obj;
}
if (_obj) _obj->baddr = baddr;
r_bin_select (r->bin, r->assembler->cur->arch, r->assembler->bits, NULL);
}
} else if(r_bin_load (r->bin, file, R_FALSE)) { // --->
if (r->bin->narch>1 && r_config_get_i (r->config, "scr.prompt")) {

File diff suppressed because it is too large Load Diff