summaryrefslogtreecommitdiff
path: root/src/analysis/db/items/switcher.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/analysis/db/items/switcher.c')
-rw-r--r--src/analysis/db/items/switcher.c26
1 files changed, 7 insertions, 19 deletions
diff --git a/src/analysis/db/items/switcher.c b/src/analysis/db/items/switcher.c
index a67040f..08a5a5f 100644
--- a/src/analysis/db/items/switcher.c
+++ b/src/analysis/db/items/switcher.c
@@ -502,7 +502,6 @@ static bool g_db_switcher_run(GDbSwitcher *switcher, GLoadedBinary *binary, ImmO
GArchOperand *op; /* Opérande à modifier */
GCodeBuffer *buffer; /* Tampon de lignes à traiter */
GBufferLine *line; /* Ligne de tampon à marquer */
- GBufferSegment *segment; /* Segment de texte à modifier*/
GImmOperand *operand; /* Opérande de valeur immédiate*/
char value[IMM_MAX_SIZE]; /* Chaîne à imprimer */
size_t len; /* Taille de l'élément inséré */
@@ -541,29 +540,18 @@ static bool g_db_switcher_run(GDbSwitcher *switcher, GLoadedBinary *binary, ImmO
goto exit_gui;
}
- segment = g_buffer_line_find_segment_from_creator(line, G_OBJECT(op));
- result = (segment != NULL);
+ operand = G_IMM_OPERAND(op);
- /* Applications globales finales */
+ *old = g_imm_operand_get_display(operand);
- if (result)
- {
- operand = G_IMM_OPERAND(op);
-
- *old = g_imm_operand_get_display(operand);
-
- if (new == IOD_COUNT)
- new = g_imm_operand_get_default_display(operand);
+ if (new == IOD_COUNT)
+ new = g_imm_operand_get_default_display(operand);
- g_imm_operand_set_display(operand, new);
+ g_imm_operand_set_display(operand, new);
- len = g_imm_operand_to_string(operand, ASX_INTEL, value);
+ len = g_imm_operand_to_string(operand, ASX_INTEL, value);
- g_buffer_segment_update_text(segment, value, len);
-
- g_object_unref(G_OBJECT(segment));
-
- }
+ result = g_buffer_line_replace_text(line, G_OBJECT(op), value, len);
g_object_unref(G_OBJECT(line));