diff options
Diffstat (limited to 'plugins')
| -rw-r--r-- | plugins/dex/dex-int.c | 27 | 
1 files changed, 27 insertions, 0 deletions
| diff --git a/plugins/dex/dex-int.c b/plugins/dex/dex-int.c index 9eee67f..150d401 100644 --- a/plugins/dex/dex-int.c +++ b/plugins/dex/dex-int.c @@ -61,6 +61,9 @@ bool read_dex_header(const GDexFormat *format, vmpa2t *pos, dex_header *header)      GBinContent *content;                   /* Contenu binaire à lire      */      size_t i;                               /* Boucle de parcours          */ +    /* Respect de l'alignement sur 4 octets */ +    if (get_phy_addr(pos) % 4 != 0) return false; +      result = true;      content = G_BIN_FORMAT(format)->content; @@ -126,6 +129,9 @@ bool read_dex_string_id_item(const GDexFormat *format, vmpa2t *pos, string_id_it      bool result;                            /* Bilan à retourner           */      GBinContent *content;                   /* Contenu binaire à lire      */ +    /* Respect de l'alignement sur 4 octets */ +    if (get_phy_addr(pos) % 4 != 0) return false; +      content = G_BIN_FORMAT(format)->content;      result = g_binary_content_read_u32(content, pos, SRE_LITTLE, &str_id->string_data_off); @@ -188,6 +194,9 @@ bool read_dex_type_id_item(const GDexFormat *format, vmpa2t *pos, type_id_item *      bool result;                            /* Bilan à retourner           */      GBinContent *content;                   /* Contenu binaire à lire      */ +    /* Respect de l'alignement sur 4 octets */ +    if (get_phy_addr(pos) % 4 != 0) return false; +      content = G_BIN_FORMAT(format)->content;      result = g_binary_content_read_u32(content, pos, SRE_LITTLE, &item->descriptor_idx); @@ -216,6 +225,9 @@ bool read_dex_proto_id_item(const GDexFormat *format, vmpa2t *pos, proto_id_item      bool result;                            /* Bilan à retourner           */      GBinContent *content;                   /* Contenu binaire à lire      */ +    /* Respect de l'alignement sur 4 octets */ +    if (get_phy_addr(pos) % 4 != 0) return false; +      content = G_BIN_FORMAT(format)->content;      result = g_binary_content_read_u32(content, pos, SRE_LITTLE, &proto_id->shorty_idx); @@ -246,6 +258,9 @@ bool read_dex_field_id_item(const GDexFormat *format, vmpa2t *pos, field_id_item      bool result;                            /* Bilan à retourner           */      GBinContent *content;                   /* Contenu binaire à lire      */ +    /* Respect de l'alignement sur 4 octets */ +    if (get_phy_addr(pos) % 4 != 0) return false; +      content = G_BIN_FORMAT(format)->content;      result = g_binary_content_read_u16(content, pos, SRE_LITTLE, &field_id->class_idx); @@ -276,6 +291,9 @@ bool read_dex_method_id_item(const GDexFormat *format, vmpa2t *pos, method_id_it      bool result;                            /* Bilan à retourner           */      GBinContent *content;                   /* Contenu binaire à lire      */ +    /* Respect de l'alignement sur 4 octets */ +    if (get_phy_addr(pos) % 4 != 0) return false; +      content = G_BIN_FORMAT(format)->content;      result = g_binary_content_read_u16(content, pos, SRE_LITTLE, &meth_id->class_idx); @@ -306,6 +324,9 @@ bool read_dex_class_def_item(const GDexFormat *format, vmpa2t *pos, class_def_it      bool result;                            /* Bilan à retourner           */      GBinContent *content;                   /* Contenu binaire à lire      */ +    /* Respect de l'alignement sur 4 octets */ +    if (get_phy_addr(pos) % 4 != 0) return false; +      content = G_BIN_FORMAT(format)->content;      result = g_binary_content_read_u32(content, pos, SRE_LITTLE, &class_def->class_idx); @@ -440,6 +461,9 @@ bool read_dex_type_list(const GDexFormat *format, vmpa2t *pos, type_list *list)      bool result;                            /* Bilan à retourner           */      GBinContent *content;                   /* Contenu binaire à lire      */ +    /* Respect de l'alignement sur 4 octets */ +    if (get_phy_addr(pos) % 4 != 0) return false; +      result = true;      content = G_BIN_FORMAT(format)->content; @@ -803,6 +827,9 @@ bool read_dex_code_item(const GDexFormat *format, vmpa2t *pos, code_item *item)      uint16_t padding;                       /* Eventuel alignement         */      uint16_t i;                             /* Boucle de parcours          */ +    /* Respect de l'alignement sur 4 octets */ +    if (get_phy_addr(pos) % 4 != 0) return false; +      result = true;      content = G_BIN_FORMAT(format)->content; | 
