Rizin
unix-like reverse engineering framework and cli tools
|
#include <rz_analysis.h>
#include <rz_core.h>
#include <rz_flag.h>
#include <rz_cons.h>
#include <rz_cmd.h>
Go to the source code of this file.
Classes | |
struct | class_type_info_t |
struct | base_class_type_info_t |
struct | si_class_type_info_t |
struct | vmi_class_type_info_t |
Macros | |
#define | VMI_CLASS_TYPE_INFO_NAME "__vmi_class_type_info" |
#define | SI_CLASS_TYPE_INFO_NAME "__si_class_type_info" |
#define | CLASS_TYPE_INFO_NAME "__class_type_info" |
#define | NAME_BUF_SIZE 256 |
#define | VT_WORD_SIZE(ctx) (ctx->word_size) |
Typedefs | |
typedef struct class_type_info_t | class_type_info |
typedef struct base_class_type_info_t | base_class_type_info |
typedef struct si_class_type_info_t | si_class_type_info |
typedef struct vmi_class_type_info_t | vmi_class_type_info |
Enumerations | |
enum | RTypeInfoType { RZ_TYPEINFO_TYPE_UNKNOWN , RZ_TYPEINFO_TYPE_CLASS , RZ_TYPEINFO_TYPE_SI_CLASS , RZ_TYPEINFO_TYPE_VMI_CLASS } |
#define CLASS_TYPE_INFO_NAME "__class_type_info" |
Definition at line 13 of file rtti_itanium.c.
#define NAME_BUF_SIZE 256 |
Definition at line 14 of file rtti_itanium.c.
#define SI_CLASS_TYPE_INFO_NAME "__si_class_type_info" |
Definition at line 12 of file rtti_itanium.c.
#define VMI_CLASS_TYPE_INFO_NAME "__vmi_class_type_info" |
Definition at line 11 of file rtti_itanium.c.
Definition at line 16 of file rtti_itanium.c.
typedef struct base_class_type_info_t base_class_type_info |
typedef struct class_type_info_t class_type_info |
typedef struct si_class_type_info_t si_class_type_info |
typedef struct vmi_class_type_info_t vmi_class_type_info |
enum RTypeInfoType |
Enumerator | |
---|---|
RZ_TYPEINFO_TYPE_UNKNOWN | |
RZ_TYPEINFO_TYPE_CLASS | |
RZ_TYPEINFO_TYPE_SI_CLASS | |
RZ_TYPEINFO_TYPE_VMI_CLASS |
Definition at line 19 of file rtti_itanium.c.
|
static |
Add any base class information about the type into analysis/classes.
context | |
cti |
Definition at line 805 of file rtti_itanium.c.
References base_class_type_info_t::base_class_addr, si_class_type_info_t::base_class_addr, i, class_type_info_t::name, rtti_itanium_read_type_name(), rz_analysis_class_base_fini(), rz_analysis_class_base_set(), RZ_TYPEINFO_TYPE_SI_CLASS, RZ_TYPEINFO_TYPE_VMI_CLASS, class_type_info_t::type, ut64(), vmi_class_type_info_t::vmi_base_count, vmi_class_type_info_t::vmi_bases, and VT_WORD_SIZE.
Referenced by rz_analysis_rtti_itanium_recover_all().
|
static |
Definition at line 474 of file rtti_itanium.c.
References rz_str_endswith().
Referenced by raw_rtti_parse().
|
static |
Definition at line 486 of file rtti_itanium.c.
References class_type_info_t::class_vtable_addr, name, class_type_info_t::name, class_type_info_t::name_addr, class_type_info_t::name_unique, NULL, RZ_NEW0, RZ_TYPEINFO_TYPE_CLASS, class_type_info_t::type, class_type_info_t::typeinfo_addr, and class_type_info_t::vtable_addr.
Referenced by raw_rtti_parse().
|
static |
Definition at line 502 of file rtti_itanium.c.
References si_class_type_info_t::base_class_addr, si_class_type_info_t::class_vtable_addr, name, si_class_type_info_t::name, si_class_type_info_t::name_addr, si_class_type_info_t::name_unique, NULL, RZ_NEW0, RZ_TYPEINFO_TYPE_SI_CLASS, si_class_type_info_t::type, si_class_type_info_t::typeinfo_addr, and si_class_type_info_t::vtable_addr.
Referenced by raw_rtti_parse().
|
static |
Definition at line 518 of file rtti_itanium.c.
References vmi_class_type_info_t::class_vtable_addr, flags, name, vmi_class_type_info_t::name, vmi_class_type_info_t::name_addr, vmi_class_type_info_t::name_unique, NULL, RZ_NEW0, RZ_TYPEINFO_TYPE_VMI_CLASS, vmi_class_type_info_t::type, vmi_class_type_info_t::typeinfo_addr, vmi_class_type_info_t::vmi_base_count, vmi_class_type_info_t::vmi_bases, vmi_class_type_info_t::vmi_flags, and vmi_class_type_info_t::vtable_addr.
Referenced by raw_rtti_parse().
|
static |
Definition at line 839 of file rtti_itanium.c.
References class_type_info_t::name, rz_analysis_class_method_get_all(), rz_analysis_class_method_set(), rz_str_cmp(), rz_str_startswith(), rz_vector_foreach, and rz_vector_free().
Referenced by rz_analysis_rtti_itanium_recover_all().
|
static |
Try to parse as much valid looking RTTI as you can.
context | |
vtable_addr | |
rtti_addr |
Definition at line 544 of file rtti_itanium.c.
References addr, base_class_type_info_t::base_class_addr, calloc(), can_section_contain_rtti_vpointer(), create_class_type(), create_si_class_type(), create_vmi_class_type(), base_class_type_info_t::flags, free(), i, NULL, rtti_itanium_read_type_name_custom(), ut64(), and VT_WORD_SIZE.
Referenced by rtti_itanium_type_info_new().
|
static |
Definition at line 761 of file rtti_itanium.c.
References rz_analysis_function_t::name, NULL, PFMT64d, rz_analysis_class_method_exists_by_addr(), rz_analysis_class_method_fini(), rz_analysis_class_method_get_by_addr(), rz_analysis_class_method_set(), rz_analysis_class_vtable_fini(), rz_analysis_class_vtable_set(), rz_analysis_get_function_at(), rz_analysis_vtable_info_get_size(), rz_str_new(), rz_str_newf(), rz_vector_foreach, and ut64().
Referenced by rz_analysis_rtti_itanium_recover_all().
|
static |
Definition at line 116 of file rtti_itanium.c.
References free(), and class_type_info_t::name.
Referenced by rtti_itanium_class_type_info_free().
|
static |
Definition at line 122 of file rtti_itanium.c.
References free(), NULL, and rtti_itanium_class_type_info_fini().
Referenced by rtti_itanium_class_type_info_new(), rtti_itanium_type_info_free(), and rz_analysis_rtti_itanium_print_at_vtable().
|
static |
Definition at line 131 of file rtti_itanium.c.
References addr, rtti_itanium_read_type_name(), RZ_TYPEINFO_TYPE_CLASS, class_type_info_t::type, ut64(), UT64_MAX, VT_WORD_SIZE, and class_type_info_t::vtable_addr.
Referenced by rtti_itanium_class_type_info_new().
|
static |
Definition at line 144 of file rtti_itanium.c.
References addr, class_type_info_t::class_vtable_addr, NULL, rtti_itanium_class_type_info_free(), rtti_itanium_class_type_info_init(), RZ_NEW0, and class_type_info_t::typeinfo_addr.
Referenced by rtti_itanium_type_info_new().
|
static |
Definition at line 309 of file rtti_itanium.c.
References class_type_info_t::class_vtable_addr, class_type_info_t::name, class_type_info_t::name_addr, class_type_info_t::name_unique, PFMT64x, prefix, rz_cons_printf(), class_type_info_t::type, type_to_string(), class_type_info_t::typeinfo_addr, and class_type_info_t::vtable_addr.
Referenced by rz_analysis_rtti_itanium_print_at_vtable().
|
static |
Definition at line 326 of file rtti_itanium.c.
References class_type_info_t::class_vtable_addr, class_type_info_t::name, class_type_info_t::name_addr, class_type_info_t::name_unique, pj_end(), pj_free(), pj_kb(), pj_kn(), pj_ks(), pj_new(), pj_o(), pj_string(), class_type_info_t::type, type_to_string(), class_type_info_t::typeinfo_addr, and class_type_info_t::vtable_addr.
Referenced by rz_analysis_rtti_itanium_print_at_vtable().
|
static |
Definition at line 408 of file rtti_itanium.c.
References si_class_type_info_t::base_class_addr, si_class_type_info_t::class_vtable_addr, si_class_type_info_t::name, si_class_type_info_t::name_addr, si_class_type_info_t::name_unique, PFMT64x, prefix, rz_cons_printf(), si_class_type_info_t::type, type_to_string(), si_class_type_info_t::typeinfo_addr, and si_class_type_info_t::vtable_addr.
Referenced by rz_analysis_rtti_itanium_print_at_vtable().
|
static |
Definition at line 427 of file rtti_itanium.c.
References si_class_type_info_t::base_class_addr, si_class_type_info_t::class_vtable_addr, si_class_type_info_t::name, si_class_type_info_t::name_addr, si_class_type_info_t::name_unique, pj_end(), pj_free(), pj_kb(), pj_kn(), pj_ks(), pj_new(), pj_o(), pj_string(), si_class_type_info_t::type, type_to_string(), si_class_type_info_t::typeinfo_addr, and si_class_type_info_t::vtable_addr.
Referenced by rz_analysis_rtti_itanium_print_at_vtable().
|
static |
Definition at line 346 of file rtti_itanium.c.
References base_class_type_info_t::base_class_addr, vmi_class_type_info_t::class_vtable_addr, base_class_type_info_t::flags, i, vmi_class_type_info_t::name, vmi_class_type_info_t::name_addr, vmi_class_type_info_t::name_unique, PFMT64x, prefix, rz_cons_printf(), vmi_class_type_info_t::type, type_to_string(), vmi_class_type_info_t::typeinfo_addr, vmi_class_type_info_t::vmi_base_count, vmi_class_type_info_t::vmi_bases, vmi_class_type_info_t::vmi_flags, and vmi_class_type_info_t::vtable_addr.
Referenced by rz_analysis_rtti_itanium_print_at_vtable().
|
static |
Definition at line 377 of file rtti_itanium.c.
References base_class_type_info_t::base_class_addr, vmi_class_type_info_t::class_vtable_addr, base_class_type_info_t::flags, i, vmi_class_type_info_t::name, vmi_class_type_info_t::name_addr, vmi_class_type_info_t::name_unique, pj_a(), pj_end(), pj_free(), pj_k(), pj_kb(), pj_kN(), pj_kn(), pj_ks(), pj_new(), pj_o(), pj_string(), vmi_class_type_info_t::type, type_to_string(), vmi_class_type_info_t::typeinfo_addr, vmi_class_type_info_t::vmi_base_count, vmi_class_type_info_t::vmi_bases, vmi_class_type_info_t::vmi_flags, and vmi_class_type_info_t::vtable_addr.
Referenced by rz_analysis_rtti_itanium_print_at_vtable().
|
static |
Definition at line 75 of file rtti_itanium.c.
References addr, class_type_info_t::name, class_type_info_t::name_addr, NAME_BUF_SIZE, class_type_info_t::name_unique, rz_analysis_rtti_itanium_demangle_class_name(), ut64(), and VT_WORD_SIZE.
Referenced by add_class_bases(), rtti_itanium_class_type_info_init(), rtti_itanium_si_class_type_info_init(), and rtti_itanium_vmi_class_type_info_init().
|
static |
Definition at line 97 of file rtti_itanium.c.
References addr, name, NAME_BUF_SIZE, NULL, rz_analysis_rtti_itanium_demangle_class_name(), ut64(), and VT_WORD_SIZE.
Referenced by raw_rtti_parse().
|
static |
Definition at line 245 of file rtti_itanium.c.
References free(), and si_class_type_info_t::name.
Referenced by rtti_itanium_si_class_type_info_free().
|
static |
Definition at line 251 of file rtti_itanium.c.
References free(), NULL, and rtti_itanium_si_class_type_info_fini().
Referenced by rtti_itanium_si_class_type_info_new(), rtti_itanium_type_info_free(), and rz_analysis_rtti_itanium_print_at_vtable().
|
static |
Definition at line 260 of file rtti_itanium.c.
References addr, si_class_type_info_t::base_class_addr, rtti_itanium_read_type_name(), RZ_TYPEINFO_TYPE_SI_CLASS, si_class_type_info_t::type, ut64(), UT64_MAX, VT_WORD_SIZE, and si_class_type_info_t::vtable_addr.
Referenced by rtti_itanium_si_class_type_info_new().
|
static |
Definition at line 280 of file rtti_itanium.c.
References addr, si_class_type_info_t::class_vtable_addr, NULL, rtti_itanium_si_class_type_info_free(), rtti_itanium_si_class_type_info_init(), RZ_NEW0, and si_class_type_info_t::typeinfo_addr.
Referenced by rtti_itanium_type_info_new().
|
static |
Definition at line 679 of file rtti_itanium.c.
References info(), rtti_itanium_class_type_info_free(), rtti_itanium_si_class_type_info_free(), rtti_itanium_vmi_class_type_info_free(), rz_return_if_reached, RZ_TYPEINFO_TYPE_CLASS, RZ_TYPEINFO_TYPE_SI_CLASS, RZ_TYPEINFO_TYPE_VMI_CLASS, and class_type_info_t::type.
Referenced by rz_analysis_rtti_itanium_recover_all().
|
static |
Definition at line 637 of file rtti_itanium.c.
References NULL, raw_rtti_parse(), rtti_itanium_class_type_info_new(), rtti_itanium_si_class_type_info_new(), rtti_itanium_type_info_type_from_flag(), rtti_itanium_vmi_class_type_info_new(), rz_return_val_if_reached, RZ_TYPEINFO_TYPE_CLASS, RZ_TYPEINFO_TYPE_SI_CLASS, RZ_TYPEINFO_TYPE_UNKNOWN, RZ_TYPEINFO_TYPE_VMI_CLASS, type, ut64(), and VT_WORD_SIZE.
Referenced by rz_analysis_rtti_itanium_print_at_vtable(), and rz_analysis_rtti_itanium_recover_all().
|
static |
Definition at line 448 of file rtti_itanium.c.
References CLASS_TYPE_INFO_NAME, rz_core_t::flags, flags, rz_flag_item_t::name, rz_return_val_if_fail, RZ_TYPEINFO_TYPE_CLASS, RZ_TYPEINFO_TYPE_SI_CLASS, RZ_TYPEINFO_TYPE_UNKNOWN, RZ_TYPEINFO_TYPE_VMI_CLASS, SI_CLASS_TYPE_INFO_NAME, and VMI_CLASS_TYPE_INFO_NAME.
Referenced by rtti_itanium_type_info_new().
|
static |
Definition at line 161 of file rtti_itanium.c.
References free(), vmi_class_type_info_t::name, and vmi_class_type_info_t::vmi_bases.
Referenced by rtti_itanium_vmi_class_type_info_free().
|
static |
Definition at line 168 of file rtti_itanium.c.
References free(), NULL, and rtti_itanium_vmi_class_type_info_fini().
Referenced by rtti_itanium_type_info_free(), rtti_itanium_vmi_class_type_info_new(), and rz_analysis_rtti_itanium_print_at_vtable().
|
static |
Definition at line 177 of file rtti_itanium.c.
References addr, base_class_type_info_t::base_class_addr, calloc(), base_class_type_info_t::flags, i, rtti_itanium_read_type_name(), RZ_LOG_ERROR, RZ_TYPEINFO_TYPE_VMI_CLASS, vmi_class_type_info_t::type, ut64(), UT64_MAX, vmi_class_type_info_t::vmi_base_count, vmi_class_type_info_t::vmi_bases, vmi_class_type_info_t::vmi_flags, VT_WORD_SIZE, and vmi_class_type_info_t::vtable_addr.
Referenced by rtti_itanium_vmi_class_type_info_new().
|
static |
Definition at line 228 of file rtti_itanium.c.
References addr, vmi_class_type_info_t::class_vtable_addr, NULL, rtti_itanium_vmi_class_type_info_free(), rtti_itanium_vmi_class_type_info_init(), RZ_NEW0, and vmi_class_type_info_t::typeinfo_addr.
Referenced by rtti_itanium_type_info_new().
RZ_API char* rz_analysis_rtti_itanium_demangle_class_name | ( | RVTableContext * | context, |
const char * | name | ||
) |
Definition at line 743 of file rtti_itanium.c.
References free(), NULL, and rz_str_newf().
Referenced by rtti_itanium_read_type_name(), rtti_itanium_read_type_name_custom(), and rz_analysis_rtti_demangle_class_name().
RZ_API bool rz_analysis_rtti_itanium_print_at_vtable | ( | RVTableContext * | context, |
ut64 | addr, | ||
RzOutputMode | mode | ||
) |
Definition at line 700 of file rtti_itanium.c.
References addr, rtti_itanium_class_type_info_free(), rtti_itanium_print_class_type_info(), rtti_itanium_print_class_type_info_json(), rtti_itanium_print_si_class_type_info(), rtti_itanium_print_si_class_type_info_json(), rtti_itanium_print_vmi_class_type_info(), rtti_itanium_print_vmi_class_type_info_json(), rtti_itanium_si_class_type_info_free(), rtti_itanium_type_info_new(), rtti_itanium_vmi_class_type_info_free(), RZ_OUTPUT_MODE_JSON, rz_return_val_if_reached, RZ_TYPEINFO_TYPE_CLASS, RZ_TYPEINFO_TYPE_SI_CLASS, RZ_TYPEINFO_TYPE_VMI_CLASS, and class_type_info_t::type.
Referenced by rz_analysis_rtti_print_all(), and rz_analysis_rtti_print_at_vtable().
Definition at line 860 of file rtti_itanium.c.
References add_class_bases(), detect_constructor_destructor(), rz_list_t::free, class_type_info_t::name, recovery_apply_vtable(), rtti_itanium_type_info_free(), rtti_itanium_type_info_new(), rz_analysis_class_create(), rz_list_append(), rz_list_free(), rz_list_new(), set_u_add(), set_u_contains(), set_u_free(), set_u_new(), and class_type_info_t::typeinfo_addr.
Referenced by rz_analysis_rtti_recover_all().
|
static |
Definition at line 297 of file rtti_itanium.c.
References CLASS_TYPE_INFO_NAME, rz_return_val_if_reached, RZ_TYPEINFO_TYPE_CLASS, RZ_TYPEINFO_TYPE_SI_CLASS, RZ_TYPEINFO_TYPE_VMI_CLASS, SI_CLASS_TYPE_INFO_NAME, type, and VMI_CLASS_TYPE_INFO_NAME.
Referenced by rtti_itanium_print_class_type_info(), rtti_itanium_print_class_type_info_json(), rtti_itanium_print_si_class_type_info(), rtti_itanium_print_si_class_type_info_json(), rtti_itanium_print_vmi_class_type_info(), and rtti_itanium_print_vmi_class_type_info_json().