summaryrefslogtreecommitdiff
path: root/src/analysis
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2009-06-08 12:46:23 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2009-06-08 12:46:23 (GMT)
commitfc8324b66dee0abf0a5e5e3cc570e1aed96b80c8 (patch)
tree04b9220e34b8bdc3449cd73e54a32c5037be5f0c /src/analysis
parentdd75712aac8f70d18f07787d5d484d426600edeb (diff)
Refreshed the panel dealing with found symbols.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@72 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/analysis')
-rw-r--r--src/analysis/binary.c14
-rw-r--r--src/analysis/line_code.c19
-rw-r--r--src/analysis/line_comment.c19
-rw-r--r--src/analysis/prototype.c19
-rw-r--r--src/analysis/prototype.h3
5 files changed, 61 insertions, 13 deletions
diff --git a/src/analysis/binary.c b/src/analysis/binary.c
index 88201ac..01ccfdd 100644
--- a/src/analysis/binary.c
+++ b/src/analysis/binary.c
@@ -39,6 +39,7 @@
#include "line_comment.h"
#include "line_prologue.h"
#include "prototype.h"
+#include "../panel/log.h"
#include "../plugins/pglist.h"
@@ -117,23 +118,22 @@ openida_binary *load_binary_file(const char *filename)
switch (get_exe_target_machine(result->format))
{
case FTM_JVM:
- result->proc = get_arch_processor_for_type(APT_JVM);
+ log_simple_message(LMT_INFO, _("Detected architecture: Java Virtual Machine"));
break;
-
case FTM_MIPS:
- result->proc = get_arch_processor_for_type(APT_MIPS);
+ log_simple_message(LMT_INFO, _("Detected architecture: Microprocessor without Interlocked Pipeline Stages"));
break;
-
case FTM_386:
- result->proc = get_arch_processor_for_type(APT_386);
+ log_simple_message(LMT_INFO, _("Detected architecture: i386"));
break;
-
default:
+ log_simple_message(LMT_INFO, _("Unknown architecture"));
goto lbf_error;
break;
-
}
+ result->proc = get_arch_processor_from_format(result->format);
+
result->options.show_address = true;
result->options.show_code = true;
diff --git a/src/analysis/line_code.c b/src/analysis/line_code.c
index a234055..cd7eba6 100644
--- a/src/analysis/line_code.c
+++ b/src/analysis/line_code.c
@@ -174,15 +174,28 @@ void g_code_line_refresh_markup(GCodeLine *line)
if (line->options->show_address)
{
- switch (ADM_32BITS /* FIXME */)
+ switch (g_arch_processor_get_memory_size(line->options->proc))
{
- case ADM_32BITS:
+ case MDS_8_BITS:
+ snprintf(buffer, CODE_BUFFER_LEN,
+ "<span foreground='#333333'>0x%02llx</span>",
+ G_RENDERING_LINE(line)->offset);
+ break;
+
+ case MDS_16_BITS:
+ snprintf(buffer, CODE_BUFFER_LEN,
+ "<span foreground='#333333'>0x%04llx</span>",
+ G_RENDERING_LINE(line)->offset);
+ break;
+
+ case MDS_32_BITS:
snprintf(buffer, CODE_BUFFER_LEN,
"<span foreground='#333333'>0x%08llx</span>",
G_RENDERING_LINE(line)->offset);
break;
- case ADM_64BITS:
+ default:
+ case MDS_64_BITS:
snprintf(buffer, CODE_BUFFER_LEN,
"<span foreground='#333333'>0x%16llx</span>",
G_RENDERING_LINE(line)->offset);
diff --git a/src/analysis/line_comment.c b/src/analysis/line_comment.c
index ea6d6d6..1d37613 100644
--- a/src/analysis/line_comment.c
+++ b/src/analysis/line_comment.c
@@ -137,15 +137,28 @@ void g_comment_line_refresh_markup(GCommentLine *line)
if (line->options->show_address)
{
- switch (ADM_32BITS /* FIXME */)
+ switch (g_arch_processor_get_memory_size(line->options->proc))
{
- case ADM_32BITS:
+ case MDS_8_BITS:
+ snprintf(buffer, CODE_BUFFER_LEN,
+ "<span foreground='#333333'>0x%02llx</span>",
+ G_RENDERING_LINE(line)->offset);
+ break;
+
+ case MDS_16_BITS:
+ snprintf(buffer, CODE_BUFFER_LEN,
+ "<span foreground='#333333'>0x%04llx</span>",
+ G_RENDERING_LINE(line)->offset);
+ break;
+
+ case MDS_32_BITS:
snprintf(buffer, CODE_BUFFER_LEN,
"<span foreground='#333333'>0x%08llx</span>",
G_RENDERING_LINE(line)->offset);
break;
- case ADM_64BITS:
+ default:
+ case MDS_64_BITS:
snprintf(buffer, CODE_BUFFER_LEN,
"<span foreground='#333333'>0x%16llx</span>",
G_RENDERING_LINE(line)->offset);
diff --git a/src/analysis/prototype.c b/src/analysis/prototype.c
index 1e27f2c..78854f9 100644
--- a/src/analysis/prototype.c
+++ b/src/analysis/prototype.c
@@ -245,6 +245,25 @@ void g_binary_routine_set_name(GBinRoutine *routine, char *name)
/******************************************************************************
* *
* Paramètres : routine = routine à mettre à jour. *
+* *
+* Description : Fournit le nom humain d'une routine. *
+* *
+* Retour : Désignation humainement lisible ou NULL si non définie. *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+const char *g_binary_routine_get_name(const GBinRoutine *routine)
+{
+ return routine->name;
+
+}
+
+
+/******************************************************************************
+* *
+* Paramètres : routine = routine à mettre à jour. *
* var = variable représentant un type de retour. *
* *
* Description : Définit le type de retour d'une routine. *
diff --git a/src/analysis/prototype.h b/src/analysis/prototype.h
index 3fd822e..299cce6 100644
--- a/src/analysis/prototype.h
+++ b/src/analysis/prototype.h
@@ -75,6 +75,9 @@ void g_binary_routine_set_type(GBinRoutine *, RoutineType);
/* Définit le nom humain d'une routine. */
void g_binary_routine_set_name(GBinRoutine *, char *);
+/* Désignation humainement lisible ou NULL si non définie. */
+const char *g_binary_routine_get_name(const GBinRoutine *);
+
/* Définit le type de retour d'une routine. */
void g_binary_routine_set_return_type(GBinRoutine *, variable *);