diff options
Diffstat (limited to 'src/analysis/disass/links.c')
-rw-r--r-- | src/analysis/disass/links.c | 54 |
1 files changed, 6 insertions, 48 deletions
diff --git a/src/analysis/disass/links.c b/src/analysis/disass/links.c index 5e1e483..86663cc 100644 --- a/src/analysis/disass/links.c +++ b/src/analysis/disass/links.c @@ -31,11 +31,8 @@ -/* Rétablit un lien naturel coupé par un autre lien. */ -static void establish_natural_link(GArchInstruction *, GArchInstruction *); - /* Complète un désassemblage accompli pour une instruction. */ -static void convert_immediate_into_target(GArchInstruction *, size_t, GBinFormat *); +static void convert_immediate_into_target(GArchInstruction *, size_t, const GBinFormat *); @@ -52,7 +49,7 @@ static void convert_immediate_into_target(GArchInstruction *, size_t, GBinFormat * * ******************************************************************************/ -static void establish_natural_link(GArchInstruction *instr, GArchInstruction *prev) +void establish_natural_link(GArchInstruction *instr, GArchInstruction *prev) { GArchInstruction **others; /* Instructions diverses liées */ InstructionLinkType *types; /* Types de lien existants */ @@ -126,7 +123,7 @@ static void establish_natural_link(GArchInstruction *instr, GArchInstruction *pr * * ******************************************************************************/ -static void convert_immediate_into_target(GArchInstruction *instr, size_t index, GBinFormat *format) +static void convert_immediate_into_target(GArchInstruction *instr, size_t index, const GBinFormat *format) { GArchOperand *op; /* Opérande numérique en place */ GImmOperand *imm; /* Version native de l'opérande*/ @@ -160,8 +157,8 @@ static void convert_immediate_into_target(GArchInstruction *instr, size_t index, /****************************************************************************** * * * Paramètres : instr = instruction désassemblée à traiter. * -* list = ensemble d'instructions à relier. * * format = accès aux données du binaire d'origine. * +* proc = ensemble d'instructions à relier. * * * * Description : Complète un désassemblage accompli pour une instruction. * * * @@ -171,7 +168,7 @@ static void convert_immediate_into_target(GArchInstruction *instr, size_t index, * * ******************************************************************************/ -static void establish_links_for_instruction(GArchInstruction *instr, GArchInstruction *list, GBinFormat *format) +void establish_links_for_instruction(GArchInstruction *instr, const GBinFormat *format, const GArchProcessor *proc) { bool skip; /* Saut des conversions */ size_t count; /* Nombre d'opérandes présents */ @@ -199,7 +196,7 @@ static void establish_links_for_instruction(GArchInstruction *instr, GArchInstru virt = g_target_operand_get_addr(G_TARGET_OPERAND(op)); init_vmpa(&addr, VMPA_NO_PHYSICAL, virt); - target = g_arch_instruction_find_by_address(list, &addr, true); + target = g_arch_processor_find_instr_by_address(proc, &addr); if (target != NULL) g_arch_instruction_link_with(instr, target, ILT_REF); @@ -207,42 +204,3 @@ static void establish_links_for_instruction(GArchInstruction *instr, GArchInstru } } - - -/****************************************************************************** -* * -* Paramètres : list = ensemble d'instructions à relier. * -* format = accès aux données du binaire d'origine. * -* statusbar = barre de statut avec progression à mettre à jour.* -* id = identifiant du message affiché à l'utilisateur. * -* * -* Description : Etablit les liens entres les différentes lignes de code. * -* * -* Retour : - * -* * -* Remarques : - * -* * -******************************************************************************/ - -void establish_links_between_instructions(GArchInstruction *list, GBinFormat *format, GtkExtStatusBar *statusbar, bstatus_id_t id) -{ - GArchInstruction *prev; /* Itération précédente */ - GArchInstruction *iter; /* Boucle de parcours */ - - prev = NULL; - - for (iter = list; - iter != NULL; - iter = g_arch_instruction_get_next_iter(list, iter, ~0/* FIXME */)) - { - if (prev != NULL) - establish_natural_link(iter, prev); - - prev = iter; - - establish_links_for_instruction(iter, list, format); - - - } - -} |