From d7ea656a1d8d5eea24ca9356466765f800166779 Mon Sep 17 00:00:00 2001 From: Cyrille Bagard Date: Thu, 1 Oct 2015 16:26:32 +0000 Subject: Fixed mistakes when loading or saving binary contents. git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@584 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a --- ChangeLog | 6 ++++++ src/analysis/binary.c | 17 +++++++++++++---- src/analysis/project.c | 2 +- 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 49c6f77..a98f9fc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 15-10-01 Cyrille Bagard + * src/analysis/binary.c: + * src/analysis/project.c: + Fix mistakes when loading or saving binary contents. + +15-10-01 Cyrille Bagard + * src/format/elf/symbols.c: Fix the support of ELF internal arrays. 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; -- cgit v0.11.2-87-g4458