From f21375165728b168ea70627455e0c652ca6f836c Mon Sep 17 00:00:00 2001 From: Cyrille Bagard Date: Wed, 28 Nov 2018 00:18:24 +0100 Subject: Handled Dalvik pool prototype operands. --- plugins/dalvik/operands/pool.c | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/plugins/dalvik/operands/pool.c b/plugins/dalvik/operands/pool.c index d913149..8f6ccff 100644 --- a/plugins/dalvik/operands/pool.c +++ b/plugins/dalvik/operands/pool.c @@ -266,9 +266,9 @@ static void g_dalvik_pool_operand_print(const GDalvikPoolOperand *operand, GBuff GDataType *type; /* Type à représenter */ size_t len; /* Taille du texte à créer */ char *tmp; /* Chaîne de caractères #2 */ + GBinRoutine *routine; /* Routine à représenter */ GBinVariable *field; /* Champ à représenter */ GDexMethod *method; /* Méthode à retrouver */ - GBinRoutine *routine; /* Routine à représenter */ switch (operand->type) { @@ -335,7 +335,29 @@ static void g_dalvik_pool_operand_print(const GDalvikPoolOperand *operand, GBuff break; case DPT_PROTO: - g_buffer_line_append_text(line, BLC_ASSEMBLY, "proto(/*TODO*/)", 5, RTT_SECTION, NULL); + + routine = get_prototype_from_dex_pool(operand->format, operand->index); + + if (routine != NULL) + { + tmp = g_binary_symbol_get_label(G_BIN_SYMBOL(routine)); + g_object_unref(G_OBJECT(routine)); + + g_buffer_line_append_text(line, BLC_ASSEMBLY, tmp, strlen(tmp), RTT_LABEL, G_OBJECT(operand)); + + } + else + { + len = strlen(_("")) + 10 /* 4294967295U */ + 1; + tmp = calloc(len, sizeof(char)); + snprintf(tmp, len, _(""), operand->index); + + g_buffer_line_append_text(line, BLC_ASSEMBLY, tmp, len - 1, RTT_ERROR, NULL); + + } + + free(tmp); + break; case DPT_FIELD: -- cgit v0.11.2-87-g4458