diff options
Diffstat (limited to 'src/format/dex/method.c')
-rw-r--r-- | src/format/dex/method.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/format/dex/method.c b/src/format/dex/method.c index ce4d8dd..9bac013 100644 --- a/src/format/dex/method.c +++ b/src/format/dex/method.c @@ -38,6 +38,7 @@ struct _GDexMethod GBinRoutine *routine; /* Représentation interne */ + encoded_method info; /* Propriétés de la méthode */ code_item body; /* Corps de la méthode */ off_t offset; /* Position du code */ @@ -143,6 +144,7 @@ GDexMethod *g_dex_method_new(const GDexFormat *format, const encoded_method *see result = g_object_new(G_TYPE_DEX_METHOD, NULL); + result->info = *seed; result->body = item; //printf(" method idx :: %d\n", seed->method_idx_diff); @@ -203,13 +205,16 @@ GBinRoutine *g_dex_method_get_routine(const GDexMethod *method) GBinPart *g_dex_method_as_part(const GDexMethod *method) { GBinPart *result; /* Instance à retourner */ + off_t size; /* Taille du code associé */ result = g_binary_part_new(); g_binary_part_set_name(result, "name"); - g_binary_part_set_values(result, - method->offset, method->body.insns_size * sizeof(uint16_t), method->offset); + if (method->info.access_flags & ACC_NATIVE) size = 0; + else size = method->body.insns_size * sizeof(uint16_t); + + g_binary_part_set_values(result, method->offset, size, method->offset); return result; |