diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2016-04-24 18:43:54 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2016-04-24 18:43:54 (GMT) |
commit | 9d04b66153bd0b354c0fb5c097b9face61a649db (patch) | |
tree | 54a507c720287597e7a70808e64ad36b37ed41b8 /src/arch/target.c | |
parent | a5758a42acdfaf0ac20c4cfb9cf162a9b4440e39 (diff) |
Handled hooks and rules in Dalvik opcodes definitions.
Diffstat (limited to 'src/arch/target.c')
-rw-r--r-- | src/arch/target.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/arch/target.c b/src/arch/target.c index 01c2bfe..4e731ec 100644 --- a/src/arch/target.c +++ b/src/arch/target.c @@ -297,6 +297,7 @@ virt_t g_target_operand_get_addr(const GTargetOperand *operand) * * * Paramètres : operand = opérande dont le contenu est à raffiner. * * format = format du binaire d'origine à consulter. * +* strict = indique si la résolution doit être parfaite ou non.* * * * Description : Tente une résolution de symbole. * * * @@ -306,7 +307,7 @@ virt_t g_target_operand_get_addr(const GTargetOperand *operand) * * ******************************************************************************/ -bool g_target_operand_resolve(GTargetOperand *operand, const GBinFormat *format) +bool g_target_operand_resolve(GTargetOperand *operand, const GBinFormat *format, bool strict) { bool result; /* Bilan à retourner */ vmpa2t addr; /* Adresse de recherche */ @@ -325,6 +326,18 @@ bool g_target_operand_resolve(GTargetOperand *operand, const GBinFormat *format) * En cas de succès, le compteur de références du symbole trouvé a été incrémenté. */ + if (strict) + result &= (operand->diff == 0); + + if (!result && operand->symbol != NULL) + { + g_object_unref(G_OBJECT(operand->symbol)); + + operand->symbol = NULL; + operand->diff = 0; + + } + return result; } |