summaryrefslogtreecommitdiff
path: root/src/analysis/db/items
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2016-10-23 16:22:50 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2016-10-23 18:53:25 (GMT)
commit56f7524c4fd0fc14a509be7689f4820b31564dbc (patch)
tree9c84e11279cd5711a4e0af907ca6160b62317528 /src/analysis/db/items
parent3f05bacd4fec23824489b51d964a7ce3565bb85b (diff)
Deleted a level of data to reduce the memory fingerprint.
Diffstat (limited to 'src/analysis/db/items')
-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));