diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2015-07-24 18:43:55 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2015-07-24 18:43:55 (GMT) |
commit | 156d2e2f6beda2302552ac79678494d914fda05b (patch) | |
tree | 021825960b7ac3315a336fc085a4f1d07c05df39 /src/format/dex | |
parent | 21537636cd8318cf5a720211619ad3c3023b52e9 (diff) |
Replaced all remaining raw accesses to binary contents with the GBinContent wrapper in binary formats.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@555 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/format/dex')
-rw-r--r-- | src/format/dex/dex-int.c | 84 |
1 files changed, 42 insertions, 42 deletions
diff --git a/src/format/dex/dex-int.c b/src/format/dex/dex-int.c index c3d64ff..914f491 100644 --- a/src/format/dex/dex-int.c +++ b/src/format/dex/dex-int.c @@ -60,8 +60,8 @@ bool read_dex_header(const GDexFormat *format, off_t *pos, dex_header *header) result = true; - content = G_BIN_FORMAT(format)->content; - length = G_BIN_FORMAT(format)->length; + content = NULL; //G_BIN_FORMAT(format)->content; + length = 0; //G_BIN_FORMAT(format)->length; for (i = 0; i < DEX_FILE_MAGIC_LEN && result; i++) result = read_u8(&header->magic[i], content, pos, length, SRE_LITTLE); @@ -127,8 +127,8 @@ bool read_dex_string_id_item(const GDexFormat *format, off_t *pos, string_id_ite result = true; - content = G_BIN_FORMAT(format)->content; - length = G_BIN_FORMAT(format)->length; + content = NULL; //G_BIN_FORMAT(format)->content; + length = 0; //G_BIN_FORMAT(format)->length; result &= read_u32(&str_id->string_data_off, content, pos, length, SRE_LITTLE); @@ -159,8 +159,8 @@ bool read_dex_string_data_item(const GDexFormat *format, off_t *pos, string_data result = true; - content = G_BIN_FORMAT(format)->content; - length = G_BIN_FORMAT(format)->length; + content = NULL; //G_BIN_FORMAT(format)->content; + length = 0; //G_BIN_FORMAT(format)->length; result &= read_uleb128(&str_data->utf16_size, content, pos, length); @@ -193,8 +193,8 @@ bool read_dex_type_id_item(const GDexFormat *format, off_t *pos, type_id_item *i result = true; - content = G_BIN_FORMAT(format)->content; - length = G_BIN_FORMAT(format)->length; + content = NULL; //G_BIN_FORMAT(format)->content; + length = 0; //G_BIN_FORMAT(format)->length; result &= read_u32(&item->descriptor_idx, content, pos, length, SRE_LITTLE); @@ -225,8 +225,8 @@ bool read_dex_proto_id_item(const GDexFormat *format, off_t *pos, proto_id_item result = true; - content = G_BIN_FORMAT(format)->content; - length = G_BIN_FORMAT(format)->length; + content = NULL; //G_BIN_FORMAT(format)->content; + length = 0; //G_BIN_FORMAT(format)->length; result &= read_u32(&proto_id->shorty_idx, content, pos, length, SRE_LITTLE); result &= read_u32(&proto_id->return_type_idx, content, pos, length, SRE_LITTLE); @@ -259,8 +259,8 @@ bool read_dex_field_id_item(const GDexFormat *format, off_t *pos, field_id_item result = true; - content = G_BIN_FORMAT(format)->content; - length = G_BIN_FORMAT(format)->length; + content = NULL; //G_BIN_FORMAT(format)->content; + length = 0; //G_BIN_FORMAT(format)->length; result &= read_u16(&field_id->class_idx, content, pos, length, SRE_LITTLE); result &= read_u16(&field_id->type_idx, content, pos, length, SRE_LITTLE); @@ -293,8 +293,8 @@ bool read_dex_method_id_item(const GDexFormat *format, off_t *pos, method_id_ite result = true; - content = G_BIN_FORMAT(format)->content; - length = G_BIN_FORMAT(format)->length; + content = NULL; //G_BIN_FORMAT(format)->content; + length = 0; //G_BIN_FORMAT(format)->length; result &= read_u16(&meth_id->class_idx, content, pos, length, SRE_LITTLE); result &= read_u16(&meth_id->proto_idx, content, pos, length, SRE_LITTLE); @@ -327,8 +327,8 @@ bool read_dex_class_def_item(const GDexFormat *format, off_t *pos, class_def_ite result = true; - content = G_BIN_FORMAT(format)->content; - length = G_BIN_FORMAT(format)->length; + content = NULL; //G_BIN_FORMAT(format)->content; + length = 0; //G_BIN_FORMAT(format)->length; result &= read_u32(&class_def->class_idx, content, pos, length, SRE_LITTLE); result &= read_u32(&class_def->access_flags, content, pos, length, SRE_LITTLE); @@ -372,8 +372,8 @@ bool read_dex_encoded_field(const GDexFormat *format, off_t *pos, encoded_field result = true; - content = G_BIN_FORMAT(format)->content; - length = G_BIN_FORMAT(format)->length; + content = NULL; //G_BIN_FORMAT(format)->content; + length = 0; //G_BIN_FORMAT(format)->length; result &= read_uleb128(&field->field_idx_diff, content, pos, length); result &= read_uleb128(&field->access_flags, content, pos, length); @@ -405,8 +405,8 @@ bool read_dex_encoded_method(const GDexFormat *format, off_t *pos, encoded_metho result = true; - content = G_BIN_FORMAT(format)->content; - length = G_BIN_FORMAT(format)->length; + content = NULL; //G_BIN_FORMAT(format)->content; + length = 0; //G_BIN_FORMAT(format)->length; result &= read_uleb128(&method->method_idx_diff, content, pos, length); result &= read_uleb128(&method->access_flags, content, pos, length); @@ -439,8 +439,8 @@ bool read_dex_type_item(const GDexFormat *format, off_t *pos, type_item *item) result = true; - content = G_BIN_FORMAT(format)->content; - length = G_BIN_FORMAT(format)->length; + content = NULL; //G_BIN_FORMAT(format)->content; + length = 0; //G_BIN_FORMAT(format)->length; result &= read_u16(&item->type_idx, content, pos, length, SRE_LITTLE); @@ -471,8 +471,8 @@ bool read_dex_type_list(const GDexFormat *format, off_t *pos, type_list *list) result = true; - content = G_BIN_FORMAT(format)->content; - length = G_BIN_FORMAT(format)->length; + content = NULL; //G_BIN_FORMAT(format)->content; + length = 0; //G_BIN_FORMAT(format)->length; result &= read_u32(&list->size, content, pos, length, SRE_LITTLE); @@ -507,8 +507,8 @@ bool read_dex_class_data_item(const GDexFormat *format, off_t *pos, class_data_i result = true; - content = G_BIN_FORMAT(format)->content; - length = G_BIN_FORMAT(format)->length; + content = NULL; //G_BIN_FORMAT(format)->content; + length = 0; //G_BIN_FORMAT(format)->length; item->static_fields = NULL; item->instance_fields = NULL; @@ -625,8 +625,8 @@ bool read_dex_encoded_type_addr_pair(const GDexFormat *format, off_t *pos, encod result = true; - content = G_BIN_FORMAT(format)->content; - length = G_BIN_FORMAT(format)->length; + content = NULL; //G_BIN_FORMAT(format)->content; + length = 0; //G_BIN_FORMAT(format)->length; result &= read_uleb128(&pair->type_idx, content, pos, length); result &= read_uleb128(&pair->addr, content, pos, length); @@ -660,8 +660,8 @@ bool read_dex_encoded_catch_handler(const GDexFormat *format, off_t *pos, encode result = true; - content = G_BIN_FORMAT(format)->content; - length = G_BIN_FORMAT(format)->length; + content = NULL; //G_BIN_FORMAT(format)->content; + length = 0; //G_BIN_FORMAT(format)->length; handler->offset = *pos; @@ -733,8 +733,8 @@ bool read_dex_encoded_catch_handler_list(const GDexFormat *format, off_t *pos, e result = true; - content = G_BIN_FORMAT(format)->content; - length = G_BIN_FORMAT(format)->length; + content = NULL; //G_BIN_FORMAT(format)->content; + length = 0; //G_BIN_FORMAT(format)->length; saved_off = *pos; @@ -808,8 +808,8 @@ bool read_dex_try_item(const GDexFormat *format, off_t *pos, try_item *item) result = true; - content = G_BIN_FORMAT(format)->content; - length = G_BIN_FORMAT(format)->length; + content = NULL; //G_BIN_FORMAT(format)->content; + length = 0; //G_BIN_FORMAT(format)->length; result &= read_u32(&item->start_addr, content, pos, length, SRE_LITTLE); result &= read_u16(&item->insn_count, content, pos, length, SRE_LITTLE); @@ -844,8 +844,8 @@ bool read_dex_code_item(const GDexFormat *format, off_t *pos, code_item *item) result = true; - content = G_BIN_FORMAT(format)->content; - length = G_BIN_FORMAT(format)->length; + content = NULL; //G_BIN_FORMAT(format)->content; + length = 0; //G_BIN_FORMAT(format)->length; result &= read_u16(&item->registers_size, content, pos, length, SRE_LITTLE); result &= read_u16(&item->ins_size, content, pos, length, SRE_LITTLE); @@ -937,8 +937,8 @@ bool read_dex_packed_switch(const GDexFormat *format, off_t *pos, packed_switch result = true; - content = G_BIN_FORMAT(format)->content; - length = G_BIN_FORMAT(format)->length; + content = NULL; //G_BIN_FORMAT(format)->content; + length = 0; //G_BIN_FORMAT(format)->length; packed->targets = NULL; @@ -1006,8 +1006,8 @@ bool read_dex_sparse_switch(const GDexFormat *format, off_t *pos, sparse_switch result = true; - content = G_BIN_FORMAT(format)->content; - length = G_BIN_FORMAT(format)->length; + content = NULL; //G_BIN_FORMAT(format)->content; + length = 0; //G_BIN_FORMAT(format)->length; sparse->keys = NULL; sparse->targets = NULL; @@ -1082,8 +1082,8 @@ bool read_dex_switch(const GDexFormat *format, off_t *pos, dex_switch *dswitch) result = true; - content = G_BIN_FORMAT(format)->content; - length = G_BIN_FORMAT(format)->length; + content = NULL; //G_BIN_FORMAT(format)->content; + length = 0; //G_BIN_FORMAT(format)->length; result &= read_u16(&ident, content, (off_t []) { *pos }, length, SRE_LITTLE); |