diff options
Diffstat (limited to 'src/analysis/disass/routines.c')
-rw-r--r-- | src/analysis/disass/routines.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/src/analysis/disass/routines.c b/src/analysis/disass/routines.c index f04611f..4e65b77 100644 --- a/src/analysis/disass/routines.c +++ b/src/analysis/disass/routines.c @@ -41,6 +41,8 @@ struct _GRoutinesStudy { GDelayedWork parent; /* A laisser en premier */ + GLoadedBinary *binary; /* Binaire en cours d'analyse */ + GArchProcessor *proc; /* Processeur avec ses instr. */ GBinFormat *format; /* Format de fichier manipulé */ GBinPortion *portions; /* Couches de binaire bornées */ @@ -155,6 +157,8 @@ static void g_routines_study_dispose(GRoutinesStudy *study) g_object_unref(G_OBJECT(study->format)); g_object_unref(G_OBJECT(study->proc)); + g_object_unref(G_OBJECT(study->binary)); + G_OBJECT_CLASS(g_routines_study_parent_class)->dispose(G_OBJECT(study)); } @@ -181,8 +185,7 @@ static void g_routines_study_finalize(GRoutinesStudy *study) /****************************************************************************** * * -* Paramètres : proc = ensemble d'instructions désassemblées. * -* format = format de fichier à manipuler. * +* Paramètres : binary = binaire chargé comprenant les routines à traiter. * * portions = ensemble de couches binaires bornées. * * begin = point de départ du parcours de liste. * * end = point d'arrivée exclu du parcours. * @@ -197,24 +200,24 @@ static void g_routines_study_finalize(GRoutinesStudy *study) * * ******************************************************************************/ -GRoutinesStudy *g_routines_study_new(GArchProcessor *proc, GBinFormat *format, GBinPortion *portions, size_t begin, size_t end, activity_id_t id, rtn_fallback_cb fallback) +GRoutinesStudy *g_routines_study_new(GLoadedBinary *binary, GBinPortion *portions, size_t begin, size_t end, activity_id_t id, rtn_fallback_cb fallback) { GRoutinesStudy *result; /* Tâche à retourner */ result = g_object_new(G_TYPE_ROUTINES_STUDY, NULL); - result->proc = proc; - g_object_ref(G_OBJECT(proc)); + result->binary = binary; + g_object_ref(G_OBJECT(binary)); - result->format = format; - g_object_ref(G_OBJECT(format)); + result->proc = g_loaded_binary_get_processor(binary); + result->format = G_BIN_FORMAT(g_loaded_binary_get_format(binary)); result->portions = portions; g_object_ref(G_OBJECT(portions)); - g_binary_format_lock_symbols_rd(format); + g_binary_format_lock_symbols_rd(result->format); - result->count = g_binary_format_count_symbols(format); + result->count = g_binary_format_count_symbols(result->format); result->fallback = fallback; result->begin = begin; @@ -397,7 +400,7 @@ void g_routines_study_handle_blocks(GRoutinesStudy *study, GBinRoutine *routine, detect_loops_in_code(knight); - blocks = translate_dragon_knight(knight); + blocks = translate_dragon_knight(knight, study->binary); g_binary_routine_set_basic_blocks(routine, blocks); |