From 760e2e7346518dd1264126c1696f9ad88884d64c Mon Sep 17 00:00:00 2001 From: Cyrille Bagard Date: Tue, 13 Nov 2012 21:42:09 +0000 Subject: Optimized the decoding of Dalvik opcodes. git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@284 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a --- ChangeLog | 5 +++++ src/arch/dalvik/instruction.c | 10 +--------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0d4df40..3153a68 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,11 @@ 12-11-13 Cyrille Bagard * src/arch/dalvik/instruction.c: + Optimize the decoding of Dalvik opcodes. + +12-11-13 Cyrille Bagard + + * src/arch/dalvik/instruction.c: Add links for 'goto' instructions too. * src/gtkext/graph/dot.c: diff --git a/src/arch/dalvik/instruction.c b/src/arch/dalvik/instruction.c index 065c67a..f0e679f 100644 --- a/src/arch/dalvik/instruction.c +++ b/src/arch/dalvik/instruction.c @@ -446,16 +446,8 @@ DalvikOpcodes g_dalvik_instruction_get_opcode(const GDalvikInstruction *instr) DalvikOpcodes dalvik_guess_next_instruction(const bin_t *data, off_t pos, off_t len) { DalvikOpcodes result; /* Identifiant à retourner */ - bin_t opcode; /* Opcode à trouver */ - opcode = data[pos]; - - for (result = 0; result < DOP_COUNT; result++) - { - if (_instructions[result].opcode == opcode) - break; - - } + result = (DalvikOpcodes)data[pos]; /* Si l'instruction est marquée comme non utilisée... */ if (_instructions[result].keyword == NULL) -- cgit v0.11.2-87-g4458