summaryrefslogtreecommitdiff
path: root/plugins/androhelpers/switch.c
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2015-07-12 11:32:03 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2015-07-12 11:32:03 (GMT)
commit254254db8c09eb4b4f8523e73551c13ec281d194 (patch)
tree730beb552a9d300e71f583fc40ef5a5b9dc40b42 /plugins/androhelpers/switch.c
parentba1d7ae3ae3c82ab2c3d23a900c16baff6f8ca26 (diff)
Only given access to instructions from a processor.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@547 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'plugins/androhelpers/switch.c')
-rw-r--r--plugins/androhelpers/switch.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/plugins/androhelpers/switch.c b/plugins/androhelpers/switch.c
index f93c9e9..a5a8a75 100644
--- a/plugins/androhelpers/switch.c
+++ b/plugins/androhelpers/switch.c
@@ -383,8 +383,9 @@ static void look_for_switch_instructions(const GDexMethod *method, GArchInstruct
bool extract_switch_info(GLoadedBinary *binary, bool link)
{
- GArchInstruction *instrs; /* Instructions Dalvik */
GDexFormat *format; /* Format du binaire chargé */
+ GArchProcessor *proc; /* Processeur de l'architecture*/
+ GArchInstruction *instrs; /* Instructions Dalvik */
size_t cls_count; /* Nombre de classes trouvées */
size_t i; /* Boucle de parcours #1 */
GDexClass *class; /* Classe à analyser */
@@ -392,8 +393,9 @@ bool extract_switch_info(GLoadedBinary *binary, bool link)
size_t j; /* Boucle de parcours #2 */
GDexMethod *method; /* Méthode à parcourir */
- instrs = g_loaded_binary_get_instructions(binary);
format = G_DEX_FORMAT(g_loaded_binary_get_format(binary));
+ proc = g_loaded_binary_get_processor(binary);
+ instrs = g_arch_processor_get_disassembled_instructions(proc);
cls_count = g_dex_format_count_classes(format);
for (i = 0; i < cls_count; i++)
@@ -416,6 +418,8 @@ bool extract_switch_info(GLoadedBinary *binary, bool link)
}
+ g_object_unref(G_OBJECT(proc));
+
return true;
}