Rizin
unix-like reverse engineering framework and cli tools
|
#include "rz_analysis.h"
Go to the source code of this file.
Classes | |
struct | rtti_complete_object_locator_t |
struct | rtti_class_hierarchy_descriptor_t |
struct | rtti_base_class_descriptor_t |
struct | rtti_type_descriptor_t |
struct | recovery_base_descriptor_t |
struct | recovery_complete_object_locator_t |
struct | recovery_type_descriptor_t |
struct | rtti_msvc_analysis_context_t |
Macros | |
#define | NAME_BUF_SIZE 64 |
#define | BASE_CLASSES_MAX 32 |
Typedefs | |
typedef struct rtti_complete_object_locator_t | rtti_complete_object_locator |
typedef struct rtti_class_hierarchy_descriptor_t | rtti_class_hierarchy_descriptor |
typedef struct rtti_base_class_descriptor_t | rtti_base_class_descriptor |
typedef struct rtti_type_descriptor_t | rtti_type_descriptor |
typedef struct recovery_type_descriptor_t | RecoveryTypeDescriptor |
typedef struct recovery_base_descriptor_t | RecoveryBaseDescriptor |
typedef struct recovery_complete_object_locator_t | RecoveryCompleteObjectLocator |
typedef struct rtti_msvc_analysis_context_t | RRTTIMSVCAnalContext |
#define BASE_CLASSES_MAX 32 |
Definition at line 9 of file rtti_msvc.c.
#define NAME_BUF_SIZE 64 |
Definition at line 8 of file rtti_msvc.c.
typedef struct recovery_base_descriptor_t RecoveryBaseDescriptor |
typedef struct recovery_complete_object_locator_t RecoveryCompleteObjectLocator |
typedef struct recovery_type_descriptor_t RecoveryTypeDescriptor |
Definition at line 617 of file rtti_msvc.c.
typedef struct rtti_msvc_analysis_context_t RRTTIMSVCAnalContext |
typedef struct rtti_base_class_descriptor_t rtti_base_class_descriptor |
typedef struct rtti_class_hierarchy_descriptor_t rtti_class_hierarchy_descriptor |
typedef struct rtti_complete_object_locator_t rtti_complete_object_locator |
typedef struct rtti_type_descriptor_t rtti_type_descriptor |
RecoveryCompleteObjectLocator* recovery_analysis_complete_object_locator | ( | RRTTIMSVCAnalContext * | context, |
ut64 | addr, | ||
RVTableInfo * | vtable | ||
) |
Definition at line 698 of file rtti_msvc.c.
References recovery_complete_object_locator_t::addr, addr, rtti_class_hierarchy_descriptor_t::base_class_array_addr, recovery_complete_object_locator_t::base_td, recovery_base_descriptor_t::bcd, recovery_complete_object_locator_t::bcd, recovery_complete_object_locator_t::chd, rtti_complete_object_locator_t::class_descriptor_addr, recovery_complete_object_locator_t::col, recovery_type_descriptor_t::col, rz_list_t::length, NULL, rtti_class_hierarchy_descriptor_t::num_base_classes, rtti_complete_object_locator_t::object_base, recovery_analysis_type_descriptor(), recovery_complete_object_locator_new(), rtti_msvc_addr(), rtti_msvc_read_base_class_array(), rtti_msvc_read_class_hierarchy_descriptor(), rtti_msvc_read_complete_object_locator(), RZ_LOG_DEBUG, rz_pvector_push(), rz_vector_push(), rz_vector_reserve(), recovery_base_descriptor_t::td, recovery_complete_object_locator_t::td, rtti_complete_object_locator_t::type_descriptor_addr, rtti_base_class_descriptor_t::type_descriptor_addr, ut64(), recovery_complete_object_locator_t::valid, recovery_type_descriptor_t::valid, and recovery_complete_object_locator_t::vtable.
Referenced by rz_analysis_rtti_msvc_recover_all().
RecoveryTypeDescriptor * recovery_analysis_type_descriptor | ( | RRTTIMSVCAnalContext * | context, |
ut64 | addr, | ||
RecoveryCompleteObjectLocator * | col | ||
) |
Definition at line 765 of file rtti_msvc.c.
References recovery_type_descriptor_t::addr, addr, recovery_type_descriptor_t::col, NULL, recovery_type_descriptor_new(), rtti_msvc_read_type_descriptor(), rz_pvector_push(), recovery_type_descriptor_t::td, and recovery_type_descriptor_t::valid.
Referenced by recovery_analysis_complete_object_locator().
|
static |
Definition at line 855 of file rtti_msvc.c.
References recovery_base_descriptor_t::bcd, recovery_type_descriptor_t::col, rtti_base_class_descriptor_t::mdisp, rtti_type_descriptor_t::name, NULL, recovery_apply_complete_object_locator(), recovery_apply_type_descriptor(), rz_analysis_class_base_fini(), rz_analysis_class_base_set(), RZ_LOG_DEBUG, RZ_LOG_WARN, rz_vector_foreach, strdup(), recovery_base_descriptor_t::td, recovery_type_descriptor_t::td, ut64(), recovery_type_descriptor_t::valid, and rtti_base_class_descriptor_t::where.
Referenced by recovery_apply_complete_object_locator(), and recovery_apply_type_descriptor().
|
static |
Definition at line 886 of file rtti_msvc.c.
References recovery_complete_object_locator_t::addr, recovery_complete_object_locator_t::base_td, free(), name, rtti_type_descriptor_t::name, NULL, PFMT64x, recovery_apply_bases(), recovery_apply_vtable(), rz_analysis_class_create(), rz_analysis_rtti_msvc_demangle_class_name(), RZ_LOG_DEBUG, strdup(), recovery_complete_object_locator_t::td, recovery_type_descriptor_t::td, autogen_x86imm::tmp, unique_class_name(), recovery_complete_object_locator_t::valid, and recovery_complete_object_locator_t::vtable.
Referenced by recovery_apply_bases(), and rz_analysis_rtti_msvc_recover_all().
|
static |
Definition at line 928 of file rtti_msvc.c.
References recovery_type_descriptor_t::addr, recovery_complete_object_locator_t::base_td, recovery_type_descriptor_t::col, name, rtti_type_descriptor_t::name, NULL, recovery_apply_bases(), recovery_apply_vtable(), rz_analysis_class_create(), rz_analysis_rtti_msvc_demangle_class_name(), RZ_LOG_DEBUG, strdup(), recovery_type_descriptor_t::td, recovery_complete_object_locator_t::valid, recovery_type_descriptor_t::valid, and recovery_complete_object_locator_t::vtable.
Referenced by recovery_apply_bases(), and rz_analysis_rtti_msvc_recover_all().
|
static |
Definition at line 810 of file rtti_msvc.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 recovery_apply_complete_object_locator(), and recovery_apply_type_descriptor().
void recovery_complete_object_locator_free | ( | RecoveryCompleteObjectLocator * | col | ) |
Definition at line 648 of file rtti_msvc.c.
References recovery_complete_object_locator_t::base_td, recovery_complete_object_locator_t::bcd, free(), rz_list_free(), and rz_vector_clear().
Referenced by rz_analysis_rtti_msvc_recover_all().
RecoveryCompleteObjectLocator* recovery_complete_object_locator_new | ( | ) |
Definition at line 639 of file rtti_msvc.c.
References recovery_complete_object_locator_t::base_td, NULL, RZ_NEW0, and rz_vector_init().
Referenced by recovery_analysis_complete_object_locator().
void recovery_type_descriptor_free | ( | RecoveryTypeDescriptor * | td | ) |
Definition at line 678 of file rtti_msvc.c.
References free(), rtti_type_descriptor_fini(), and recovery_type_descriptor_t::td.
Referenced by rz_analysis_rtti_msvc_recover_all().
RecoveryTypeDescriptor* recovery_type_descriptor_new | ( | ) |
Definition at line 664 of file rtti_msvc.c.
References recovery_type_descriptor_t::addr, recovery_type_descriptor_t::col, memset(), NULL, RZ_NEW, recovery_type_descriptor_t::td, and recovery_type_descriptor_t::valid.
Referenced by recovery_analysis_type_descriptor().
|
inlinestatic |
Definition at line 49 of file rtti_msvc.c.
References addr.
Referenced by recovery_analysis_complete_object_locator(), and rtti_msvc_print_complete_object_locator_recurse().
|
static |
Definition at line 125 of file rtti_msvc.c.
Referenced by rtti_msvc_read_base_class_descriptor().
|
static |
Definition at line 352 of file rtti_msvc.c.
References rtti_base_class_descriptor_t::attributes, rtti_base_class_descriptor_t::mdisp, rtti_base_class_descriptor_t::num_contained_bases, rtti_base_class_descriptor_t::pdisp, PFMT32x, prefix, rz_cons_printf(), rtti_base_class_descriptor_t::type_descriptor_addr, rtti_base_class_descriptor_t::vdisp, and rtti_base_class_descriptor_t::where.
Referenced by rtti_msvc_print_complete_object_locator_recurse(), and rz_analysis_rtti_msvc_print_base_class_descriptor().
|
static |
Definition at line 371 of file rtti_msvc.c.
References rtti_base_class_descriptor_t::attributes, rtti_base_class_descriptor_t::mdisp, rtti_base_class_descriptor_t::num_contained_bases, rtti_base_class_descriptor_t::pdisp, pj_end(), pj_ki(), pj_kn(), pj_ko(), pj_o(), rtti_base_class_descriptor_t::type_descriptor_addr, rtti_base_class_descriptor_t::vdisp, and rtti_base_class_descriptor_t::where.
Referenced by rtti_msvc_print_complete_object_locator_recurse(), and rz_analysis_rtti_msvc_print_base_class_descriptor().
|
static |
Definition at line 330 of file rtti_msvc.c.
References addr, rtti_class_hierarchy_descriptor_t::attributes, rtti_class_hierarchy_descriptor_t::base_class_array_addr, rtti_class_hierarchy_descriptor_t::num_base_classes, PFMT32x, PFMT64x, prefix, rz_cons_printf(), and rtti_class_hierarchy_descriptor_t::signature.
Referenced by rtti_msvc_print_complete_object_locator_recurse(), and rz_analysis_rtti_msvc_print_class_hierarchy_descriptor().
|
static |
Definition at line 343 of file rtti_msvc.c.
References rtti_class_hierarchy_descriptor_t::attributes, rtti_class_hierarchy_descriptor_t::base_class_array_addr, rtti_class_hierarchy_descriptor_t::num_base_classes, pj_end(), pj_kn(), pj_o(), and rtti_class_hierarchy_descriptor_t::signature.
Referenced by rtti_msvc_print_complete_object_locator_recurse(), and rz_analysis_rtti_msvc_print_class_hierarchy_descriptor().
|
static |
Definition at line 283 of file rtti_msvc.c.
References addr, rtti_complete_object_locator_t::cd_offset, rtti_complete_object_locator_t::class_descriptor_addr, rtti_complete_object_locator_t::object_base, PFMT32x, PFMT64x, prefix, rz_cons_printf(), rtti_complete_object_locator_t::signature, rtti_complete_object_locator_t::type_descriptor_addr, and rtti_complete_object_locator_t::vtable_offset.
Referenced by rtti_msvc_print_complete_object_locator_recurse(), and rz_analysis_rtti_msvc_print_complete_object_locator().
|
static |
Definition at line 300 of file rtti_msvc.c.
References rtti_complete_object_locator_t::cd_offset, rtti_complete_object_locator_t::class_descriptor_addr, rtti_complete_object_locator_t::object_base, pj_end(), pj_kn(), pj_o(), rtti_complete_object_locator_t::signature, rtti_complete_object_locator_t::type_descriptor_addr, and rtti_complete_object_locator_t::vtable_offset.
Referenced by rtti_msvc_print_complete_object_locator_recurse(), and rz_analysis_rtti_msvc_print_complete_object_locator().
|
static |
Definition at line 499 of file rtti_msvc.c.
References rtti_class_hierarchy_descriptor_t::base_class_array_addr, rtti_complete_object_locator_t::class_descriptor_addr, NULL, rtti_class_hierarchy_descriptor_t::num_base_classes, rtti_complete_object_locator_t::object_base, PFMT64x, pj_end(), pj_free(), pj_k(), pj_ka(), pj_new(), pj_o(), pj_string(), rtti_msvc_addr(), rtti_msvc_print_base_class_descriptor(), rtti_msvc_print_base_class_descriptor_json(), rtti_msvc_print_class_hierarchy_descriptor(), rtti_msvc_print_class_hierarchy_descriptor_json(), rtti_msvc_print_complete_object_locator(), rtti_msvc_print_complete_object_locator_json(), rtti_msvc_print_type_descriptor(), rtti_msvc_print_type_descriptor_json(), rtti_msvc_read_base_class_array(), rtti_msvc_read_class_hierarchy_descriptor(), rtti_msvc_read_complete_object_locator(), rtti_msvc_read_type_descriptor(), rtti_type_descriptor_fini(), RZ_LOG_ERROR, RZ_OUTPUT_MODE_JSON, rtti_complete_object_locator_t::type_descriptor_addr, rtti_base_class_descriptor_t::type_descriptor_addr, and ut64().
|
static |
Definition at line 311 of file rtti_msvc.c.
References addr, rtti_type_descriptor_t::name, PFMT64x, prefix, rz_cons_printf(), rtti_type_descriptor_t::spare, and rtti_type_descriptor_t::vtable_addr.
Referenced by rtti_msvc_print_complete_object_locator_recurse(), and rz_analysis_rtti_msvc_print_type_descriptor().
|
static |
Definition at line 322 of file rtti_msvc.c.
References rtti_type_descriptor_t::name, pj_end(), pj_kn(), pj_ks(), pj_o(), rtti_type_descriptor_t::spare, and rtti_type_descriptor_t::vtable_addr.
Referenced by rtti_msvc_print_complete_object_locator_recurse(), and rz_analysis_rtti_msvc_print_type_descriptor().
|
static |
Definition at line 156 of file rtti_msvc.c.
References addr, BASE_CLASSES_MAX, free(), malloc(), NULL, PFMT64x, rtti_msvc_read_base_class_descriptor(), rz_cons_break_pop(), rz_cons_break_push(), rz_cons_is_breaked(), rz_list_append(), rz_list_free(), rz_list_newf(), RZ_LOG_DEBUG, RZ_MIN, rz_read_be32(), rz_read_le32(), src, autogen_x86imm::tmp, UT32_MAX, ut64(), and UT64_MAX.
Referenced by recovery_analysis_complete_object_locator(), and rtti_msvc_print_complete_object_locator_recurse().
|
static |
Definition at line 129 of file rtti_msvc.c.
References addr, rtti_base_class_descriptor_t::attributes, int, rtti_base_class_descriptor_t::mdisp, rtti_base_class_descriptor_t::num_contained_bases, rtti_base_class_descriptor_t::pdisp, rtti_msvc_base_class_descriptor_size(), RZ_MIN, rz_read_at_be32(), rz_read_at_le32(), rz_read_ble(), src, rtti_base_class_descriptor_t::type_descriptor_addr, ut64(), UT64_MAX, rtti_base_class_descriptor_t::vdisp, and rtti_base_class_descriptor_t::where.
Referenced by rtti_msvc_read_base_class_array(), and rz_analysis_rtti_msvc_print_base_class_descriptor().
|
static |
Definition at line 95 of file rtti_msvc.c.
References addr, rtti_class_hierarchy_descriptor_t::attributes, rtti_class_hierarchy_descriptor_t::base_class_array_addr, rtti_class_hierarchy_descriptor_t::num_base_classes, RZ_MIN, rz_read_at_be32(), rz_read_at_le32(), rz_read_ble(), rtti_class_hierarchy_descriptor_t::signature, src, and UT64_MAX.
Referenced by recovery_analysis_complete_object_locator(), rtti_msvc_print_complete_object_locator_recurse(), and rz_analysis_rtti_msvc_print_class_hierarchy_descriptor().
|
static |
Definition at line 56 of file rtti_msvc.c.
References addr, rtti_complete_object_locator_t::cd_offset, rtti_complete_object_locator_t::class_descriptor_addr, rtti_complete_object_locator_t::object_base, RZ_MIN, rz_read_at_be32(), rz_read_at_le32(), rz_read_ble(), rtti_complete_object_locator_t::signature, src, rtti_complete_object_locator_t::type_descriptor_addr, UT64_MAX, and rtti_complete_object_locator_t::vtable_offset.
Referenced by recovery_analysis_complete_object_locator(), rtti_msvc_print_complete_object_locator_recurse(), and rz_analysis_rtti_msvc_print_complete_object_locator().
|
static |
Definition at line 226 of file rtti_msvc.c.
References addr, i, malloc(), memcpy(), rtti_type_descriptor_t::name, NAME_BUF_SIZE, rtti_type_descriptor_t::spare, ut64(), UT64_MAX, and rtti_type_descriptor_t::vtable_addr.
Referenced by recovery_analysis_type_descriptor(), rtti_msvc_print_complete_object_locator_recurse(), and rz_analysis_rtti_msvc_print_type_descriptor().
|
static |
Definition at line 44 of file rtti_msvc.c.
References free(), rtti_type_descriptor_t::name, and NULL.
Referenced by recovery_type_descriptor_free(), rtti_msvc_print_complete_object_locator_recurse(), and rz_analysis_rtti_msvc_print_type_descriptor().
RZ_API char* rz_analysis_rtti_msvc_demangle_class_name | ( | RVTableContext * | context, |
const char * | name | ||
) |
Demangle a class name as found in MSVC RTTI type descriptors.
Examples: .?AVClassA@ => ClassA .?AVClassInInnerNamespace@InnerNamespace@OuterNamespace@ => OuterNamespace::InnerNamespace::AVClassInInnerNamespace
Definition at line 393 of file rtti_msvc.c.
References free(), n, NULL, RZ_FREE, strdup(), and autogen_x86imm::tmp.
Referenced by recovery_apply_complete_object_locator(), recovery_apply_type_descriptor(), and rz_analysis_rtti_demangle_class_name().
RZ_API bool rz_analysis_rtti_msvc_print_at_vtable | ( | RVTableContext * | context, |
ut64 | addr, | ||
RzOutputMode | mode, | ||
bool | strict | ||
) |
Definition at line 617 of file rtti_msvc.c.
Referenced by rz_analysis_rtti_print_all(), and rz_analysis_rtti_print_at_vtable().
RZ_API void rz_analysis_rtti_msvc_print_base_class_descriptor | ( | RVTableContext * | context, |
ut64 | addr, | ||
int | mode | ||
) |
Definition at line 479 of file rtti_msvc.c.
References addr, PFMT64x, pj_free(), pj_new(), pj_string(), rtti_msvc_print_base_class_descriptor(), rtti_msvc_print_base_class_descriptor_json(), rtti_msvc_read_base_class_descriptor(), and RZ_LOG_ERROR.
RZ_API void rz_analysis_rtti_msvc_print_class_hierarchy_descriptor | ( | RVTableContext * | context, |
ut64 | addr, | ||
int | mode | ||
) |
Definition at line 459 of file rtti_msvc.c.
References addr, PFMT64x, pj_free(), pj_new(), pj_string(), rtti_msvc_print_class_hierarchy_descriptor(), rtti_msvc_print_class_hierarchy_descriptor_json(), rtti_msvc_read_class_hierarchy_descriptor(), and RZ_LOG_ERROR.
RZ_API void rz_analysis_rtti_msvc_print_complete_object_locator | ( | RVTableContext * | context, |
ut64 | addr, | ||
int | mode | ||
) |
Definition at line 417 of file rtti_msvc.c.
References addr, PFMT64x, pj_free(), pj_new(), pj_string(), rtti_msvc_print_complete_object_locator(), rtti_msvc_print_complete_object_locator_json(), rtti_msvc_read_complete_object_locator(), and RZ_LOG_ERROR.
RZ_API void rz_analysis_rtti_msvc_print_type_descriptor | ( | RVTableContext * | context, |
ut64 | addr, | ||
int | mode | ||
) |
Definition at line 437 of file rtti_msvc.c.
References addr, PFMT64x, pj_free(), pj_new(), pj_string(), rtti_msvc_print_type_descriptor(), rtti_msvc_print_type_descriptor_json(), rtti_msvc_read_type_descriptor(), rtti_type_descriptor_fini(), and RZ_LOG_ERROR.
Definition at line 966 of file rtti_msvc.c.
References NULL, recovery_analysis_complete_object_locator(), recovery_apply_complete_object_locator(), recovery_apply_type_descriptor(), recovery_complete_object_locator_free(), recovery_type_descriptor_free(), rz_analysis_vtable_info_free(), rz_pvector_clear(), rz_pvector_foreach, rz_pvector_init(), str_value_free(), ut64(), recovery_complete_object_locator_t::valid, and recovery_type_descriptor_t::valid.
Referenced by rz_analysis_rtti_recover_all().
void str_value_free | ( | HtUPKv * | kv | ) |
Definition at line 962 of file rtti_msvc.c.
References free().
Referenced by rz_analysis_rtti_msvc_recover_all().
|
static |
Definition at line 791 of file rtti_msvc.c.
References free(), i, name, NULL, rz_analysis_class_exists(), RZ_LOG_DEBUG, rz_str_newf(), and strdup().
Referenced by recovery_apply_complete_object_locator().