summaryrefslogtreecommitdiff
path: root/src/format/dex/dex.c
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2016-12-29 10:30:28 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2016-12-29 10:30:28 (GMT)
commit9f9041e11efa71cb043425cd5e89daea0247e76c (patch)
tree84d8704c291a5efef46af1e14a2aa3544dc29455 /src/format/dex/dex.c
parent403a0519ec85a156a7f306b045d9cab619302473 (diff)
Cut binary data into several areas using all the available CPUs and less memory.
Diffstat (limited to 'src/format/dex/dex.c')
-rwxr-xr-xsrc/format/dex/dex.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/format/dex/dex.c b/src/format/dex/dex.c
index c550375..df920b2 100755
--- a/src/format/dex/dex.c
+++ b/src/format/dex/dex.c
@@ -58,7 +58,7 @@ static void g_dex_format_finalize(GDexFormat *);
static const char *g_dex_format_get_target_machine(const GDexFormat *);
/* Etend la définition des portions au sein d'un binaire. */
-static void g_dex_format_refine_portions(const GDexFormat *, GPortionLayer *);
+static void g_dex_format_refine_portions(GDexFormat *);
/* Fournit l'emplacement d'une section donnée. */
static bool g_dex_format_get_section_range_by_name(const GDexFormat *, const char *, mrange_t *);
@@ -247,12 +247,14 @@ GBinFormat *g_dex_format_new(GBinContent *content, GExeFormat *parent, GtkStatus
{
GDexFormat *result; /* Structure à retourner */
GBinFormat *base; /* Version basique du format */
+ GExeFormat *exe_format; /* Autre version du format */
vmpa2t pos; /* Position de tête de lecture */
wgroup_id_t gid; /* Identifiant pour les tâches */
result = g_object_new(G_TYPE_DEX_FORMAT, NULL);
base = G_BIN_FORMAT(result);
+ exe_format = G_EXE_FORMAT(result);
g_binary_format_set_content(base, content);
@@ -277,7 +279,7 @@ GBinFormat *g_dex_format_new(GBinContent *content, GExeFormat *parent, GtkStatus
if (!load_all_dex_classes(result, gid, status))
goto gdfn_error;
- if (!g_binary_format_complete_loading(base, status))
+ if (!g_executable_format_complete_loading(exe_format, status))
goto gdfn_error;
return base;
@@ -322,20 +324,18 @@ static const char *g_dex_format_get_target_machine(const GDexFormat *format)
* *
******************************************************************************/
-static void g_dex_format_refine_portions(const GDexFormat *format, GPortionLayer *main)
+static void g_dex_format_refine_portions(GDexFormat *format)
{
- GPortionLayer *layer; /* Couche à mettre en place */
+ GExeFormat *exe_format; /* Autre version du format */
size_t max; /* Nombre d'itérations prévues */
size_t i; /* Boucle de parcours */
- layer = g_portion_layer_new(NO_LENGTH_YET, _("Code"));
-
- g_portion_layer_attach_sub(main, layer);
+ exe_format = G_EXE_FORMAT(format);
max = g_dex_format_count_classes(format);
for (i = 0; i < max; i++)
- g_dex_class_include_as_portion(format->classes[i], format, layer);
+ g_dex_class_include_as_portion(format->classes[i], exe_format);
}