diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2016-02-10 10:02:16 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2016-02-10 10:02:16 (GMT) |
commit | 465488d5b231c2552116a305c48b5fcccea55a09 (patch) | |
tree | f4d072ad9cf56466f4e55d0608f7a3fe9204efaf /src/format/dex/dex.c | |
parent | 946f5f093c7265dc5a5e00694325605b249eea43 (diff) |
Improved the support of the DEX format.
Diffstat (limited to 'src/format/dex/dex.c')
-rwxr-xr-x | src/format/dex/dex.c | 40 |
1 files changed, 37 insertions, 3 deletions
diff --git a/src/format/dex/dex.c b/src/format/dex/dex.c index ed2565f..764b6dc 100755 --- a/src/format/dex/dex.c +++ b/src/format/dex/dex.c @@ -256,6 +256,11 @@ GBinFormat *g_dex_format_new(GBinContent *content, GExeFormat *parent) if (!read_dex_header(result, &pos, &result->header)) goto gdfn_error; + + + /* TODO : vérifier que les *_id ne se chevauchent pas */ + + if (!load_all_dex_types(result)) goto gdfn_error; @@ -271,14 +276,15 @@ GBinFormat *g_dex_format_new(GBinContent *content, GExeFormat *parent) if (!load_all_dex_classes(result)) goto gdfn_error; + if (!g_binary_format_complete_loading(G_BIN_FORMAT(result))) + goto gdfn_error; + return G_BIN_FORMAT(result); gdfn_error: g_object_unref(G_OBJECT(result)); - exit(0); - return NULL; } @@ -328,7 +334,7 @@ static void g_dex_format_refine_portions(const GDexFormat *format, GPortionLayer max = g_dex_format_count_classes(format); for (i = 0; i < max; i++) - g_dex_class_include_as_portion(format->classes[i], layer); + g_dex_class_include_as_portion(format->classes[i], format, layer); } @@ -508,6 +514,32 @@ char *_g_data_type_to_string(const GDataType *type, bool simple) + + + + +/****************************************************************************** +* * +* Paramètres : format = informations chargées à consulter. * +* * +* Description : Présente l'en-tête DEX du format chargé. * +* * +* Retour : Pointeur vers la description principale. * +* * +* Remarques : - * +* * +******************************************************************************/ + +const dex_header *g_dex_format_get_header(const GDexFormat *format) +{ + return &format->header; + +} + + + + + /****************************************************************************** * * * Paramètres : format = description de l'exécutable à consulter. * @@ -542,6 +574,8 @@ size_t g_dex_format_count_classes(const GDexFormat *format) GDexClass *g_dex_format_get_class(const GDexFormat *format, size_t index) { + /* TODO : ref() */ + return format->classes[index]; } |