summaryrefslogtreecommitdiff
path: root/src/analysis
diff options
context:
space:
mode:
Diffstat (limited to 'src/analysis')
-rw-r--r--src/analysis/decomp/decompiler.c3
-rw-r--r--src/analysis/disass/output.c32
-rw-r--r--src/analysis/routine.c50
-rw-r--r--src/analysis/routine.h6
4 files changed, 15 insertions, 76 deletions
diff --git a/src/analysis/decomp/decompiler.c b/src/analysis/decomp/decompiler.c
index 0caf4e4..5b2d231 100644
--- a/src/analysis/decomp/decompiler.c
+++ b/src/analysis/decomp/decompiler.c
@@ -152,7 +152,8 @@ static void prepare_all_routines_for_decomp(const GLoadedBinary *binary, const c
proc = NULL;//get_arch_processor_from_format(G_EXE_FORMAT(format));
- routines = g_binary_format_get_routines(G_BIN_FORMAT(format), &count);
+ routines = NULL; //g_binary_format_get_routines(G_BIN_FORMAT(format), &count);
+ count = 0;
diff --git a/src/analysis/disass/output.c b/src/analysis/disass/output.c
index 421cfb6..40cd12b 100644
--- a/src/analysis/disass/output.c
+++ b/src/analysis/disass/output.c
@@ -89,8 +89,6 @@ void print_disassembled_instructions(GBufferCache *cache, GCodingLanguage *lang,
BufferLineFlags flags; /* Propriétés pour la ligne */
//mrange_t range; /* Couverture sans surface */
- GDbComment *_comment; /* Commentaire à ajouter */
-
@@ -288,33 +286,21 @@ void print_disassembled_instructions(GBufferCache *cache, GCodingLanguage *lang,
if (g_binary_symbol_get_target_type(symbols[sym_index]) == STP_ENTRY_POINT)
flags |= BLF_ENTRYPOINT;
- /* Début d'un groupe bien cohérent avec les alignements ? */
-
- if (g_binary_symbol_is_block_start(symbols[sym_index]))
- flags |= BLF_WIDTH_MANAGER;
-
- }
-
- g_buffer_cache_append(cache, G_LINE_GENERATOR(instr), flags);
-
+ /**
+ * Début d'un groupe bien cohérent avec les alignements ?
+ *
+ * On décide que, à partir du moment où il y a un symbole, il y a
+ * là le début d'un nouveau bloc avec sa propre nouvelle gestion
+ * des largeurs, quelque soit le type du symbole en question !
+ */
-
- //////////////////////////////////
- if (compared == 0)
- {
- /* Commentaire ? */
-
- _comment = g_binary_symbol_get_comment(symbols[sym_index]);
-
- if (_comment != NULL)
- g_db_item_apply(G_DB_ITEM(_comment), binary);
+ flags |= BLF_WIDTH_MANAGER;
sym_index++;
}
- ///////////////////////////////////////
-
+ g_buffer_cache_append(cache, G_LINE_GENERATOR(instr), flags);
/* Commentaire en bout de ligne ? */
diff --git a/src/analysis/routine.c b/src/analysis/routine.c
index 583e151..c916c66 100644
--- a/src/analysis/routine.c
+++ b/src/analysis/routine.c
@@ -36,13 +36,14 @@
#include "../arch/raw.h"
#include "../common/extstr.h"
#include "../core/params.h"
+#include "../format/symbol-int.h"
/* Représentation générique de routine (instance) */
struct _GBinRoutine
{
- GObject parent; /* A laisser en premier */
+ GBinSymbol parent; /* A laisser en premier */
mrange_t range; /* Couverture mémoire */
@@ -64,7 +65,6 @@ struct _GBinRoutine
GBinVariable **locals; /* Variables locales du code */
size_t locals_count; /* Nombre de variables locales */
- GArchInstruction *instr; /* Instructions natives */
GBlockList *blocks; /* Blocs basiques d'instruct° */
//GDecInstruction *dinstr; /* Instructions décompilées */
@@ -74,7 +74,7 @@ struct _GBinRoutine
/* Représentation générique de routine (classe) */
struct _GBinRoutineClass
{
- GObjectClass parent; /* A laisser en premier */
+ GBinSymbolClass parent; /* A laisser en premier */
};
@@ -91,7 +91,7 @@ static void g_binary_routine_reset_declarator(GBinRoutine *, bool);
/* Indique le type définit pour une représentation de routine. */
-G_DEFINE_TYPE(GBinRoutine, g_bin_routine, G_TYPE_OBJECT);
+G_DEFINE_TYPE(GBinRoutine, g_bin_routine, G_TYPE_BIN_SYMBOL);
/******************************************************************************
@@ -808,48 +808,6 @@ size_t g_binary_routine_get_var_index_from_offset(const GBinRoutine *routine, si
* *
* Paramètres : routine = routine à consulter. *
* *
-* Description : Fournit les instructions natives correspondantes. *
-* *
-* Retour : Ensemble d'instructions décompilées ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GArchInstruction *g_binary_routine_get_instructions(const GBinRoutine *routine)
-{
- return routine->instr;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : routine = routine à mettre à jour. *
-* instr = série d'instructions à conserver. *
-* *
-* Description : Définit les instructions natives de la routine. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-void g_binary_routine_set_instructions(GBinRoutine *routine, GArchInstruction *instr)
-{
- if (routine->instr != NULL)
- g_object_unref(G_OBJECT(routine->instr));
-
- routine->instr = instr;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : routine = routine à consulter. *
-* *
* Description : Fournit les blocs basiques de la routine. *
* *
* Retour : Ensemble de blocs déterminés via les instructions. *
diff --git a/src/analysis/routine.h b/src/analysis/routine.h
index e880118..b040c6c 100644
--- a/src/analysis/routine.h
+++ b/src/analysis/routine.h
@@ -158,12 +158,6 @@ void g_binary_routine_register_if_needed(GBinRoutine *, size_t, bool);
/* Donne l'indice d'une variable dans la liste d'une routine. */
size_t g_binary_routine_get_var_index_from_offset(const GBinRoutine *, size_t, bool);
-/* Fournit les instructions natives correspondantes. */
-GArchInstruction *g_binary_routine_get_instructions(const GBinRoutine *);
-
-/* Définit les instructions natives de la routine. */
-void g_binary_routine_set_instructions(GBinRoutine *, GArchInstruction *);
-
/* Fournit les blocs basiques de la routine. */
GBlockList *g_binary_routine_get_basic_blocks(const GBinRoutine *);