diff options
Diffstat (limited to 'plugins/ropgadgets/select.c')
-rw-r--r-- | plugins/ropgadgets/select.c | 39 |
1 files changed, 17 insertions, 22 deletions
diff --git a/plugins/ropgadgets/select.c b/plugins/ropgadgets/select.c index 5025ed8..2d8d77d 100644 --- a/plugins/ropgadgets/select.c +++ b/plugins/ropgadgets/select.c @@ -211,7 +211,7 @@ static void on_rop_gadgets_filter_changed(GtkSearchEntry *, GObject *); static gboolean filter_visible_rop_gadgets(GtkTreeModel *, GtkTreeIter *, GObject *); /* Ajoute de nouvelles chaînes de gadgets localisées. */ -static void add_new_gadgets_for_category(GExeFormat *, GtkComboBoxText *, GtkTreeStore *, const char *, GArchInstruction **, size_t); +static void add_new_gadgets_for_category(GExeFormat *, GtkComboBoxText *, GtkTreeStore *, const char *, rop_chain **, size_t); @@ -1199,7 +1199,7 @@ static gboolean register_found_rop_gadgets(search_step *step) step->list[i].category, step->list[i].gadgets, step->list[i].count); if (step->list != NULL) - free(step->list); + free_rop_list(step->list); } @@ -1563,17 +1563,6 @@ static void register_rop_list_panel(GtkAssistant *assistant, GObject *ref) } - - - - - - - - - - - /****************************************************************************** * * * Paramètres : combo = composant de choix contenant le filtre brut. * @@ -1744,18 +1733,20 @@ static gboolean filter_visible_rop_gadgets(GtkTreeModel *model, GtkTreeIter *ite * * ******************************************************************************/ -static void add_new_gadgets_for_category(GExeFormat *format, GtkComboBoxText *combo, GtkTreeStore *store, const char *category, GArchInstruction **gadgets, size_t count) +static void add_new_gadgets_for_category(GExeFormat *format, GtkComboBoxText *combo, GtkTreeStore *store, const char *category, rop_chain **gadgets, size_t count) { const GBinContent *content; /* Contenu binaire global */ - size_t i; /* Boucle de parcours */ - GArchInstruction *instr; /* Elément de liste de gadgets */ - GBufferLine *line; /* Ligne présente à l'adresse */ + size_t i; /* Boucle de parcours #1 */ char *raw_virtual; /* Transcription pour export */ char *virtual; /* Transcription d'adresse */ - char *partial_raw; /* Contenu de la ligne visée */ - char *partial_markup; /* Contenu de la ligne visée */ char *content_raw; /* Contenu assemblé de chaîne */ char *content_markup; /* Contenu assemblé de chaîne */ + rop_chain *chain; /* Accès direct à une chaîne */ + size_t j; /* Boucle de parcours #2 */ + GArchInstruction *instr; /* Elément de liste de gadgets */ + GBufferLine *line; /* Ligne présente à l'adresse */ + char *partial_raw; /* Contenu de la ligne visée */ + char *partial_markup; /* Contenu de la ligne visée */ GtkTreeIter iter; /* Point d'insertion */ content = g_binary_format_get_content(G_BIN_FORMAT(format)); @@ -1771,12 +1762,16 @@ static void add_new_gadgets_for_category(GExeFormat *format, GtkComboBoxText *co content_raw = NULL; content_markup = NULL; - for (instr = gadgets[i]; instr != NULL; instr = g_arch_instruction_get_next_iter(gadgets[i], instr, ~0)) + chain = gadgets[i]; + + for (j = 0; j < chain->count; j++) { - line = g_buffer_line_new(NULL, BLC_ASSEMBLY); + instr = chain->instrs[j]; + + line = g_buffer_line_new((mrange_t []){ { { 0 }, 0 } }, BLC_ASSEMBLY); g_line_generator_print(G_LINE_GENERATOR(instr), line, -1, 0); - if (instr == gadgets[i]) + if (j == 0) { raw_virtual = g_buffer_line_get_text(line, BLC_VIRTUAL, BLC_VIRTUAL + 1, false); virtual = g_buffer_line_get_text(line, BLC_VIRTUAL, BLC_VIRTUAL + 1, true); |