diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2015-10-01 16:26:32 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2015-10-01 16:26:32 (GMT) |
commit | d7ea656a1d8d5eea24ca9356466765f800166779 (patch) | |
tree | f5558d2e9fe50f5b6cc52970b6965d633c38df92 /src | |
parent | 7e5540029350ab7e69ee8f75c96fc3fbc9ad5751 (diff) |
Fixed mistakes when loading or saving binary contents.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@584 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src')
-rw-r--r-- | src/analysis/binary.c | 17 | ||||
-rw-r--r-- | src/analysis/project.c | 2 |
2 files changed, 14 insertions, 5 deletions
diff --git a/src/analysis/binary.c b/src/analysis/binary.c index a1eb09f..f74f613 100644 --- a/src/analysis/binary.c +++ b/src/analysis/binary.c @@ -425,7 +425,11 @@ GLoadedBinary *g_loaded_binary_new_from_xml(xmlXPathContextPtr context, const ch return NULL; } - xobject = get_node_xpath_object(context, "/ChrysalideProject/Contents/Content"); + asprintf(&access, "%s/DebugInfo", content_path); + + xobject = get_node_xpath_object(context, access); + + free(access); for (i = 0; i < XPATH_OBJ_NODES_COUNT(xobject); i++) { @@ -1252,15 +1256,18 @@ bool g_loaded_binary_attach_debug_info(GLoadedBinary *binary, GBinContent *conte const char *desc; /* Description humaine associée*/ GDbgFormat *debug; /* Format de débogage trouvé */ - result = false; - status = find_matching_format(content, binary->format, &target); if (status == FMS_MATCHED) { + result = false; + desc = get_binary_format_name(target); - if (desc != NULL) + if (desc == NULL) + log_simple_message(LMT_INFO, _("Unknown binary debug format")); + + else { log_variadic_message(LMT_INFO, _("Detected debug format: %s"), desc); @@ -1280,6 +1287,8 @@ bool g_loaded_binary_attach_debug_info(GLoadedBinary *binary, GBinContent *conte free(target); } + else + result = true; return result; diff --git a/src/analysis/project.c b/src/analysis/project.c index 616d854..902b5a8 100644 --- a/src/analysis/project.c +++ b/src/analysis/project.c @@ -387,7 +387,7 @@ bool g_study_project_save(GStudyProject *project, const char *filename) for (i = 0; i < project->contents_count && result; i++) { - if (!project->contents[i].state == PCS_INTERNAL) continue; + if (project->contents[i].state == PCS_INTERNAL) continue; access_len = strlen("/ChrysalideProject/Contents/Content[position()=") + SIZE_T_MAXLEN + strlen("]") + 1; |