diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2015-07-12 11:32:03 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2015-07-12 11:32:03 (GMT) |
commit | 254254db8c09eb4b4f8523e73551c13ec281d194 (patch) | |
tree | 730beb552a9d300e71f583fc40ef5a5b9dc40b42 /src | |
parent | ba1d7ae3ae3c82ab2c3d23a900c16baff6f8ca26 (diff) |
Only given access to instructions from a processor.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@547 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src')
-rw-r--r-- | src/analysis/binary.c | 19 | ||||
-rw-r--r-- | src/analysis/binary.h | 3 | ||||
-rw-r--r-- | src/gui/menus/edition.c | 6 | ||||
-rw-r--r-- | src/gui/panels/strings.c | 6 |
4 files changed, 10 insertions, 24 deletions
diff --git a/src/analysis/binary.c b/src/analysis/binary.c index b0712fd..7e16990 100644 --- a/src/analysis/binary.c +++ b/src/analysis/binary.c @@ -1008,25 +1008,6 @@ GArchProcessor *g_loaded_binary_get_processor(const GLoadedBinary *binary) * * * Paramètres : binary = élément binaire à consulter. * * * -* Description : Fournit les instructions issues du désassemblage. * -* * -* Retour : Instructions issues du désassemblage. * -* * -* Remarques : - * -* * -******************************************************************************/ - -GArchInstruction *g_loaded_binary_get_instructions(const GLoadedBinary *binary) -{ - return binary->instrs; - -} - - -/****************************************************************************** -* * -* Paramètres : binary = élément binaire à consulter. * -* * * Description : Fournit le tampon associé au contenu assembleur d'un binaire.* * * * Retour : Tampon mis en place ou NULL si aucun (!). * diff --git a/src/analysis/binary.h b/src/analysis/binary.h index 6878fe4..163caaa 100644 --- a/src/analysis/binary.h +++ b/src/analysis/binary.h @@ -160,9 +160,6 @@ GExeFormat *g_loaded_binary_get_format(const GLoadedBinary *); /* Fournit le processeur de l'architecture liée au binaire. */ GArchProcessor *g_loaded_binary_get_processor(const GLoadedBinary *); -/* Fournit les instructions issues du désassemblage. */ -GArchInstruction *g_loaded_binary_get_instructions(const GLoadedBinary *); - /* Fournit le tampon associé au contenu assembleur d'un binaire. */ GCodeBuffer *g_loaded_binary_get_disassembled_buffer(const GLoadedBinary *); diff --git a/src/gui/menus/edition.c b/src/gui/menus/edition.c index c242a00..040c8ab 100644 --- a/src/gui/menus/edition.c +++ b/src/gui/menus/edition.c @@ -242,6 +242,7 @@ static void mcb_edition_list_xrefs(GtkMenuItem *menuitem, GMenuBar *bar) GBufferLine *line; /* Ligne de position courante */ const mrange_t *range; /* Couverture en mémoire */ GLoadedBinary *binary; /* Représentation binaire */ + GArchProcessor *proc; /* Processeur de l'architecture*/ GArchInstruction *list; /* Ensemble des instructions */ GArchInstruction *instr; /* Point de croisements */ GObject *ref; /* Espace de référencements */ @@ -255,7 +256,8 @@ static void mcb_edition_list_xrefs(GtkMenuItem *menuitem, GMenuBar *bar) range = g_buffer_line_get_range(line); binary = g_editor_item_get_current_binary(G_EDITOR_ITEM(bar)); - list = g_loaded_binary_get_instructions(binary); + proc = g_loaded_binary_get_processor(binary); + list = g_arch_processor_get_disassembled_instructions(proc); /** * On ne peut pas se reposer sur l'espace couvert par une ligne, car il peut @@ -287,6 +289,8 @@ static void mcb_edition_list_xrefs(GtkMenuItem *menuitem, GMenuBar *bar) gtk_widget_destroy(dialog); + g_object_unref(G_OBJECT(proc)); + g_object_unref(G_OBJECT(line)); } diff --git a/src/gui/panels/strings.c b/src/gui/panels/strings.c index b8f5eca..825c510 100644 --- a/src/gui/panels/strings.c +++ b/src/gui/panels/strings.c @@ -1039,6 +1039,7 @@ static void mcb_strings_panel_find_refs(GtkMenuItem *menuitem, GStringsPanel *pa GBinSymbol *symbol; /* Symbole sélectionné */ const mrange_t *range; /* Couverture en mémoire */ GLoadedBinary *binary; /* Représentation binaire */ + GArchProcessor *proc; /* Processeur de l'architecture*/ GArchInstruction *list; /* Ensemble des instructions */ GArchInstruction *instr; /* Point de croisements */ GObject *ref; /* Espace de référencements */ @@ -1052,7 +1053,8 @@ static void mcb_strings_panel_find_refs(GtkMenuItem *menuitem, GStringsPanel *pa range = g_binary_symbol_get_range(symbol); binary = g_editor_item_get_current_binary(G_EDITOR_ITEM(panel)); - list = g_loaded_binary_get_instructions(binary); + proc = g_loaded_binary_get_processor(binary); + list = g_arch_processor_get_disassembled_instructions(proc); /** * Se rapporter aux commentaires de mcb_edition_list_xrefs() pour les questions @@ -1077,6 +1079,8 @@ static void mcb_strings_panel_find_refs(GtkMenuItem *menuitem, GStringsPanel *pa gtk_widget_destroy(dialog); + g_object_unref(G_OBJECT(proc)); + g_object_unref(G_OBJECT(symbol)); } |