Fix some COVs

This commit is contained in:
pancake 2014-12-22 15:40:39 +01:00
parent 94bdaf75d9
commit 90901e2928
3 changed files with 16 additions and 15 deletions

View File

@ -612,15 +612,15 @@ static ut8 bin_reloc_size (RBinReloc *reloc) {
}
static char *resolveModuleOrdinal (Sdb *sdb, const char *module, int ordinal) {
char res[128], *foo;
#if 0
char res[128], *foo;
Sdb *db = sdb_ns_path (sdb, "bin/pe", 0);
if (!db) return NULL;
db = sdb_ns (db, module, 0);
if (!db) return NULL;
#endif
Sdb *db = sdb;
foo = sdb_get (db, sdb_fmt (0, "%d", ordinal), 0);
char *foo = sdb_get (db, sdb_fmt (0, "%d", ordinal), 0);
if (foo && *foo) {
return foo;
}
@ -1033,21 +1033,20 @@ static int bin_symbols (RCore *r, int mode, ut64 baddr, ut64 laddr, int va, ut64
{
RBinFile * binfile = r_core_bin_cur (r);
RBinPlugin *plugin = r_bin_file_cur_plugin (binfile);
if (plugin && plugin->name) {
if (!strncmp (plugin->name, "pe", 2)) {
char *p, *module = strdup (symbol->name);
p = strstr (module, ".dll_");
if (p) {
const char *symname = p+5;
*p = 0;
r_cons_printf ("k bin/pe/%s/%d=%s\n", module,
symbol->ordinal, symname);
r_cons_printf ("fr reloc.%s.dll_Ordinal_%d reloc.%s_%s\n",
module, symbol->ordinal, module, symname);
if (plugin && plugin->name) {
if (!strncmp (plugin->name, "pe", 2)) {
char *p, *module = strdup (symbol->name);
p = strstr (module, ".dll_");
if (p) {
const char *symname = p+5;
*p = 0;
r_cons_printf ("k bin/pe/%s/%d=%s\n", module,
symbol->ordinal, symname);
}
free (module);
}
}
}
}
} else r_cons_printf ("vaddr=0x%08"PFMT64x" paddr=0x%08"PFMT64x" ord=%03u "
"fwd=%s sz=%u bind=%s type=%s name=%s\n",
addr, symbol->paddr,

View File

@ -771,6 +771,7 @@ static int r_core_search_rop(RCore *core, ut64 from, ut64 to, int opt, const cha
if (delta < 1) {
free (gregexp);
r_list_free (rx_list);
r_list_free (badstart);
return R_FALSE;
}
}
@ -780,6 +781,7 @@ static int r_core_search_rop(RCore *core, ut64 from, ut64 to, int opt, const cha
free (gregexp);
r_list_free (rx_list);
r_list_free (end_list);
r_list_free (badstart);
return -1;
}
r_io_read_at (core->io, from, buf, delta);

View File

@ -787,7 +787,7 @@ R_API int r_core_file_list(RCore *core, int mode) {
r_cons_printf ("{\"raised\":%s,\"fd\":%d,\"uri\":\"%s\",\"from\":%"
PFMT64d",\"writable\":%s,\"size\":%d,\"overlaps\":%s}%s",
core->io->raised == f->desc->fd?"true":"false",
f->desc->fd, f->desc->uri, f->map->from,
f->desc->fd, f->desc->uri, from,
f->desc->flags & R_IO_WRITE? "true": "false",
r_io_desc_size (core->io, f->desc),
overlapped?"true":"false",