summaryrefslogtreecommitdiff
path: root/src/format/dex/pool.c
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2012-10-28 15:59:12 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2012-10-28 15:59:12 (GMT)
commitc3aba0893c29cc098c029306fd7a4c8c1fa2eee2 (patch)
tree49432db1af3115758a216ac5bfd92d5935929858 /src/format/dex/pool.c
parent55866b34f5cff022a465d58f808450f25f354218 (diff)
Updated the code of the old panel and displayed found strings again.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@276 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
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. *
* *