summaryrefslogtreecommitdiff
path: root/src/format/dex/pool.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/format/dex/pool.c')
-rw-r--r--src/format/dex/pool.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/format/dex/pool.c b/src/format/dex/pool.c
index 9237839..f8c5a4a 100644
--- a/src/format/dex/pool.c
+++ b/src/format/dex/pool.c
@@ -24,6 +24,9 @@
#include "pool.h"
+#include <string.h>
+
+
#include "dex-int.h"
#include "../mangling/demangler.h"
@@ -31,6 +34,41 @@
/******************************************************************************
* *
+* Paramètres : format = description de l'exécutable à analyser. *
+* *
+* Description : Charge en mémoire toutes les chaînes trouvées. *
+* *
+* Retour : Bilan de l'opération. *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+bool find_all_dex_strings(GDexFormat *format)
+{
+ uint32_t i; /* Boucle de parcours */
+ const char *text; /* Texte issu du binaire */
+ GBinSymbol *symbol; /* Nouveau symbole construit */
+
+ for (i = 0; i < format->header.string_ids_size; i++)
+ {
+ text = get_string_from_dex_pool(format, i);
+ if (text == NULL) continue;
+
+ symbol = g_binary_symbol_new(STP_STRING, NULL, i);
+ g_binary_symbol_set_alt_name(symbol, strdup(text));
+
+ g_binary_format_add_symbol(G_BIN_FORMAT(format), symbol);
+
+ }
+
+ return true;
+
+}
+
+
+/******************************************************************************
+* *
* Paramètres : format = représentation interne du format DEX à consulter. *
* index = index du type recherchée. *
* *