summaryrefslogtreecommitdiff
path: root/plugins/dex
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2018-08-02 22:25:15 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2018-08-02 22:25:15 (GMT)
commit8c84aa2e41305fd388b7dac49f29ae17ee0554fb (patch)
tree52830a7d896e2d9272e7c71677c72ce9d62cf26c /plugins/dex
parent30fc2ba22b469e38bc40e47f517988e418c178f3 (diff)
Introduced symbols dedicated to strings.
Diffstat (limited to 'plugins/dex')
-rw-r--r--plugins/dex/pool.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/plugins/dex/pool.c b/plugins/dex/pool.c
index 75841df..d95f519 100644
--- a/plugins/dex/pool.c
+++ b/plugins/dex/pool.c
@@ -31,6 +31,7 @@
#include <i18n.h>
#include <core/global.h>
#include <core/nproc.h>
+#include <format/strsym.h>
#include <mangling/demangler.h>
@@ -205,9 +206,8 @@ GBinSymbol *get_string_symbol_from_dex_pool(GDexFormat *format, uint32_t index)
uint32_t count; /* Nombre d'éléments présents */
mrange_t range; /* Emplacement de la chaîne */
const char *string; /* Chaîne de caractères liée */
- GBinSymbol *new; /* Nouveau symbol créé */
GBinFormat *base; /* Autre version du format */
- char *label; /* Désignation de la chaîne */
+ GBinSymbol *new; /* Nouveau symbol créé */
bool inserted; /* Bilan d'une insertion */
result = NULL;
@@ -222,15 +222,11 @@ GBinSymbol *get_string_symbol_from_dex_pool(GDexFormat *format, uint32_t index)
string = get_string_from_dex_pool(format, index, &range);
if (string == NULL) goto gssfdp_error;
- new = g_binary_symbol_new(&range, STP_RO_STRING);
-
base = G_BIN_FORMAT(format);
- label = create_string_label(base, get_mrange_addr(&range), get_mrange_length(&range));
-
- g_binary_symbol_set_alt_label(new, label);
+ new = g_string_symbol_new_read_only(base, &range, SET_MUTF_8);
- free(label);
+ g_string_symbol_build_label(G_STR_SYMBOL(new), base);
g_object_ref(G_OBJECT(new));
inserted = g_binary_format_add_symbol(base, new);