diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2014-12-16 21:13:42 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2014-12-16 21:13:42 (GMT) |
commit | 04dfbc68e7cd5036017f097a67ba5f0288ddace0 (patch) | |
tree | 2cf10137c3c47c1c0877c67b48f7aeb86d9cbfcb /src/arch/instruction.c | |
parent | a1c2bc0c3b6f4b4fda9c50beeb09a1f699419e2a (diff) |
Created operands for resolving symbols in disassembly code.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@442 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/arch/instruction.c')
-rw-r--r-- | src/arch/instruction.c | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/src/arch/instruction.c b/src/arch/instruction.c index c8640b4..a96f0e4 100644 --- a/src/arch/instruction.c +++ b/src/arch/instruction.c @@ -167,6 +167,51 @@ void g_arch_instruction_append_suffix(GArchInstruction *instr, const char *suffi /****************************************************************************** * * +* Paramètres : instr = instruction quelconque à modifier. * +* post = fonction à appeler sur commande. * +* * +* Description : Définit une fonction de post-traitement après désassemblage. * +* * +* Retour : - * +* * +* Remarques : - * +* * +******************************************************************************/ + +void g_arch_instruction_set_post_prod_function(GArchInstruction *instr, instr_post_prod_fc post) +{ + instr->post_prod = post; + +} + + +/****************************************************************************** +* * +* Paramètres : instr = instruction quelconque à traiter. * +* data = données éventuelles associées à l'opération. * +* * +* Description : Complète un désassemblage accompli pour une instruction. * +* * +* Retour : - * +* * +* Remarques : - * +* * +******************************************************************************/ + +void g_arch_instruction_call_post_prod_function(GArchInstruction *instr, void *data) +{ + if (instr->post_prod != NULL) + instr->post_prod(instr, data); + +} + + + + + + +/****************************************************************************** +* * * Paramètres : instr = instruction quelconque à modifier. * * address = adresse virtuelle et/ou position physique. * * length = taille de l'instruction. * @@ -321,7 +366,10 @@ void g_arch_instruction_replace_operand(GArchInstruction *instr, GArchOperand *n break; if (i < instr->operands_count) + { + g_object_unref(G_OBJECT(instr->operands[i])); instr->operands[i] = new; + } } |