summaryrefslogtreecommitdiff
path: root/src/analysis/disass/fetch.c
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2016-04-03 12:48:41 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2016-04-03 12:48:41 (GMT)
commitf80c4c6ee0479070f7319a5ce7e30e05406cdb8f (patch)
tree94bc363a6d1aeac29c1985a9627ceda962d1c38a /src/analysis/disass/fetch.c
parent36a5b2577d67ab7c9f2c5817f6dba7a9601d1f20 (diff)
Reorganized the whole disassembling process and displayed the relative progression.
Diffstat (limited to 'src/analysis/disass/fetch.c')
-rw-r--r--src/analysis/disass/fetch.c49
1 files changed, 23 insertions, 26 deletions
diff --git a/src/analysis/disass/fetch.c b/src/analysis/disass/fetch.c
index 4813111..f484f05 100644
--- a/src/analysis/disass/fetch.c
+++ b/src/analysis/disass/fetch.c
@@ -64,7 +64,9 @@ typedef struct _GDelayedFetching
GProcContext *ctx; /* Contexte de désassemblage */
mem_area_v2 *areas; /* Zone de productions */
size_t count; /* Nombre de ces zones */
- status_blob_info *info; /* Informations de progression */
+
+ GtkStatusStack *status; /* Barre de statut */
+ activity_id_t id; /* Groupe de progression */
virt_t virt; /* Adresse de départ dépilée */
@@ -205,6 +207,8 @@ static void g_delayed_fetching_dispose(GDelayedFetching *fetching)
g_object_unref(G_OBJECT(fetching->ctx));
+ g_object_unref(G_OBJECT(fetching->status));
+
G_OBJECT_CLASS(g_delayed_fetching_parent_class)->dispose(G_OBJECT(fetching));
}
@@ -258,7 +262,11 @@ static GDelayedFetching *g_delayed_fetching_new(const GDelayedFetching *template
result->areas = template->areas;
result->count = template->count;
- result->info = template->info;
+
+ result->status = template->status;
+ g_object_ref(G_OBJECT(result->status));
+
+ result->id = template->id;
result->virt = virt;
@@ -293,7 +301,7 @@ static void g_delayed_fetching_process(GDelayedFetching *fetching, GtkExtStatusB
if (area != NULL)
load_code_from_mem_area_v2(area, fetching->areas, fetching->count,
- fetching->ctx, &addr, fetching->info);
+ fetching->ctx, &addr, fetching->status, fetching->id);
}
@@ -467,9 +475,9 @@ static GDelayedFetching template; /* Patron des tâches à venir
/******************************************************************************
* *
-* Paramètres : binary = représentation de binaire chargé. *
-* gid = identifiant du groupe de travail à utiliser. *
-* statusbar = barre de statut avec progression à mettre à jour.*
+* Paramètres : binary = représentation de binaire chargé. *
+* gid = identifiant du groupe de travail à utiliser. *
+* status = barre de statut avec progression à mettre à jour. *
* *
* Description : Procède au désassemblage basique d'un contenu binaire. *
* *
@@ -479,7 +487,7 @@ static GDelayedFetching template; /* Patron des tâches à venir
* *
******************************************************************************/
-GArchInstruction *disassemble_binary_content(const GLoadedBinary *binary, wgroup_id_t gid, GtkExtStatusBar *statusbar)
+GArchInstruction *disassemble_binary_content(const GLoadedBinary *binary, wgroup_id_t gid, GtkStatusStack *status)
{
GArchInstruction *result; /* Instruction désassemblées */
//GDelayedFetching template; /* Patron des tâches à venir */
@@ -489,7 +497,6 @@ GArchInstruction *disassemble_binary_content(const GLoadedBinary *binary, wgroup
phys_t length; /* Taille des données à lire */
GWorkQueue *queue; /* Gestionnaire de différés */
gint remaining_counter; /* Quantité de points restants */
- double done; /* Portion de travail accompli */
/* Constitution du modèle de référence */
@@ -508,6 +515,8 @@ GArchInstruction *disassemble_binary_content(const GLoadedBinary *binary, wgroup
template.areas = compute_memory_areas_v2(binary, length, &template.count);
+ template.status = status;
+
/* Amorce des traitements */
queue = get_work_queue();
@@ -528,27 +537,21 @@ GArchInstruction *disassemble_binary_content(const GLoadedBinary *binary, wgroup
g_signal_connect(template.ctx, "drop-point-pushed", G_CALLBACK(follow_execution_flow_v2), &template);
- template.info = init_progessive_status(statusbar,
- _("Disassembling following the execution flow..."),
- 0, length);
+ template.id = gtk_status_stack_add_activity(status,
+ _("Disassembling following the execution flow..."),
+ length);
g_binary_format_setup_disassembling_context(format, template.ctx);
g_work_queue_wait_for_completion(queue, gid);
- done = get_current_progessive_status(template.info);
-
- fini_progessive_status(template.info);
-
/**
* Seconde phase : on comble les trous laissés.
*/
- template.info = init_progessive_status(statusbar,
- _("Disassembling the remaining instructions..."),
- done, length);
+ gtk_status_stack_update_activity(status, template.id, _("Disassembling the remaining instructions..."));
- ensure_all_mem_areas_are_filled(template.areas, template.count, template.ctx, template.info);
+ ensure_all_mem_areas_are_filled(template.areas, template.count, template.ctx, status, template.id);
g_work_queue_wait_for_completion(queue, gid);
@@ -556,20 +559,14 @@ GArchInstruction *disassemble_binary_content(const GLoadedBinary *binary, wgroup
g_object_set_data(G_OBJECT(template.ctx), "remaining_counter", NULL);
- fini_progessive_status(template.info);
-
/**
* Troisième et dernière phase : récolte des fruits.
*/
- template.info = init_progessive_status(statusbar,
- _("Collecting disassembled instructions..."),
- 0, length);
+ gtk_status_stack_update_activity(status, template.id, _("Collecting disassembled instructions..."));
result = collect_instructions_from_mem_areas_v2(template.areas, template.count);
- fini_progessive_status(template.info);
-
/* Libérations finales */
//g_object_unref(G_OBJECT(template.format));