Rizin
unix-like reverse engineering framework and cli tools
|
Go to the source code of this file.
Macros | |
#define | ACCESS_FLAG_MASK_SRC (ACCESS_FLAG_PUBLIC | ACCESS_FLAG_PRIVATE | ACCESS_FLAG_PROTECTED | ACCESS_FLAG_STATIC | ACCESS_FLAG_FINAL) |
#define | CLASS_ACCESS_FLAGS_SIZE 16 |
#define | is_version(bin, major, minor) ((bin)->major_version == (major) && (bin)->minor_version >= (minor)) |
Variables | |
static const AccessFlagsReadable | access_flags_list [CLASS_ACCESS_FLAGS_SIZE] |
#define ACCESS_FLAG_MASK_SRC (ACCESS_FLAG_PUBLIC | ACCESS_FLAG_PRIVATE | ACCESS_FLAG_PROTECTED | ACCESS_FLAG_STATIC | ACCESS_FLAG_FINAL) |
Definition at line 7 of file class_bin.c.
#define CLASS_ACCESS_FLAGS_SIZE 16 |
Definition at line 9 of file class_bin.c.
#define is_version | ( | bin, | |
major, | |||
minor | |||
) | ((bin)->major_version == (major) && (bin)->minor_version >= (minor)) |
|
static |
Definition at line 1042 of file class_bin.c.
References rz_str_newf(), and strdup().
Referenced by rz_bin_java_class_const_pool_as_symbols(), rz_bin_java_class_fields_as_symbols(), and rz_bin_java_class_methods_as_symbols().
Definition at line 507 of file class_bin.c.
References count.
Referenced by rz_bin_java_class_as_text(), rz_bin_java_class_const_pool_as_text(), rz_bin_java_class_fields_as_text(), rz_bin_java_class_interfaces_as_text(), and rz_bin_java_class_methods_as_text().
Definition at line 1710 of file class_bin.c.
References a, b, and rz_bin_section_t::name.
Referenced by rz_bin_java_class_as_sections().
Definition at line 1839 of file class_bin.c.
Referenced by rz_bin_java_class_as_libraries().
Definition at line 1421 of file class_bin.c.
References CONSTANT_POOL_FIELDREF, CONSTANT_POOL_INTERFACEMETHODREF, CONSTANT_POOL_METHODREF, RZ_BIN_TYPE_METH_STR, RZ_BIN_TYPE_UNKNOWN_STR, and java_constant_pool_t::tag.
Referenced by rz_bin_java_class_const_pool_as_imports(), and rz_bin_java_class_const_pool_as_symbols().
Definition at line 632 of file class_bin.c.
References CONSTANT_POOL_DYNAMIC, CONSTANT_POOL_FIELDREF, CONSTANT_POOL_INTERFACEMETHODREF, CONSTANT_POOL_INVOKEDYNAMIC, CONSTANT_POOL_METHODREF, CONSTANT_POOL_NAMEANDTYPE, and java_constant_pool_t::tag.
Referenced by rz_bin_java_class_const_pool_resolve_index().
Definition at line 91 of file class_bin.c.
References rz_buf_size(), rz_buf_tell(), and st64.
Referenced by java_class_parse().
Definition at line 29 of file class_bin.c.
References ACCESS_FLAG_ABSTRACT, ACCESS_FLAG_BRIDGE, ACCESS_FLAG_FINAL, ACCESS_FLAG_NATIVE, ACCESS_FLAG_PRIVATE, ACCESS_FLAG_PROTECTED, ACCESS_FLAG_PUBLIC, ACCESS_FLAG_STATIC, ACCESS_FLAG_STRICT, ACCESS_FLAG_SYNTHETIC, ACCESS_FLAG_VARARGS, flags, RZ_BIN_METH_ABSTRACT, RZ_BIN_METH_BRIDGE, 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_SYNTHETIC, RZ_BIN_METH_VARARGS, and ut64().
Referenced by rz_bin_java_class_fields_as_binfields(), rz_bin_java_class_fields_as_symbols(), and rz_bin_java_class_methods_as_symbols().
|
static |
Definition at line 67 of file class_bin.c.
References NULL.
Referenced by java_class_constant_pool_stringify_at(), rz_bin_java_class_as_libraries(), rz_bin_java_class_as_source_code(), rz_bin_java_class_const_pool_as_imports(), rz_bin_java_class_const_pool_as_symbols(), rz_bin_java_class_const_pool_resolve_index(), rz_bin_java_class_fields_as_binfields(), rz_bin_java_class_fields_as_symbols(), rz_bin_java_class_interfaces_as_json(), rz_bin_java_class_interfaces_as_text(), rz_bin_java_class_methods_as_symbols(), rz_bin_java_class_name(), and rz_bin_java_class_super().
|
static |
Definition at line 74 of file class_bin.c.
References java_class_constant_pool_at(), java_constant_pool_stringify(), and NULL.
Referenced by rz_bin_java_class_as_json(), rz_bin_java_class_as_libraries(), rz_bin_java_class_as_sections(), rz_bin_java_class_as_source_code(), rz_bin_java_class_as_text(), rz_bin_java_class_const_pool_as_imports(), rz_bin_java_class_const_pool_as_symbols(), rz_bin_java_class_entrypoints(), rz_bin_java_class_fields_as_binfields(), rz_bin_java_class_fields_as_json(), rz_bin_java_class_fields_as_text(), rz_bin_java_class_interfaces_as_json(), rz_bin_java_class_interfaces_as_text(), rz_bin_java_class_methods_as_json(), rz_bin_java_class_methods_as_symbols(), rz_bin_java_class_methods_as_text(), rz_bin_java_class_name(), rz_bin_java_class_resolve_symbol(), and rz_bin_java_class_super().
|
static |
|
static |
Definition at line 97 of file class_bin.c.
References buffer_size, i, is_eob(), java_attribute_free(), java_attribute_new(), java_attribute_resolve(), java_class_is_oak(), java_constant_null_new(), java_constant_pool_new(), java_constant_pool_requires_null(), java_field_new(), java_interface_new(), java_method_new(), PFMT64x, rz_bin_java_class_free(), rz_buf_read_be16, rz_buf_read_be32, rz_buf_size(), rz_buf_tell(), RZ_LOG_ERROR, RZ_NEWS0, rz_warn_if_reached, sanitize_size(), st64, and ut64().
Referenced by rz_bin_java_class_new().
|
static |
Definition at line 251 of file class_bin.c.
References free(), i, java_constant_pool_stringify(), rz_bin_java_class_version(), sdb_num_set(), sdb_set(), and snprintf.
Referenced by rz_bin_java_class_new().
|
static |
Definition at line 1686 of file class_bin.c.
References test_evm::end, free(), NULL, RZ_NEW0, rz_warn_if_reached, section::size, start, and strdup().
Referenced by rz_bin_java_class_as_sections().
RZ_API ut32 rz_bin_java_class_access_flags | ( | RZ_NONNULL RzBinJavaClass * | bin | ) |
Definition at line 477 of file class_bin.c.
References rz_return_val_if_fail.
Referenced by classes().
RZ_API RZ_OWN char* rz_bin_java_class_access_flags_readable | ( | RZ_NONNULL RzBinJavaClass * | bin, |
ut16 | mask | ||
) |
Returns the readable class access flags.
Definition at line 485 of file class_bin.c.
References access_flags_list, CLASS_ACCESS_FLAGS_SIZE, access_flags_readable_t::flag, i, mask, NULL, access_flags_readable_t::readable, rz_return_val_if_fail, rz_strbuf_appendf(), rz_strbuf_drain(), rz_strbuf_new(), and sb.
Referenced by classes(), rz_bin_java_class_as_json(), rz_bin_java_class_as_source_code(), and rz_bin_java_class_as_text().
RZ_API void rz_bin_java_class_as_json | ( | RZ_NONNULL RzBinJavaClass * | bin, |
RZ_NONNULL PJ * | j | ||
) |
Returns the class info as json.
Definition at line 521 of file class_bin.c.
References ACCESS_FLAG_MASK_ALL, java_attribute_t::attribute_length, java_attribute_t::attribute_name_index, free(), i, java_class_constant_pool_stringify_at(), NULL, java_attribute_t::offset, pj_end(), pj_k(), pj_ka(), pj_kn(), pj_ko(), pj_ks(), pj_o(), rz_bin_java_class_access_flags_readable(), rz_bin_java_class_const_pool_as_json(), rz_bin_java_class_fields_as_json(), rz_bin_java_class_interfaces_as_json(), rz_bin_java_class_methods_as_json(), rz_bin_java_class_name(), rz_bin_java_class_super(), rz_bin_java_class_version(), rz_return_if_fail, and autogen_x86imm::tmp.
Referenced by rz_cmd_javac_handler().
RZ_API RZ_OWN RzList* rz_bin_java_class_as_libraries | ( | RZ_NONNULL RzBinJavaClass * | bin | ) |
Returns a RzList<char*> containing the class libraries.
Definition at line 1846 of file class_bin.c.
References compare_strings(), CONSTANT_POOL_CLASS, free(), i, java_class_constant_pool_at(), java_class_constant_pool_stringify_at(), java_constant_pool_is_import(), java_constant_pool_resolve(), list(), NULL, rz_list_append(), rz_list_find(), rz_list_newf(), RZ_LOG_ERROR, rz_return_val_if_fail, java_constant_pool_t::tag, and autogen_x86imm::tmp.
Referenced by libs(), and rz_bin_java_class_as_source_code().
RZ_API RZ_OWN RzList* rz_bin_java_class_as_sections | ( | RZ_NONNULL RzBinJavaClass * | bin | ) |
Returns a RzList<RzBinSection*> containing the class sections.
Definition at line 1718 of file class_bin.c.
References java_attribute_t::attribute_length, ATTRIBUTE_TYPE_CODE, java_method_t::attributes, java_method_t::attributes_count, java_attribute_code_t::code_offset, compare_section_names(), free(), i, if(), java_attribute_t::info, java_class_constant_pool_stringify_at(), k, java_field_t::name_index, java_method_t::name_index, new_section(), NULL, java_field_t::offset, java_method_t::offset, rz_list_append(), rz_list_find(), rz_list_newf(), RZ_PERM_R, RZ_PERM_X, rz_return_val_if_fail, rz_warn_if_reached, section_free(), sections(), snprintf, autogen_x86imm::tmp, java_attribute_t::type, and ut64().
Referenced by sections().
RZ_API void rz_bin_java_class_as_source_code | ( | RZ_NONNULL RzBinJavaClass * | bin, |
RZ_NONNULL RzStrBuf * | sb | ||
) |
Returns the class info as text source code.
Definition at line 708 of file class_bin.c.
References ACCESS_FLAG_MASK_SRC, ACCESS_FLAG_SUPER, desc, java_field_t::descriptor_index, java_method_t::descriptor_index, free(), i, java_class_constant_pool_at(), java_class_constant_pool_stringify_at(), java_constant_pool_resolve(), java_field_access_flags_readable(), java_method_access_flags_readable(), k, list(), java_field_t::name_index, java_method_t::name_index, NULL, rz_bin_java_class_access_flags_readable(), rz_bin_java_class_as_libraries(), rz_bin_java_class_name(), rz_bin_java_class_super(), rz_demangler_java(), RZ_FREE, rz_list_free(), rz_list_length(), RZ_LOG_ERROR, rz_return_if_fail, rz_str_newf(), rz_str_replace_char(), rz_strbuf_append(), rz_strbuf_appendf(), sb, strdup(), and autogen_x86imm::tmp.
Referenced by rz_cmd_javas_handler().
RZ_API void rz_bin_java_class_as_text | ( | RZ_NONNULL RzBinJavaClass * | bin, |
RZ_NONNULL RzStrBuf * | sb | ||
) |
Returns the class info as text.
Definition at line 591 of file class_bin.c.
References ACCESS_FLAG_MASK_ALL, java_attribute_t::attribute_length, java_attribute_t::attribute_name_index, calculate_padding_ut16(), free(), i, java_class_constant_pool_stringify_at(), NULL, rz_bin_java_class_access_flags_readable(), rz_bin_java_class_const_pool_as_text(), rz_bin_java_class_fields_as_text(), rz_bin_java_class_interfaces_as_text(), rz_bin_java_class_methods_as_text(), rz_bin_java_class_name(), rz_bin_java_class_super(), rz_bin_java_class_version(), rz_return_if_fail, rz_strbuf_appendf(), sb, snprintf, and autogen_x86imm::tmp.
Referenced by rz_cmd_javac_handler().
RZ_API RZ_OWN RzList* rz_bin_java_class_const_pool_as_imports | ( | RZ_NONNULL RzBinJavaClass * | bin | ) |
Returns a RzList<RzBinImport*> containing the class const pool.
Definition at line 1509 of file class_bin.c.
References free(), i, import_type(), imports(), java_class_constant_pool_at(), java_class_constant_pool_stringify_at(), java_constant_pool_is_import(), java_constant_pool_resolve(), NULL, RZ_BIN_BIND_GLOBAL_STR, RZ_BIN_BIND_WEAK_STR, rz_bin_import_free(), RZ_BIN_TYPE_FUNC_STR, RZ_BIN_TYPE_IFACE_STR, rz_list_append(), rz_list_newf(), RZ_LOG_ERROR, RZ_NEW0, rz_return_val_if_fail, rz_str_rchr(), rz_str_replace_ch(), rz_warn_if_reached, and strdup().
Referenced by imports().
RZ_API void rz_bin_java_class_const_pool_as_json | ( | RZ_NONNULL RzBinJavaClass * | bin, |
RZ_NONNULL PJ * | j | ||
) |
Returns the class const pool in json format via PJ arg.
Definition at line 1650 of file class_bin.c.
References free(), i, java_constant_pool_is_number(), java_constant_pool_is_string(), java_constant_pool_stringify(), java_constant_pool_tag_name(), NULL, pj_a(), pj_end(), pj_kn(), pj_ks(), pj_o(), rz_bin_java_class_const_pool_resolve_index(), RZ_LOG_ERROR, rz_return_if_fail, java_constant_pool_t::tag, test-lz4-versions::tag, and create_tags_rz::text.
Referenced by rz_bin_java_class_as_json(), and rz_cmd_javap_handler().
RZ_API RZ_OWN RzList* rz_bin_java_class_const_pool_as_symbols | ( | RZ_NONNULL RzBinJavaClass * | bin | ) |
Returns a RzList<RzBinSymbol*> containing the class const pool.
Definition at line 1435 of file class_bin.c.
References add_class_name_to_name(), rz_bin_symbol_t::bind, rz_bin_symbol_t::classname, desc, rz_bin_symbol_t::dname, free(), i, import_type(), rz_bin_symbol_t::is_imported, java_class_constant_pool_at(), java_class_constant_pool_stringify_at(), java_constant_pool_is_import(), java_constant_pool_resolve(), rz_bin_symbol_t::libname, list(), rz_bin_symbol_t::name, NULL, java_constant_pool_t::offset, rz_bin_symbol_t::ordinal, RZ_BIN_BIND_IMPORT_STR, rz_bin_symbol_free(), rz_bin_symbol_new(), RZ_BIN_TYPE_FUNC_STR, rz_list_append(), rz_list_newf(), RZ_LOG_ERROR, rz_return_val_if_fail, rz_str_newf(), rz_str_replace_ch(), rz_warn_if_reached, strdup(), and rz_bin_symbol_t::type.
Referenced by symbols().
RZ_API void rz_bin_java_class_const_pool_as_text | ( | RZ_NONNULL RzBinJavaClass * | bin, |
RZ_NONNULL RzStrBuf * | sb | ||
) |
Returns the class const pool in text format via RzStrBuf arg.
Definition at line 1605 of file class_bin.c.
References calculate_padding_ut16(), free(), i, java_constant_pool_is_number(), java_constant_pool_is_string(), java_constant_pool_stringify(), java_constant_pool_tag_name(), NULL, rz_bin_java_class_const_pool_resolve_index(), rz_demangler_java(), RZ_LOG_ERROR, rz_return_if_fail, rz_strbuf_appendf(), sb, snprintf, test-lz4-versions::tag, and create_tags_rz::text.
Referenced by rz_bin_java_class_as_text(), and rz_cmd_javap_handler().
RZ_API RZ_OWN char* rz_bin_java_class_const_pool_resolve_index | ( | RZ_NONNULL RzBinJavaClass * | bin, |
st32 | index | ||
) |
Returns the string linked to the class const pool index.
Definition at line 644 of file class_bin.c.
References CONSTANT_POOL_CLASS, CONSTANT_POOL_STRING, free(), is_dual_index(), java_class_constant_pool_at(), java_constant_pool_is_number(), java_constant_pool_is_string(), java_constant_pool_resolve(), java_constant_pool_stringify(), NULL, RZ_LOG_ERROR, rz_return_val_if_fail, rz_str_newf(), s0, s1, java_constant_pool_t::tag, and autogen_x86imm::tmp.
Referenced by enrich_asm(), rz_bin_java_class_const_pool_as_json(), rz_bin_java_class_const_pool_as_text(), and rz_cmd_javar_handler().
RZ_API ut64 rz_bin_java_class_debug_info | ( | RZ_NONNULL RzBinJavaClass * | bin | ) |
Definition at line 351 of file class_bin.c.
References ATTRIBUTE_TYPE_CODE, ATTRIBUTE_TYPE_LINENUMBERTABLE, java_attribute_code_t::attributes, java_method_t::attributes, java_attribute_code_t::attributes_count, java_method_t::attributes_count, i, java_attribute_t::info, k, RZ_BIN_DBG_LINENUMS, RZ_BIN_DBG_SYMS, and java_attribute_t::type.
Referenced by info().
RZ_API RZ_OWN RzList* rz_bin_java_class_entrypoints | ( | RZ_NONNULL RzBinJavaClass * | bin | ) |
Returns a RzList<RzBinAddr*> containing the entrypoints.
Definition at line 927 of file class_bin.c.
References java_method_t::access_flags, addr, ATTRIBUTE_TYPE_CODE, java_method_t::attributes, java_method_t::attributes_count, java_attribute_code_t::code_offset, free(), i, java_attribute_t::info, java_class_constant_pool_stringify_at(), list(), METHOD_ACCESS_FLAG_STATIC, java_method_t::name_index, NULL, rz_bin_addr_t::paddr, rz_list_append(), rz_list_newf(), RZ_LOG_ERROR, RZ_NEW0, rz_return_val_if_fail, rz_warn_if_reached, java_attribute_t::type, ut64(), UT64_MAX, and rz_bin_addr_t::vaddr.
Referenced by entrypoints().
RZ_API RZ_OWN RzList* rz_bin_java_class_fields_as_binfields | ( | RZ_NONNULL RzBinJavaClass * | bin | ) |
Returns a RzList<RzBinField*> containing the class fields.
Definition at line 1277 of file class_bin.c.
References java_field_t::access_flags, java_field_t::descriptor_index, rz_bin_field_t::flags, free(), i, java_access_flags_to_bin_flags(), java_class_constant_pool_at(), java_class_constant_pool_stringify_at(), java_constant_pool_is_string(), java_constant_pool_stringify(), list(), java_field_t::name_index, NULL, java_field_t::offset, rz_bin_field_free(), rz_bin_field_new(), rz_list_append(), rz_list_newf(), RZ_LOG_ERROR, rz_return_val_if_fail, rz_warn_if_reached, rz_bin_field_t::type, and rz_bin_field_t::visibility.
RZ_API void rz_bin_java_class_fields_as_json | ( | RZ_NONNULL RzBinJavaClass * | bin, |
RZ_NONNULL PJ * | j | ||
) |
Returns the fields in json format via PJ arg.
Definition at line 1366 of file class_bin.c.
References java_field_t::access_flags, java_attribute_t::attribute_length, java_attribute_t::attribute_name_index, java_field_t::attributes, java_field_t::attributes_count, java_field_t::descriptor_index, free(), i, java_class_constant_pool_stringify_at(), java_field_access_flags_readable(), java_field_t::name_index, java_attribute_t::offset, java_field_t::offset, pj_a(), pj_end(), pj_ka(), pj_kn(), pj_ks(), pj_o(), rz_return_if_fail, rz_warn_if_reached, and autogen_x86imm::tmp.
Referenced by rz_bin_java_class_as_json(), and rz_cmd_javaf_handler().
RZ_API RZ_OWN RzList* rz_bin_java_class_fields_as_symbols | ( | RZ_NONNULL RzBinJavaClass * | bin | ) |
Returns a RzList<RzBinSymbol*> containing the class fields.
Definition at line 1227 of file class_bin.c.
References java_field_t::access_flags, add_class_name_to_name(), rz_bin_symbol_t::bind, rz_bin_symbol_t::classname, field_name, free(), i, java_access_flags_to_bin_flags(), java_class_constant_pool_at(), java_constant_pool_is_string(), java_constant_pool_stringify(), java_field_access_flags_readable(), java_field_is_global(), list(), rz_bin_symbol_t::method_flags, rz_bin_symbol_t::name, java_field_t::name_index, NULL, java_field_t::offset, rz_bin_symbol_t::ordinal, RZ_BIN_BIND_GLOBAL_STR, RZ_BIN_BIND_LOCAL_STR, rz_bin_java_class_name(), rz_bin_symbol_free(), rz_bin_symbol_new(), RZ_BIN_TYPE_OBJECT_STR, rz_list_append(), rz_list_newf(), RZ_LOG_ERROR, rz_return_val_if_fail, rz_warn_if_reached, rz_bin_symbol_t::size, rz_bin_symbol_t::type, rz_bin_symbol_t::visibility, and rz_bin_symbol_t::visibility_str.
Referenced by symbols().
RZ_API void rz_bin_java_class_fields_as_text | ( | RZ_NONNULL RzBinJavaClass * | bin, |
RZ_NONNULL RzStrBuf * | sb | ||
) |
Returns the fields in text format via RzStrBuf arg.
Definition at line 1318 of file class_bin.c.
References java_field_t::access_flags, java_attribute_t::attribute_length, java_attribute_t::attribute_name_index, java_field_t::attributes, java_field_t::attributes_count, calculate_padding_ut16(), java_field_t::descriptor_index, flags, free(), i, java_class_constant_pool_stringify_at(), java_field_access_flags_readable(), name, java_field_t::name_index, rz_return_if_fail, rz_strbuf_appendf(), rz_warn_if_reached, sb, and snprintf.
Referenced by rz_bin_java_class_as_text(), and rz_cmd_javaf_handler().
RZ_API void rz_bin_java_class_free | ( | RZ_NULLABLE RzBinJavaClass * | bin | ) |
Frees a RzBinJavaClass pointer.
Definition at line 407 of file class_bin.c.
References free(), i, java_attribute_free(), java_constant_pool_free(), java_field_free(), java_interface_free, and java_method_free().
Referenced by destroy(), and java_class_parse().
RZ_API void rz_bin_java_class_interfaces_as_json | ( | RZ_NONNULL RzBinJavaClass * | bin, |
RZ_NONNULL PJ * | j | ||
) |
Returns the class interfaces as json via PJ arg.
Definition at line 1928 of file class_bin.c.
References free(), i, java_class_constant_pool_at(), java_class_constant_pool_stringify_at(), java_constant_pool_resolve(), NULL, pj_a(), pj_end(), pj_kn(), pj_ks(), pj_o(), RZ_LOG_ERROR, rz_return_if_fail, rz_str_replace_char(), and autogen_x86imm::tmp.
Referenced by rz_bin_java_class_as_json(), and rz_cmd_javai_handler().
RZ_API void rz_bin_java_class_interfaces_as_text | ( | RZ_NONNULL RzBinJavaClass * | bin, |
RZ_NONNULL RzStrBuf * | sb | ||
) |
Returns the class interfaces as text via RzStrBuf arg.
Definition at line 1898 of file class_bin.c.
References calculate_padding_ut16(), free(), i, java_class_constant_pool_at(), java_class_constant_pool_stringify_at(), java_constant_pool_resolve(), NULL, RZ_LOG_ERROR, rz_return_if_fail, rz_str_replace_char(), rz_strbuf_appendf(), sb, snprintf, and autogen_x86imm::tmp.
Referenced by rz_bin_java_class_as_text(), and rz_cmd_javai_handler().
RZ_API RZ_BORROW const char* rz_bin_java_class_language | ( | RZ_NONNULL RzBinJavaClass * | bin | ) |
Definition at line 378 of file class_bin.c.
References free(), i, java_constant_pool_is_string(), java_constant_pool_stringify(), NULL, and rz_return_val_if_fail.
Referenced by info().
RZ_API void rz_bin_java_class_methods_as_json | ( | RZ_NONNULL RzBinJavaClass * | bin, |
RZ_NONNULL PJ * | j | ||
) |
Returns the methods in json format via PJ arg.
Definition at line 1169 of file class_bin.c.
References java_method_t::access_flags, java_attribute_t::attribute_length, java_attribute_t::attribute_name_index, java_method_t::attributes, java_method_t::attributes_count, java_method_t::descriptor_index, free(), i, java_class_constant_pool_stringify_at(), java_method_access_flags_readable(), java_method_t::name_index, java_attribute_t::offset, java_method_t::offset, pj_a(), pj_end(), pj_ka(), pj_kn(), pj_ks(), pj_o(), rz_return_if_fail, rz_warn_if_reached, and autogen_x86imm::tmp.
Referenced by rz_bin_java_class_as_json(), and rz_cmd_javam_handler().
RZ_API RZ_OWN RzList* rz_bin_java_class_methods_as_symbols | ( | RZ_NONNULL RzBinJavaClass * | bin | ) |
Returns a RzList<RzBinSymbol*> containing the class methods.
Definition at line 1052 of file class_bin.c.
References java_method_t::access_flags, add_class_name_to_name(), addr, java_attribute_t::attribute_length, ATTRIBUTE_TYPE_CODE, java_method_t::attributes, java_method_t::attributes_count, rz_bin_symbol_t::bind, rz_bin_symbol_t::classname, java_attribute_code_t::code_offset, desc, java_method_t::descriptor_index, rz_bin_symbol_t::dname, free(), i, java_attribute_t::info, java_access_flags_to_bin_flags(), java_class_constant_pool_at(), java_class_constant_pool_stringify_at(), java_constant_pool_is_string(), java_constant_pool_stringify(), java_method_access_flags_readable(), java_method_is_global(), rz_bin_symbol_t::libname, list(), rz_bin_symbol_t::method_flags, rz_bin_symbol_t::name, java_method_t::name_index, NULL, rz_bin_symbol_t::ordinal, RZ_BIN_BIND_GLOBAL_STR, RZ_BIN_BIND_LOCAL_STR, rz_bin_java_class_name(), rz_bin_symbol_free(), rz_bin_symbol_new(), RZ_BIN_TYPE_FUNC_STR, rz_demangler_java(), rz_list_append(), rz_list_length(), rz_list_newf(), RZ_LOG_ERROR, rz_return_val_if_fail, rz_str_newf(), rz_warn_if_reached, rz_bin_symbol_t::size, strdup(), java_attribute_t::type, rz_bin_symbol_t::type, ut64(), UT64_MAX, rz_bin_symbol_t::visibility, and rz_bin_symbol_t::visibility_str.
RZ_API void rz_bin_java_class_methods_as_text | ( | RZ_NONNULL RzBinJavaClass * | bin, |
RZ_NONNULL RzStrBuf * | sb | ||
) |
Returns the methods in text format via RzStrBuf arg.
Definition at line 1121 of file class_bin.c.
References java_method_t::access_flags, java_attribute_t::attribute_length, java_attribute_t::attribute_name_index, java_method_t::attributes, java_method_t::attributes_count, calculate_padding_ut16(), java_method_t::descriptor_index, flags, free(), i, java_class_constant_pool_stringify_at(), java_method_access_flags_readable(), name, java_method_t::name_index, rz_return_if_fail, rz_strbuf_appendf(), rz_warn_if_reached, sb, and snprintf.
Referenced by rz_bin_java_class_as_text(), and rz_cmd_javam_handler().
RZ_API RZ_OWN char* rz_bin_java_class_name | ( | RZ_NONNULL RzBinJavaClass * | bin | ) |
Returns the class name.
Definition at line 447 of file class_bin.c.
References free(), java_class_constant_pool_at(), java_class_constant_pool_stringify_at(), java_constant_pool_resolve(), NULL, RZ_LOG_ERROR, rz_return_val_if_fail, rz_str_newf(), strdup(), and autogen_x86imm::tmp.
Referenced by classes(), rz_bin_java_class_as_json(), rz_bin_java_class_as_source_code(), rz_bin_java_class_as_text(), rz_bin_java_class_fields_as_symbols(), and rz_bin_java_class_methods_as_symbols().
RZ_API RZ_OWN RzBinJavaClass* rz_bin_java_class_new | ( | RZ_NONNULL RzBuffer * | buf, |
ut64 | offset, | ||
RZ_NONNULL Sdb * | kv | ||
) |
Parses the java class file and returns a RzBinJavaClass struct.
Definition at line 289 of file class_bin.c.
References java_class_parse(), java_set_sdb(), NULL, RZ_NEW0, rz_return_val_if_fail, and ut64().
Referenced by load_buffer().
RZ_API RZ_OWN RzBinAddr* rz_bin_java_class_resolve_symbol | ( | RZ_NONNULL RzBinJavaClass * | bin, |
RzBinSpecialSymbol | resolve | ||
) |
Resolves and returns the RzBinAddr struct linked to the input RzBinSpecialSymbol.
Definition at line 870 of file class_bin.c.
References addr, ATTRIBUTE_TYPE_CODE, java_method_t::attributes, java_method_t::attributes_count, java_attribute_code_t::code_offset, free(), i, java_attribute_t::info, java_class_constant_pool_stringify_at(), java_method_t::name_index, NULL, rz_bin_addr_t::paddr, resolve(), RZ_BIN_SPECIAL_SYMBOL_ENTRY, RZ_BIN_SPECIAL_SYMBOL_INIT, RZ_BIN_SPECIAL_SYMBOL_MAIN, RZ_LOG_ERROR, RZ_NEW0, rz_return_val_if_fail, java_attribute_t::type, ut64(), and UT64_MAX.
Referenced by binsym().
RZ_API RZ_OWN RzList* rz_bin_java_class_strings | ( | RZ_NONNULL RzBinJavaClass * | bin | ) |
Returns a RzList<RzBinString*> containing the strings.
Definition at line 986 of file class_bin.c.
References java_attribute_t::attribute_length, ATTRIBUTE_TYPE_SOURCEDEBUGEXTENSION, free(), i, java_attribute_t::info, java_constant_pool_is_string(), java_constant_pool_stringify(), rz_bin_string_t::length, list(), NULL, java_attribute_t::offset, java_constant_pool_t::offset, rz_bin_string_t::ordinal, rz_bin_string_t::paddr, rz_bin_string_free(), rz_list_append(), rz_list_newf(), RZ_LOG_ERROR, RZ_NEW0, rz_return_val_if_fail, RZ_STRING_ENC_MUTF8, RZ_STRING_ENC_UTF8, rz_warn_if_reached, java_constant_pool_t::size, rz_bin_string_t::size, strdup(), rz_bin_string_t::string, java_attribute_t::type, and rz_bin_string_t::type.
Referenced by strings().
RZ_API RZ_OWN char* rz_bin_java_class_super | ( | RZ_NONNULL RzBinJavaClass * | bin | ) |
Returns the class super name.
Definition at line 466 of file class_bin.c.
References java_class_constant_pool_at(), java_class_constant_pool_stringify_at(), java_constant_pool_resolve(), NULL, RZ_LOG_ERROR, rz_return_val_if_fail, and strdup().
Referenced by classes(), rz_bin_java_class_as_json(), rz_bin_java_class_as_source_code(), and rz_bin_java_class_as_text().
RZ_API RZ_OWN char* rz_bin_java_class_version | ( | RZ_NONNULL RzBinJavaClass * | bin | ) |
Parses the java class file and returns a RzBinJavaClass struct.
Definition at line 306 of file class_bin.c.
References is_version, NULL, and strdup().
Referenced by info(), java_set_sdb(), rz_bin_java_class_as_json(), and rz_bin_java_class_as_text().
Definition at line 82 of file class_bin.c.
References buffer_size, count, and ut64().
Referenced by java_class_parse().
|
static |
Definition at line 1706 of file class_bin.c.
References rz_bin_section_free().
Referenced by rz_bin_java_class_as_sections().
|
static |
Definition at line 10 of file class_bin.c.
Referenced by rz_bin_java_class_access_flags_readable().