Rizin
unix-like reverse engineering framework and cli tools
|
Go to the source code of this file.
Classes | |
struct | dex_access_flags_readable_t |
Macros | |
#define | DEX_INVALID_CLASS "Lunknown_class;" |
#define | DEX_INVALID_METHOD "unknown_method" |
#define | read_le_bits_or_fail(bits, buf, val, fail) |
#define | read_le_at_bits_or_fail(bits, buf, val, offset, fail) |
#define | read_le32_or_fail(buf, val, fail) read_le_bits_or_fail(32, buf, val, fail) |
#define | read_le16_or_fail(buf, val, fail) read_le_bits_or_fail(16, buf, val, fail) |
#define | read_le32_at_or_fail(buf, val, offset, fail) read_le_at_bits_or_fail(32, buf, val, offset, fail) |
#define | read_le16_at_or_fail(buf, val, offset, fail) read_le_at_bits_or_fail(16, buf, val, offset, fail) |
#define | dex_is_static(a) (a & ACCESS_FLAG_STATIC) |
#define | dex_is_varargs(a) (a & ACCESS_FLAG_VARARGS) |
#define | dex_fail_if_bad_ids(name, z, s, g) |
#define | CLASS_ACCESS_FLAGS_SIZE 18 |
#define | dex_field_id_free free |
#define | dex_method_id_free free |
Typedefs | |
typedef struct dex_access_flags_readable_t | DexAccessFlagsReadable |
Variables | |
static const DexAccessFlagsReadable | access_flags_list [CLASS_ACCESS_FLAGS_SIZE] |
#define dex_is_static | ( | a | ) | (a & ACCESS_FLAG_STATIC) |
#define dex_is_varargs | ( | a | ) | (a & ACCESS_FLAG_VARARGS) |
typedef struct dex_access_flags_readable_t DexAccessFlagsReadable |
Definition at line 836 of file dex.c.
References ACCESS_FLAG_ABSTRACT, ACCESS_FLAG_BRIDGE, ACCESS_FLAG_CONSTRUCTOR, ACCESS_FLAG_DECLARED_SYNCHRONIZED, ACCESS_FLAG_FINAL, ACCESS_FLAG_NATIVE, ACCESS_FLAG_PRIVATE, ACCESS_FLAG_PROTECTED, ACCESS_FLAG_PUBLIC, ACCESS_FLAG_STATIC, ACCESS_FLAG_STRICT, ACCESS_FLAG_SYNCHRONIZED, ACCESS_FLAG_SYNTHETIC, ACCESS_FLAG_VARARGS, flags, RZ_BIN_METH_ABSTRACT, RZ_BIN_METH_BRIDGE, RZ_BIN_METH_CONSTRUCTOR, RZ_BIN_METH_DECLARED_SYNCHRONIZED, RZ_BIN_METH_FINAL, RZ_BIN_METH_NATIVE, RZ_BIN_METH_PRIVATE, RZ_BIN_METH_PROTECTED, RZ_BIN_METH_PUBLIC, RZ_BIN_METH_STATIC, RZ_BIN_METH_STRICT, RZ_BIN_METH_SYNCHRONIZED, RZ_BIN_METH_SYNTHETIC, RZ_BIN_METH_VARARGS, and ut64().
Referenced by dex_field_to_bin_field(), dex_field_to_symbol(), and dex_method_to_symbol().
|
static |
Definition at line 183 of file dex.c.
References dex_class_def_t::direct_methods, free(), dex_class_def_t::instance_fields, dex_class_def_t::interfaces, rz_list_free(), dex_class_def_t::static_fields, and dex_class_def_t::virtual_methods.
Referenced by dex_class_def_new(), and rz_bin_dex_new().
|
static |
Definition at line 262 of file dex.c.
References dex_class_def_t::_padding1, dex_class_def_t::_padding2, dex_class_def_t::access_flags, dex_class_def_t::annotations_offset, dex_class_def_t::class_data_offset, dex_class_def_t::class_idx, dex_class_def_free(), dex_new_encoded_field(), dex_new_encoded_method(), dex_class_def_t::direct_methods, free(), i, dex_class_def_t::instance_fields, dex_class_def_t::interfaces, dex_class_def_t::interfaces_offset, dex_class_def_t::n_interfaces, NULL, dex_class_def_t::offset, read_le16_or_fail, read_le32_or_fail, rz_buf_seek(), RZ_BUF_SET, rz_buf_uleb128(), rz_list_append(), rz_list_newf(), RZ_NEW0, RZ_NEWS0, dex_class_def_t::source_file_idx, dex_class_def_t::static_fields, dex_class_def_t::static_values_offset, dex_class_def_t::superclass_idx, ut64(), and dex_class_def_t::virtual_methods.
Referenced by dex_parse().
Definition at line 393 of file dex.c.
References dex_t::class_defs, dex_method_id_t::code_offset, dex_encoded_method_t::code_offset, dex_method_id_t::code_size, dex_encoded_method_t::code_size, dex_class_def_t::direct_methods, i, malloc(), dex_t::method_ids, dex_encoded_method_t::method_idx, NULL, dex_t::relocs_buffer, dex_t::relocs_code, dex_t::relocs_offset, dex_t::relocs_size, rz_buf_new_with_bytes(), rz_pvector_at(), rz_pvector_foreach, rz_pvector_len(), and dex_class_def_t::virtual_methods.
Referenced by dex_parse().
|
static |
Definition at line 148 of file dex.c.
References field_id, free(), NULL, read_le16_or_fail, read_le32_or_fail, and RZ_NEW0.
Referenced by dex_parse().
|
static |
Definition at line 986 of file dex.c.
References ACCESS_FLAG_STATIC, dex_encoded_field_t::access_flags, dex_access_flags_to_bin_flags(), dex_resolve_string_id(), dex_resolve_type_id(), field_id, rz_bin_field_t::flags, rz_bin_field_t::name, NULL, dex_encoded_field_t::offset, rz_bin_field_t::paddr, rz_bin_dex_access_flags_readable(), RZ_DEX_VIRT_ADDRESS, RZ_NEW0, rz_bin_field_t::type, UT32_MAX, ut64(), rz_bin_field_t::vaddr, rz_bin_field_t::visibility, and rz_bin_field_t::visibility_str.
Referenced by dex_resolve_fields_in_class().
|
static |
Definition at line 1053 of file dex.c.
References dex_encoded_field_t::access_flags, rz_bin_symbol_t::bind, rz_bin_symbol_t::classname, dex_access_flags_to_bin_flags(), dex_is_static, dex_resolve_library(), dex_resolve_string_id(), dex_resolve_type_id(), field_id, dex_encoded_field_t::field_idx, rz_bin_symbol_t::is_imported, rz_bin_symbol_t::libname, rz_bin_symbol_t::method_flags, rz_bin_symbol_t::name, NULL, dex_encoded_field_t::offset, rz_bin_symbol_t::ordinal, rz_bin_symbol_t::paddr, RZ_BIN_BIND_GLOBAL_STR, RZ_BIN_BIND_LOCAL_STR, rz_bin_dex_access_flags_readable(), RZ_BIN_TYPE_FIELD_STR, RZ_DEX_VIRT_ADDRESS, RZ_NEW0, rz_bin_symbol_t::type, UT32_MAX, rz_bin_symbol_t::vaddr, rz_bin_symbol_t::visibility, and rz_bin_symbol_t::visibility_str.
Referenced by dex_resolve_fields_in_class_as_symbols().
|
static |
Definition at line 166 of file dex.c.
References dex_method_id_t::class_idx, free(), dex_method_id_t::name_idx, NULL, dex_method_id_t::offset, dex_method_id_t::proto_idx, read_le16_or_fail, read_le32_or_fail, and RZ_NEW0.
Referenced by dex_parse().
|
static |
Definition at line 909 of file dex.c.
References dex_encoded_method_t::access_flags, rz_bin_symbol_t::bind, dex_method_id_t::class_idx, rz_bin_symbol_t::classname, dex_encoded_method_t::code_offset, dex_encoded_method_t::code_size, dex_access_flags_to_bin_flags(), dex_is_static, dex_is_varargs, dex_resolve_library(), dex_resolve_proto_id(), dex_resolve_string_id(), dex_resolve_type_id(), rz_bin_symbol_t::dname, rz_bin_symbol_t::is_imported, rz_bin_symbol_t::libname, rz_bin_symbol_t::method_flags, dex_encoded_method_t::method_idx, rz_bin_symbol_t::name, dex_method_id_t::name_idx, NULL, rz_bin_symbol_t::ordinal, rz_bin_symbol_t::paddr, dex_method_id_t::proto_idx, RZ_BIN_BIND_GLOBAL_STR, RZ_BIN_BIND_LOCAL_STR, rz_bin_dex_access_flags_readable(), RZ_BIN_TYPE_METH_STR, RZ_DEX_RELOC_ADDRESS, RZ_DEX_VIRT_ADDRESS, RZ_NEW0, rz_bin_symbol_t::size, rz_bin_symbol_t::type, UT32_MAX, rz_bin_symbol_t::vaddr, rz_bin_symbol_t::visibility, and rz_bin_symbol_t::visibility_str.
Referenced by dex_resolve_methods_in_class().
|
static |
Definition at line 195 of file dex.c.
References dex_encoded_field_t::access_flags, dex_encoded_field_t::field_idx, NULL, dex_encoded_field_t::offset, rz_buf_tell(), rz_buf_uleb128(), RZ_NEW0, and ut64().
Referenced by dex_class_def_new().
|
static |
Definition at line 216 of file dex.c.
References dex_encoded_method_t::access_flags, dex_method_id_t::code_offset, dex_encoded_method_t::code_offset, dex_method_id_t::code_size, dex_encoded_method_t::code_size, dex_encoded_method_t::debug_info_offset, free(), dex_encoded_method_t::ins_size, dex_encoded_method_t::method_idx, NULL, dex_encoded_method_t::offset, dex_encoded_method_t::outs_size, read_le16_at_or_fail, read_le32_at_or_fail, dex_encoded_method_t::registers_size, rz_buf_tell(), rz_buf_uleb128(), RZ_NEW0, rz_pvector_at(), rz_pvector_len(), dex_encoded_method_t::tries_size, and ut64().
Referenced by dex_class_def_new().
Definition at line 479 of file dex.c.
References buffer_size, dex_t::checksum, dex_t::checksum_offset, dex_t::class_defs, dex_t::class_defs_offset, dex_t::class_defs_size, dex_t::data_offset, dex_t::data_size, dex_class_def_new(), DEX_CLASS_DEF_SIZE, dex_create_relocations(), dex_fail_if_bad_ids, dex_field_id_new(), DEX_FIELD_ID_SIZE, dex_method_id_new(), DEX_METHOD_ID_SIZE, dex_proto_id_new(), DEX_PROTO_ID_SIZE, dex_resolve_all_virtual_methods(), dex_string_new(), DEX_TYPE_ID_SIZE, dex_t::endian_tag, field_id, dex_t::field_ids, dex_t::field_ids_offset, dex_t::field_ids_size, dex_t::file_size, dex_t::header_offset, dex_t::header_size, i, dex_t::link_offset, dex_t::link_size, dex_t::magic, dex_t::map_offset, dex_t::method_ids, dex_t::method_ids_offset, dex_t::method_ids_size, dex_t::proto_ids, dex_t::proto_ids_offset, dex_t::proto_ids_size, read(), read_le32_at_or_fail, read_le32_or_fail, dex_t::relocs_offset, rz_bin_dex_free(), rz_buf_read(), rz_buf_seek(), RZ_BUF_SET, rz_buf_size(), rz_buf_tell(), RZ_DEX_RELOC_ADDRESS, RZ_LOG_ERROR, RZ_NEWS0, rz_pvector_push(), rz_pvector_reserve(), dex_t::signature, dex_t::signature_offset, st64, dex_t::string_ids_offset, dex_t::string_ids_size, dex_t::strings, dex_t::type_ids_offset, dex_t::type_ids_size, dex_t::types, ut64(), and dex_t::version.
Referenced by rz_bin_dex_new().
|
static |
Definition at line 104 of file dex.c.
References free(), and dex_proto_id_t::type_list.
Referenced by rz_bin_dex_new().
|
static |
Definition at line 112 of file dex.c.
References count, free(), i, NULL, dex_proto_id_t::offset, read_le16_at_or_fail, read_le32_at_or_fail, read_le32_or_fail, dex_proto_id_t::return_type_idx, RZ_NEW0, RZ_NEWS, dex_proto_id_t::shorty_idx, dex_proto_id_t::type_list, and dex_proto_id_t::type_list_size.
Referenced by dex_parse().
|
static |
Definition at line 377 of file dex.c.
References dex_t::class_defs, dex_method_id_t::class_idx, dex_method_id_t::code_offset, dex_resolve_virtual_method_code(), dex_t::method_ids, NULL, dex_t::relocs_size, rz_pvector_at(), rz_pvector_foreach, rz_pvector_len(), and dex_class_def_t::superclass_idx.
Referenced by dex_parse().
|
static |
Definition at line 1693 of file dex.c.
References dex_encoded_method_t::access_flags, dex_method_id_t::code_offset, dex_encoded_method_t::code_offset, dex_is_static, dex_resolve_string_id(), dex_class_def_t::direct_methods, entrypoints(), free(), dex_t::method_ids, dex_encoded_method_t::method_idx, dex_method_id_t::name_idx, NULL, rz_bin_addr_t::paddr, PFMT64u, RZ_DEX_RELOC_ADDRESS, RZ_DEX_VIRT_ADDRESS, rz_list_append(), rz_list_newf(), RZ_LOG_INFO, RZ_NEW0, rz_pvector_at(), rz_pvector_len(), rz_bin_addr_t::vaddr, and dex_class_def_t::virtual_methods.
Referenced by rz_bin_dex_entrypoints().
|
static |
Definition at line 1008 of file dex.c.
References dex_field_to_bin_field(), field_id, dex_t::field_ids, dex_encoded_field_t::field_idx, fields, dex_class_def_t::instance_fields, NULL, PFMT64u, rz_bin_field_free(), rz_list_append(), rz_list_newf(), RZ_LOG_INFO, rz_pvector_at(), rz_pvector_len(), and dex_class_def_t::static_fields.
Referenced by rz_bin_dex_classes(), and rz_bin_dex_fields().
|
static |
Definition at line 1075 of file dex.c.
References dex_field_to_symbol(), field_id, dex_t::field_ids, dex_encoded_field_t::field_idx, fields, dex_class_def_t::instance_fields, NULL, PFMT64u, rz_bin_symbol_free(), rz_list_append(), rz_list_newf(), RZ_LOG_INFO, rz_pvector_at(), rz_pvector_len(), and dex_class_def_t::static_fields.
Referenced by rz_bin_dex_symbols().
|
static |
Definition at line 899 of file dex.c.
References NULL, rz_str_replace_ch(), and strdup().
Referenced by dex_field_to_symbol(), dex_method_to_symbol(), and rz_bin_dex_symbols().
|
static |
Definition at line 939 of file dex.c.
References dex_method_to_symbol(), dex_class_def_t::direct_methods, dex_t::method_ids, dex_encoded_method_t::method_idx, NULL, PFMT64u, rz_bin_symbol_free(), rz_list_append(), rz_list_newf(), RZ_LOG_INFO, rz_pvector_at(), rz_pvector_len(), and dex_class_def_t::virtual_methods.
Referenced by rz_bin_dex_classes(), and rz_bin_dex_symbols().
|
static |
Definition at line 792 of file dex.c.
References dex_string_t::data, dex_resolve_string_id_native(), i, NULL, dex_t::proto_ids, dex_proto_id_t::return_type_idx, RZ_LOG_INFO, rz_pvector_at(), rz_pvector_len(), rz_strbuf_append(), rz_strbuf_append_n(), rz_strbuf_drain(), rz_strbuf_free(), rz_strbuf_new(), sb, dex_string_t::size, dex_t::type_ids_size, dex_proto_id_t::type_list, dex_proto_id_t::type_list_size, and dex_t::types.
Referenced by dex_method_to_symbol(), rz_bin_dex_imports(), rz_bin_dex_resolve_method_by_idx(), rz_bin_dex_resolve_proto_by_idx(), and rz_bin_dex_symbols().
Definition at line 774 of file dex.c.
References dex_string_t::data, dex_resolve_string_id_native(), NULL, RZ_LOG_INFO, rz_str_ndup(), and dex_string_t::size.
Referenced by dex_field_to_bin_field(), dex_field_to_symbol(), dex_method_to_symbol(), dex_resolve_entrypoints_in_class(), dex_resolve_symbol_in_class_methods(), dex_resolve_type_id(), rz_bin_dex_imports(), rz_bin_dex_resolve_field_by_idx(), rz_bin_dex_resolve_method_by_idx(), rz_bin_dex_resolve_string_by_idx(), and rz_bin_dex_symbols().
Definition at line 767 of file dex.c.
References NULL, rz_pvector_at(), rz_pvector_len(), and dex_t::strings.
Referenced by dex_resolve_proto_id(), dex_resolve_string_id(), and rz_bin_dex_resolve_string_offset_by_idx().
|
static |
Definition at line 1594 of file dex.c.
References dex_method_id_t::code_offset, dex_encoded_method_t::code_offset, dex_resolve_string_id(), dex_class_def_t::direct_methods, free(), dex_t::method_ids, dex_encoded_method_t::method_idx, dex_method_id_t::name_idx, NULL, PFMT64u, resolve(), RZ_BIN_SPECIAL_SYMBOL_ENTRY, RZ_BIN_SPECIAL_SYMBOL_INIT, RZ_BIN_SPECIAL_SYMBOL_MAIN, RZ_DEX_RELOC_ADDRESS, RZ_DEX_VIRT_ADDRESS, RZ_LOG_INFO, rz_pvector_at(), rz_pvector_len(), and dex_class_def_t::virtual_methods.
Referenced by rz_bin_dex_resolve_symbol().
Definition at line 783 of file dex.c.
References dex_resolve_string_id(), NULL, RZ_LOG_INFO, dex_t::type_ids_size, and dex_t::types.
Referenced by dex_field_to_bin_field(), dex_field_to_symbol(), dex_method_to_symbol(), rz_bin_dex_classes(), rz_bin_dex_imports(), rz_bin_dex_libraries(), rz_bin_dex_resolve_class_by_idx(), rz_bin_dex_resolve_field_by_idx(), rz_bin_dex_resolve_method_by_idx(), and rz_bin_dex_symbols().
|
static |
Definition at line 359 of file dex.c.
References dex_method_id_t::class_idx, dex_method_id_t::code_offset, dex_method_id_t::code_size, dex_t::method_ids, dex_method_id_t::name_idx, NULL, dex_method_id_t::proto_idx, and rz_pvector_foreach.
Referenced by dex_resolve_all_virtual_methods().
|
static |
Definition at line 69 of file dex.c.
References dex_string_t::data, and free().
Referenced by rz_bin_dex_new().
Definition at line 77 of file dex.c.
References free(), malloc(), NULL, pread, read(), rz_buf_read(), rz_buf_uleb128(), RZ_NEW0, st64, and ut64().
Referenced by dex_parse().
|
static |
Definition at line 1116 of file dex.c.
References rz_bin_class_t::fields, free(), rz_bin_class_t::methods, rz_bin_class_t::name, rz_list_free(), rz_bin_class_t::super, and rz_bin_class_t::visibility_str.
Referenced by rz_bin_dex_classes().
Definition at line 710 of file dex.c.
References ACCESS_FLAG_VARARGS, access_flags_list, CLASS_ACCESS_FLAGS_SIZE, dex_access_flags_readable_t::flag, i, NULL, dex_access_flags_readable_t::readable, rz_strbuf_appendf(), rz_strbuf_drain(), rz_strbuf_new(), and sb.
Referenced by decode_access_flags(), dex_field_to_bin_field(), dex_field_to_symbol(), dex_method_to_symbol(), and rz_bin_dex_classes().
RZ_API void rz_bin_dex_checksum | ( | RZ_NONNULL RzBinDex * | dex, |
RZ_NONNULL RzBinHash * | hash | ||
) |
Sets the RzBinHash dex checksum (adler32)
Definition at line 1990 of file dex.c.
References rz_return_if_fail, and rz_write_le32().
Referenced by info().
RZ_API RZ_OWN RzList* rz_bin_dex_classes | ( | RZ_NONNULL RzBinDex * | dex | ) |
Returns a RzList<RzBinClass*> containing the dex classes.
Definition at line 1131 of file dex.c.
References dex_class_def_t::access_flags, rz_bin_class_t::addr, dex_class_def_t::class_idx, classes(), dex_resolve_fields_in_class(), dex_resolve_methods_in_class(), dex_resolve_type_id(), rz_bin_class_t::fields, free(), free_rz_bin_class(), rz_bin_class_t::index, rz_bin_class_t::methods, rz_bin_class_t::name, NULL, dex_class_def_t::offset, rz_bin_dex_access_flags_readable(), rz_list_append(), rz_list_newf(), RZ_NEW0, RZ_NEWS0, rz_pvector_foreach, rz_pvector_len(), rz_return_val_if_fail, rz_bin_class_t::super, dex_class_def_t::superclass_idx, rz_bin_class_t::visibility, and rz_bin_class_t::visibility_str.
Referenced by classes().
RZ_API ut64 rz_bin_dex_debug_info | ( | RZ_NONNULL RzBinDex * | dex | ) |
Returns the dex debug info RzBin values.
Definition at line 2041 of file dex.c.
References rz_return_val_if_fail.
Referenced by info().
RZ_API RZ_OWN RzList* rz_bin_dex_entrypoints | ( | RZ_NONNULL RzBinDex * | dex | ) |
Returns a RzList<RzBinAddr*> containing the dex entripoints.
Definition at line 1792 of file dex.c.
References dex_resolve_entrypoints_in_class(), entrypoints(), free(), list(), NULL, rz_list_free(), rz_list_join(), rz_list_newf(), rz_pvector_foreach, and rz_return_val_if_fail.
Referenced by entrypoints().
RZ_API RZ_OWN RzList* rz_bin_dex_fields | ( | RZ_NONNULL RzBinDex * | dex | ) |
Returns a RzList<RzBinField*> containing the dex fields.
Definition at line 1232 of file dex.c.
References dex_resolve_fields_in_class(), fields, free(), NULL, rz_bin_field_free(), rz_list_free(), rz_list_join(), rz_list_newf(), RZ_NEWS0, rz_pvector_foreach, rz_pvector_len(), and rz_return_val_if_fail.
Referenced by fields().
RZ_API void rz_bin_dex_free | ( | RZ_NULLABLE RzBinDex * | dex | ) |
Frees a RzBinDex struct.
Definition at line 649 of file dex.c.
References free(), rz_buf_free(), and rz_pvector_free().
Referenced by destroy(), dex_parse(), and rz_bin_dex_new().
RZ_API RZ_OWN RzList* rz_bin_dex_imports | ( | RZ_NONNULL RzBinDex * | dex | ) |
Returns a RzList<RzBinImport*> containing the dex imports.
Definition at line 1379 of file dex.c.
References dex_method_id_t::class_idx, dex_class_def_t::class_idx, dex_resolve_proto_id(), dex_resolve_string_id(), dex_resolve_type_id(), field_id, free(), i, imports(), dex_method_id_t::name_idx, NULL, dex_method_id_t::proto_idx, RZ_BIN_BIND_WEAK_STR, rz_bin_import_free(), RZ_BIN_TYPE_FIELD_STR, RZ_BIN_TYPE_FUNC_STR, rz_list_append(), rz_list_newf(), RZ_NEW0, RZ_NEWS0, rz_pvector_foreach, rz_pvector_len(), rz_return_val_if_fail, rz_str_rchr(), rz_str_replace_ch(), rz_str_replace_char(), and strdup().
Referenced by imports().
RZ_API RZ_OWN RzList* rz_bin_dex_libraries | ( | RZ_NONNULL RzBinDex * | dex | ) |
Returns a RzList<char*> containing the dex libraries.
Definition at line 1520 of file dex.c.
References dex_method_id_t::class_idx, dex_class_def_t::class_idx, compare_strings(), dex_resolve_type_id(), free(), i, libraries(), NULL, p, rz_list_append(), rz_list_find(), rz_list_newf(), RZ_NEWS0, rz_pvector_foreach, rz_pvector_len(), rz_return_val_if_fail, RZ_STR_ISEMPTY, and rz_str_newf().
Referenced by libraries().
RZ_API RZ_OWN RzBinDex* rz_bin_dex_new | ( | RZ_NONNULL RzBuffer * | buf, |
ut64 | base, | ||
RZ_NONNULL Sdb * | kv | ||
) |
Parses the dex file and returns a RzBinDex struct.
Definition at line 669 of file dex.c.
References dex_t::class_defs, dex_class_def_free(), dex_field_id_free, dex_method_id_free, dex_parse(), dex_proto_id_free(), dex_string_free(), dex_t::field_ids, dex_t::method_ids, NULL, dex_t::proto_ids, rz_bin_dex_free(), RZ_NEW0, rz_pvector_new(), rz_return_val_if_fail, and dex_t::strings.
Referenced by load_buffer().
RZ_API RZ_BORROW RzBuffer* rz_bin_dex_relocations | ( | RZ_NONNULL RzBinDex * | dex | ) |
This method will create a buffer filled with return-void values to mapped to the imports and allow the code to generate xrefs pointing to the imports
Definition at line 1821 of file dex.c.
References NULL, and rz_return_val_if_fail.
Referenced by virtual_files().
RZ_API RZ_OWN char* rz_bin_dex_resolve_class_by_idx | ( | RZ_NONNULL RzBinDex * | dex, |
ut32 | class_idx | ||
) |
Returns the resolved string linked to the given class id.
Definition at line 1972 of file dex.c.
References dex_resolve_type_id(), NULL, and rz_return_val_if_fail.
Referenced by get_name().
RZ_API RZ_OWN char* rz_bin_dex_resolve_field_by_idx | ( | RZ_NONNULL RzBinDex * | dex, |
ut32 | field_idx | ||
) |
Returns the resolved string linked to the given field id.
Definition at line 1863 of file dex.c.
References dex_resolve_string_id(), dex_resolve_type_id(), field_id, free(), NULL, rz_pvector_at(), rz_pvector_len(), rz_return_val_if_fail, rz_str_newf(), and type.
Referenced by get_name().
RZ_API RZ_OWN char* rz_bin_dex_resolve_method_by_idx | ( | RZ_NONNULL RzBinDex * | dex, |
ut32 | method_idx | ||
) |
Returns the resolved string linked to the given method id.
Definition at line 1829 of file dex.c.
References dex_method_id_t::class_idx, dex_resolve_proto_id(), dex_resolve_string_id(), dex_resolve_type_id(), free(), dex_method_id_t::name_idx, NULL, dex_method_id_t::proto_idx, RZ_FREE, rz_pvector_at(), rz_pvector_len(), rz_return_val_if_fail, and rz_str_newf().
Referenced by get_name().
RZ_API ut64 rz_bin_dex_resolve_method_offset_by_idx | ( | RZ_NONNULL RzBinDex * | dex, |
ut32 | method_idx | ||
) |
Returns the resolved offset linked to the given method id.
Definition at line 1928 of file dex.c.
References dex_method_id_t::code_offset, RZ_DEX_RELOC_ADDRESS, RZ_DEX_VIRT_ADDRESS, RZ_LOG_INFO, rz_pvector_at(), rz_pvector_len(), rz_return_val_if_fail, and UT64_MAX.
Referenced by get_offset().
RZ_API RZ_OWN char* rz_bin_dex_resolve_proto_by_idx | ( | RZ_NONNULL RzBinDex * | dex, |
ut32 | proto_idx | ||
) |
Returns the resolved string linked to the given prototype id.
Definition at line 1981 of file dex.c.
References dex_resolve_proto_id(), NULL, and rz_return_val_if_fail.
Referenced by dex_print_encoded_method(), and get_name().
RZ_API RZ_OWN char* rz_bin_dex_resolve_string_by_idx | ( | RZ_NONNULL RzBinDex * | dex, |
ut32 | string_idx | ||
) |
Returns the resolved string linked to the given string id.
Definition at line 1963 of file dex.c.
References dex_resolve_string_id(), NULL, and rz_return_val_if_fail.
Referenced by dex_print_encoded_field(), dex_print_encoded_method(), get_name(), and rz_bin_dex_resolve_type_id_by_idx().
RZ_API ut64 rz_bin_dex_resolve_string_offset_by_idx | ( | RZ_NONNULL RzBinDex * | dex, |
ut32 | string_idx | ||
) |
Returns the resolved offset linked to the given string id.
Definition at line 1900 of file dex.c.
References dex_resolve_string_id_native(), RZ_DEX_VIRT_ADDRESS, RZ_LOG_INFO, rz_return_val_if_fail, and UT64_MAX.
Referenced by get_offset(), and rz_bin_dex_resolve_type_id_offset_by_idx().
RZ_API RZ_OWN RzBinAddr* rz_bin_dex_resolve_symbol | ( | RZ_NONNULL RzBinDex * | dex, |
RzBinSpecialSymbol | resolve | ||
) |
Returns a RzBinAddr pointer containing the resolved RzBinSpecialSymbol.
Definition at line 1670 of file dex.c.
References dex_resolve_symbol_in_class_methods(), NULL, rz_bin_addr_t::paddr, resolve(), RZ_NEW0, rz_pvector_foreach, rz_return_val_if_fail, UT64_MAX, and rz_bin_addr_t::vaddr.
Referenced by binsym().
RZ_API RZ_OWN char* rz_bin_dex_resolve_type_id_by_idx | ( | RZ_NONNULL RzBinDex * | dex, |
ut32 | type_idx | ||
) |
Returns the resolved string linked to the given type id.
Definition at line 1949 of file dex.c.
References NULL, rz_bin_dex_resolve_string_by_idx(), RZ_LOG_INFO, and rz_return_val_if_fail.
Referenced by dex_print_class_def(), dex_print_class_def_exports(), dex_print_encoded_field(), and dex_print_encoded_method().
RZ_API ut64 rz_bin_dex_resolve_type_id_offset_by_idx | ( | RZ_NONNULL RzBinDex * | dex, |
ut32 | type_idx | ||
) |
Returns the resolved offset linked to the given type id.
Definition at line 1914 of file dex.c.
References rz_bin_dex_resolve_string_offset_by_idx(), RZ_LOG_INFO, rz_return_val_if_fail, and UT64_MAX.
Referenced by get_offset().
RZ_API RZ_OWN RzList* rz_bin_dex_sections | ( | RZ_NONNULL RzBinDex * | dex | ) |
Returns a RzList<RzBinSection*> containing the dex sections.
Definition at line 1200 of file dex.c.
References NULL, rz_bin_section_free(), RZ_DEX_RELOC_TARGETS, RZ_DEX_VIRT_ADDRESS, rz_list_append(), rz_list_newf(), RZ_PERM_R, RZ_PERM_RWX, rz_return_val_if_fail, section_new(), and sections().
Referenced by sections().
RZ_API void rz_bin_dex_sha1 | ( | RZ_NONNULL RzBinDex * | dex, |
RZ_NONNULL RzBinHash * | hash | ||
) |
Sets the RzBinHash dex digest (sha1)
Definition at line 2003 of file dex.c.
References memcpy(), and rz_return_if_fail.
Referenced by info().
RZ_API RZ_OWN RzList* rz_bin_dex_strings | ( | RZ_NONNULL RzBinDex * | dex | ) |
Returns a RzList<RzBinString*> containing the dex strings.
Definition at line 735 of file dex.c.
References dex_string_t::data, free(), rz_bin_string_t::length, NULL, rz_bin_string_t::ordinal, rz_bin_string_t::paddr, rz_bin_string_free(), RZ_DEX_VIRT_ADDRESS, rz_list_append(), rz_list_newf(), RZ_NEW0, rz_pvector_foreach, rz_return_val_if_fail, rz_str_ndup(), RZ_STRING_ENC_UTF8, dex_string_t::size, rz_bin_string_t::size, rz_bin_string_t::string, strings(), rz_bin_string_t::type, and rz_bin_string_t::vaddr.
Referenced by strings().
RZ_API RZ_OWN RzList* rz_bin_dex_symbols | ( | RZ_NONNULL RzBinDex * | dex | ) |
Returns a RzList<RzBinSymbol*> containing the dex symbols.
Definition at line 1267 of file dex.c.
References rz_bin_symbol_t::bind, dex_method_id_t::class_idx, rz_bin_symbol_t::classname, dex_method_id_t::code_offset, dex_method_id_t::code_size, dex_resolve_fields_in_class_as_symbols(), dex_resolve_library(), dex_resolve_methods_in_class(), dex_resolve_proto_id(), dex_resolve_string_id(), dex_resolve_type_id(), rz_bin_symbol_t::dname, field_id, free(), rz_bin_symbol_t::is_imported, rz_bin_symbol_t::libname, rz_bin_symbol_t::name, dex_method_id_t::name_idx, NULL, rz_bin_symbol_t::paddr, dex_method_id_t::proto_idx, RZ_BIN_BIND_WEAK_STR, rz_bin_symbol_free(), RZ_BIN_TYPE_FIELD_STR, RZ_BIN_TYPE_METH_STR, RZ_DEX_RELOC_ADDRESS, RZ_DEX_VIRT_ADDRESS, rz_list_append(), rz_list_free(), rz_list_join(), rz_list_newf(), RZ_NEW0, RZ_NEWS0, rz_pvector_foreach, rz_pvector_len(), rz_return_val_if_fail, rz_bin_symbol_t::size, symbols(), rz_bin_symbol_t::type, and rz_bin_symbol_t::vaddr.
Referenced by symbols().
RZ_API RZ_OWN char* rz_bin_dex_version | ( | RZ_NONNULL RzBinDex * | dex | ) |
Returns the dex version (string format)
Definition at line 2016 of file dex.c.
References NULL, rz_return_val_if_fail, and strdup().
Referenced by info(), and rz_cmd_dexs_handler().
|
static |
Definition at line 1184 of file dex.c.
References NULL, RZ_NEW0, section::size, and strdup().
Referenced by rz_bin_dex_sections().
|
static |
Definition at line 48 of file dex.c.
Referenced by rz_bin_dex_access_flags_readable().