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) { static char *resolveModuleOrdinal (Sdb *sdb, const char *module, int ordinal) {
char res[128], *foo;
#if 0 #if 0
char res[128], *foo;
Sdb *db = sdb_ns_path (sdb, "bin/pe", 0); Sdb *db = sdb_ns_path (sdb, "bin/pe", 0);
if (!db) return NULL; if (!db) return NULL;
db = sdb_ns (db, module, 0); db = sdb_ns (db, module, 0);
if (!db) return NULL; if (!db) return NULL;
#endif #endif
Sdb *db = sdb; 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) { if (foo && *foo) {
return 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); RBinFile * binfile = r_core_bin_cur (r);
RBinPlugin *plugin = r_bin_file_cur_plugin (binfile); RBinPlugin *plugin = r_bin_file_cur_plugin (binfile);
if (plugin && plugin->name) { if (plugin && plugin->name) {
if (!strncmp (plugin->name, "pe", 2)) { if (!strncmp (plugin->name, "pe", 2)) {
char *p, *module = strdup (symbol->name); char *p, *module = strdup (symbol->name);
p = strstr (module, ".dll_"); p = strstr (module, ".dll_");
if (p) { if (p) {
const char *symname = p+5; const char *symname = p+5;
*p = 0; *p = 0;
r_cons_printf ("k bin/pe/%s/%d=%s\n", module, r_cons_printf ("k bin/pe/%s/%d=%s\n", module,
symbol->ordinal, symname); symbol->ordinal, symname);
r_cons_printf ("fr reloc.%s.dll_Ordinal_%d reloc.%s_%s\n", }
module, symbol->ordinal, module, symname); free (module);
} }
} }
} }
}
} else r_cons_printf ("vaddr=0x%08"PFMT64x" paddr=0x%08"PFMT64x" ord=%03u " } 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", "fwd=%s sz=%u bind=%s type=%s name=%s\n",
addr, symbol->paddr, 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) { if (delta < 1) {
free (gregexp); free (gregexp);
r_list_free (rx_list); r_list_free (rx_list);
r_list_free (badstart);
return R_FALSE; 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); free (gregexp);
r_list_free (rx_list); r_list_free (rx_list);
r_list_free (end_list); r_list_free (end_list);
r_list_free (badstart);
return -1; return -1;
} }
r_io_read_at (core->io, from, buf, delta); 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\":%" r_cons_printf ("{\"raised\":%s,\"fd\":%d,\"uri\":\"%s\",\"from\":%"
PFMT64d",\"writable\":%s,\"size\":%d,\"overlaps\":%s}%s", PFMT64d",\"writable\":%s,\"size\":%d,\"overlaps\":%s}%s",
core->io->raised == f->desc->fd?"true":"false", 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", f->desc->flags & R_IO_WRITE? "true": "false",
r_io_desc_size (core->io, f->desc), r_io_desc_size (core->io, f->desc),
overlapped?"true":"false", overlapped?"true":"false",