Faster frida://0 startup times ##io

* Do not try to guess the bintype on address 0 when using frida://
This commit is contained in:
pancake 2023-11-15 17:58:07 +01:00 committed by pancake
parent 1be1cc0270
commit e9cf9ea106
3 changed files with 30 additions and 31 deletions

View File

@ -51,19 +51,17 @@ static void print_string(RBinFile *bf, RBinString *string, int raw, PJ *pj) {
// PrintfCallback temp = io->cb_printf;
switch (mode) {
case R_MODE_JSON:
{
if (pj) {
pj_o (pj);
pj_kn (pj, "vaddr", vaddr);
pj_kn (pj, "paddr", string->paddr);
pj_kn (pj, "ordinal", string->ordinal);
pj_kn (pj, "size", string->size);
pj_kn (pj, "length", string->length);
pj_ks (pj, "section", section_name);
pj_ks (pj, "type", type_string);
pj_ks (pj, "string", string->string);
pj_end (pj);
}
if (pj) {
pj_o (pj);
pj_kn (pj, "vaddr", vaddr);
pj_kn (pj, "paddr", string->paddr);
pj_kn (pj, "ordinal", string->ordinal);
pj_kn (pj, "size", string->size);
pj_kn (pj, "length", string->length);
pj_ks (pj, "section", section_name);
pj_ks (pj, "type", type_string);
pj_ks (pj, "string", string->string);
pj_end (pj);
}
break;
case R_MODE_SIMPLEST:

View File

@ -61,25 +61,22 @@ static RList *strings(RBinFile *bf) {
}
static RBinInfo* info(RBinFile *bf) {
RBinInfo *ret = NULL;
if (!bf) {
return NULL;
r_return_val_if_fail (bf, NULL);
RBinInfo *ret = R_NEW0 (RBinInfo);
if (ret) {
ret->file = bf->file? strdup (bf->file): NULL;
ret->type = strdup ("fs");
ret->bclass = fsname (bf->buf);
ret->rclass = strdup ("fs");
ret->os = strdup ("any");
ret->subsystem = strdup ("unknown");
ret->machine = strdup ("any");
// ret->arch = strdup ("any");
ret->has_va = 0;
ret->bits = 32;
ret->big_endian = 0;
ret->dbg_info = 0;
}
if (!(ret = R_NEW0 (RBinInfo))) {
return NULL;
}
ret->file = bf->file? strdup (bf->file): NULL;
ret->type = strdup ("fs");
ret->bclass = fsname (bf->buf);
ret->rclass = strdup ("fs");
ret->os = strdup ("any");
ret->subsystem = strdup ("unknown");
ret->machine = strdup ("any");
// ret->arch = strdup ("any");
ret->has_va = 0;
ret->bits = 32;
ret->big_endian = 0;
ret->dbg_info = 0;
return ret;
}

View File

@ -639,6 +639,10 @@ R_API bool r_core_bin_load(RCore *r, const char *filenameuri, ut64 baddr) {
bool is_io_load = false;
if (desc && desc->plugin) {
is_io_load = true;
if (r_str_startswith (filenameuri, "frida://")) {
// dont try to guess the bin file in the address 0 if we are using r2frida
is_io_load = false;
}
// r_io_use_fd (r->io, desc->fd);
}
r->bin->minstrlen = r_config_get_i (r->config, "bin.str.min");