summaryrefslogtreecommitdiff
path: root/plugins/dex
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2020-05-28 07:14:16 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2020-05-28 07:14:16 (GMT)
commit5dcc4df15a8d84b214bb3f6f0fcfe30f21cb0972 (patch)
tree71647bc0f253d95c8a08762eeaf2ffa01e2de025 /plugins/dex
parenteef3392134b489fbff7c96046581c987ff7192bd (diff)
Saved the first steps for a new loading process.
Diffstat (limited to 'plugins/dex')
-rw-r--r--plugins/dex/format.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/plugins/dex/format.c b/plugins/dex/format.c
index 84ddb4d..ccf21a8 100644
--- a/plugins/dex/format.c
+++ b/plugins/dex/format.c
@@ -250,6 +250,7 @@ static void g_dex_format_finalize(GDexFormat *format)
GExeFormat *g_dex_format_new(GBinContent *content)
{
GDexFormat *result; /* Structure à retourner */
+ vmpa2t pos; /* Position de tête de lecture */
if (!check_dex_format(content))
return NULL;
@@ -260,6 +261,14 @@ GExeFormat *g_dex_format_new(GBinContent *content)
result->pool = g_dex_pool_new(result);
+ init_vmpa(&pos, 0, VMPA_NO_VIRTUAL);
+
+ if (!read_dex_header(result, &pos, &result->header))
+ {
+ g_object_unref(G_OBJECT(result));
+ return NULL;
+ }
+
return G_EXE_FORMAT(result);
}
@@ -341,11 +350,6 @@ static bool g_dex_format_analyze(GDexFormat *format, wgroup_id_t gid, GtkStatusS
base = G_BIN_FORMAT(format);
exe = G_EXE_FORMAT(format);
- init_vmpa(&pos, 0, VMPA_NO_VIRTUAL);
-
- if (!read_dex_header(format, &pos, &format->header))
- goto gdfa_error;
-
/* Vérification des tailles fournies */
size = g_binary_content_compute_size(G_KNOWN_FORMAT(base)->content);