summaryrefslogtreecommitdiff
path: root/plugins/dalvik/operands
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/dalvik/operands')
-rw-r--r--plugins/dalvik/operands/pool.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/plugins/dalvik/operands/pool.c b/plugins/dalvik/operands/pool.c
index 8f6ccff..e9f1d60 100644
--- a/plugins/dalvik/operands/pool.c
+++ b/plugins/dalvik/operands/pool.c
@@ -262,6 +262,7 @@ static int g_dalvik_pool_operand_compare(const GDalvikPoolOperand *a, const GDal
static void g_dalvik_pool_operand_print(const GDalvikPoolOperand *operand, GBufferLine *line)
{
+ GDexPool *pool; /* Table de ressources */
const char *string; /* Chaîne de caractères #1 */
GDataType *type; /* Type à représenter */
size_t len; /* Taille du texte à créer */
@@ -270,6 +271,8 @@ static void g_dalvik_pool_operand_print(const GDalvikPoolOperand *operand, GBuff
GBinVariable *field; /* Champ à représenter */
GDexMethod *method; /* Méthode à retrouver */
+ pool = g_dex_format_get_pool(operand->format);
+
switch (operand->type)
{
case DPT_NONE:
@@ -278,7 +281,7 @@ static void g_dalvik_pool_operand_print(const GDalvikPoolOperand *operand, GBuff
case DPT_STRING:
- string = get_string_from_dex_pool(operand->format, operand->index, NULL);
+ string = g_dex_pool_get_string(pool, operand->index, NULL);
if (string != NULL)
{
@@ -308,7 +311,7 @@ static void g_dalvik_pool_operand_print(const GDalvikPoolOperand *operand, GBuff
case DPT_TYPE:
- type = get_type_from_dex_pool(operand->format, operand->index);
+ type = g_dex_pool_get_type_(pool, operand->index);
if (type != NULL)
{
@@ -336,7 +339,7 @@ static void g_dalvik_pool_operand_print(const GDalvikPoolOperand *operand, GBuff
case DPT_PROTO:
- routine = get_prototype_from_dex_pool(operand->format, operand->index);
+ routine = g_dex_pool_get_prototype(pool, operand->index);
if (routine != NULL)
{
@@ -362,7 +365,7 @@ static void g_dalvik_pool_operand_print(const GDalvikPoolOperand *operand, GBuff
case DPT_FIELD:
- field = get_field_from_dex_pool(operand->format, operand->index);
+ field = g_dex_pool_get_field(pool, operand->index);
if (field != NULL)
{
@@ -390,7 +393,7 @@ static void g_dalvik_pool_operand_print(const GDalvikPoolOperand *operand, GBuff
case DPT_METHOD:
- method = get_method_from_dex_pool(operand->format, operand->index);
+ method = g_dex_pool_get_method(pool, operand->index);
if (method != NULL)
routine = g_dex_method_get_routine(method);
@@ -424,6 +427,8 @@ static void g_dalvik_pool_operand_print(const GDalvikPoolOperand *operand, GBuff
}
+ g_object_unref(G_OBJECT(pool));
+
}
@@ -628,6 +633,7 @@ static bool g_dalvik_pool_operand_serialize(const GDalvikPoolOperand *operand, G
static bool g_dalvik_pool_operand_get_addr(const GDalvikPoolOperand *operand, const vmpa2t *src, GBinFormat *format, GArchProcessor *proc, vmpa2t *addr)
{
bool result; /* Bilan à retourner */
+ GDexPool *pool; /* Table de ressources */
GDexMethod *method; /* Méthode ciblée ici */
GBinRoutine *routine; /* Routine liée à la méthode */
const mrange_t *range; /* Zone d'occupation */
@@ -636,7 +642,11 @@ static bool g_dalvik_pool_operand_get_addr(const GDalvikPoolOperand *operand, co
if (operand->type == DPT_METHOD)
{
- method = get_method_from_dex_pool(G_DEX_FORMAT(format), operand->index);
+ pool = g_dex_format_get_pool(G_DEX_FORMAT(format));
+
+ method = g_dex_pool_get_method(pool, operand->index);
+
+ g_object_unref(G_OBJECT(pool));
if (method != NULL)
{