Rizin
unix-like reverse engineering framework and cli tools
|
#include <rz_bin.h>
#include <rz_core.h>
#include <rz_type.h>
#include <rz_pdb.h>
#include <rz_analysis.h>
#include "../bin/pdb/pdb.h"
Go to the source code of this file.
|
static |
Definition at line 426 of file type_pdb.c.
References create_type_name_from_offset(), rz_type_t::identifier, is_tpitype_unnamed(), rz_type_t::kind, NULL, RZ_NEW0, RZ_TYPE_KIND_IDENTIFIER, strdup(), and type.
Referenced by parse_structure(), and parse_union().
|
static |
Create a type name from offset.
offset |
Definition at line 46 of file type_pdb.c.
References malloc(), NULL, PFMT64x, snprintf, and cmd_descs_generate::str.
Referenced by create_rztype(), get_tpitype_basetype(), parse_enum(), parse_type_nest(), and parse_type_procedure().
|
inlinestatic |
Definition at line 414 of file type_pdb.c.
References create_type_name_from_offset(), free(), is_tpitype_unnamed(), rz_type_db_get_base_type(), and type.
Referenced by parse_enum(), parse_structure(), and parse_union().
|
static |
Definition at line 30 of file type_pdb.c.
References LF_CLASS, LF_CLASS_19, LF_ENUM, LF_STRUCTURE, LF_STRUCTURE_19, LF_UNION, rz_return_val_if_fail, and type.
Referenced by rz_parse_pdb_types().
Definition at line 410 of file type_pdb.c.
Referenced by create_rztype(), get_tpitype_basetype(), and parse_enum().
|
static |
Parses enum into BaseType and saves it into SDB.
t | RzTypeDB instance |
stream | TPI Stream |
type | Current type |
Definition at line 683 of file type_pdb.c.
References rz_base_type_t::attrs, rz_base_type_enum_t::cases, create_type_name_from_offset(), rz_base_type_t::enum_data, free(), get_tpitype_basetype(), is_tpitype_unnamed(), rz_base_type_t::kind, tpi_types::leaf_type, LF_INDEX, rz_base_type_t::name, NULL, parse_enumerate(), parse_type(), RZ_BASE_TYPE_KIND_ENUM, rz_bin_pdb_get_type_by_index(), rz_bin_pdb_get_type_members(), rz_bin_pdb_get_type_name(), rz_bin_pdb_get_type_val(), rz_bin_pdb_type_is_fwdref(), rz_list_append(), rz_list_first(), RZ_LOG_INFO, RZ_LOG_WARN, rz_return_val_if_fail, rz_type_base_enum_case_free(), rz_type_base_type_free(), rz_type_base_type_kind_as_string(), rz_type_base_type_new(), rz_type_clone(), rz_type_db_delete_base_type(), rz_type_db_get_bitsize(), rz_type_db_save_base_type(), RZ_TYPE_TYPECLASS_INVALID, RZ_TYPE_TYPECLASS_NONE, rz_vector_clear(), rz_vector_push(), rz_base_type_t::size, strdup(), type, rz_base_type_t::type, and Tpi_LF_Enum::utype.
Referenced by parse_regular_type(), and parse_types().
|
static |
Parse enum case.
type_info | Current type info (enum case) |
Definition at line 657 of file type_pdb.c.
References cleanup(), LF_ENUMERATE, rz_type_enum_case_t::name, NULL, rz_bin_pdb_get_type_name(), rz_bin_pdb_get_type_val(), RZ_NEW0, rz_return_val_if_fail, strdup(), type, ut64(), rz_type_enum_case_t::val, and value.
Referenced by parse_enum().
|
static |
Definition at line 74 of file type_pdb.c.
References LF_ARRAY, LF_BITFIELD, LF_CLASS, LF_CLASS_19, LF_ENUM, LF_MODIFIER, LF_POINTER, LF_PROCEDURE, LF_STRUCTURE, LF_STRUCTURE_19, LF_UNION, NULL, parse_enum(), parse_structure(), parse_type_array(), parse_type_modifier(), parse_type_pointer(), parse_type_procedure(), parse_union(), RZ_LOG_INFO, rz_return_val_if_fail, and type.
Referenced by parse_type().
|
static |
Parses struct member.
typedb | Types DB instance |
stream | TPI Stream |
type_info | Current RzPdbTpiType (member) |
Definition at line 352 of file type_pdb.c.
References cleanup(), tpi_types::leaf_type, LF_BCLASS, LF_MEMBER, LF_METHOD, LF_NESTTYPE, LF_ONEMETHOD, LF_STMEMBER, LF_VFUNCTAB, rz_type_struct_member_t::name, NULL, rz_type_struct_member_t::offset, parse_type_member(), parse_type_nest(), parse_type_onemethod(), parse_type_static_member(), rz_bin_pdb_get_type_name(), rz_bin_pdb_get_type_val(), RZ_LOG_ERROR, RZ_LOG_INFO, RZ_NEW0, rz_return_val_if_fail, rz_type_free(), strdup(), type, rz_type_struct_member_t::type, and ut64().
Referenced by parse_structure().
|
static |
Parses structures into BaseType and saves them into hashtable.
t | RzTypeDB instance |
stream | TPI Stream |
type | Current type |
Definition at line 444 of file type_pdb.c.
References rz_base_type_t::attrs, create_rztype(), free(), get_tpitype_basetype(), rz_type_t::identifier, rz_base_type_t::kind, tpi_types::leaf_type, LF_INDEX, rz_base_type_struct_t::members, rz_base_type_t::name, NULL, parse_struct_member(), RZ_BASE_TYPE_KIND_STRUCT, rz_bin_pdb_get_type_by_index(), rz_bin_pdb_get_type_members(), rz_bin_pdb_get_type_name(), rz_bin_pdb_get_type_val(), rz_bin_pdb_type_is_fwdref(), rz_list_append(), rz_list_first(), RZ_LOG_INFO, RZ_LOG_WARN, rz_return_val_if_fail, rz_type_base_struct_member_free(), rz_type_base_type_free(), rz_type_base_type_kind_as_string(), rz_type_base_type_new(), rz_type_clone(), rz_type_db_delete_base_type(), rz_type_db_save_base_type(), RZ_TYPE_IDENTIFIER_KIND_STRUCT, RZ_TYPE_TYPECLASS_INVALID, RZ_TYPE_TYPECLASS_NONE, rz_vector_clear(), rz_vector_push(), rz_base_type_t::size, strdup(), rz_base_type_t::struct_data, type, and rz_base_type_t::type.
Referenced by parse_regular_type(), and parse_types().
|
static |
Definition at line 153 of file type_pdb.c.
References LF_POINTER, LF_SIMPLE_TYPE, NULL, parse_regular_type(), parse_type_pointer(), rz_type_db_t::parser, RZ_FREE, RZ_LOG_ERROR, rz_return_val_if_fail, rz_type_parse_string_single(), type, and Tpi_LF_SimpleType::type.
Referenced by parse_enum(), parse_type_arglist(), parse_type_array(), parse_type_member(), parse_type_mfunction(), parse_type_modifier(), parse_type_nest(), parse_type_pointer(), parse_type_procedure(), and parse_type_static_member().
|
static |
Definition at line 174 of file type_pdb.c.
References Tpi_LF_Arglist::arg_type, Tpi_LF_Arglist::count, i, arg::name, NULL, parse_type(), rz_bin_pdb_get_type_by_index(), RZ_NEW0, rz_pvector_push(), rz_return_if_fail, rz_str_newf(), type, and tpi_types::type_data.
Referenced by parse_type_mfunction(), and parse_type_procedure().
|
static |
Definition at line 53 of file type_pdb.c.
References rz_type_t::array, Tpi_LF_Array::element_type, rz_type_t::kind, NULL, parse_type(), rz_bin_pdb_get_type_by_index(), rz_bin_pdb_get_type_val(), RZ_NEW0, rz_return_val_if_fail, RZ_TYPE_KIND_ARRAY, and type.
Referenced by parse_regular_type().
|
static |
Definition at line 288 of file type_pdb.c.
References Tpi_LF_Member::index, NULL, parse_type(), rz_bin_pdb_get_type_by_index(), rz_return_val_if_fail, and tpi_types::type_data.
Referenced by parse_struct_member(), and parse_union_member().
|
static |
Definition at line 238 of file type_pdb.c.
References Tpi_LF_MFcuntion::arglist, Tpi_LF_MFcuntion::call_conv, free(), NULL, parse_type(), parse_type_arglist(), Tpi_LF_MFcuntion::return_type, rz_bin_pdb_calling_convention_as_string(), rz_bin_pdb_get_type_by_index(), RZ_NEW0, rz_pvector_new(), rz_return_val_if_fail, rz_type_callable_arg_free(), rz_type_free(), rz_type_func_save(), RZ_TYPE_KIND_CALLABLE, strdup(), type, and tpi_types::type_data.
Referenced by parse_type_onemethod().
|
static |
Definition at line 108 of file type_pdb.c.
References TpiCVModifier::bits, TpiCVModifier::const_, rz_type_t::identifier, rz_type_t::kind, Tpi_LF_Modifier::modified_type, NULL, parse_type(), rz_type_t::pointer, rz_bin_pdb_get_type_by_index(), rz_return_val_if_fail, RZ_TYPE_KIND_IDENTIFIER, RZ_TYPE_KIND_POINTER, type, and Tpi_LF_Modifier::umodifier.
Referenced by parse_regular_type().
|
static |
Definition at line 309 of file type_pdb.c.
References create_type_name_from_offset(), Tpi_LF_NestType::index, rz_type_t::kind, rz_base_type_t::name, NULL, parse_type(), RZ_BASE_TYPE_KIND_TYPEDEF, rz_bin_pdb_get_type_by_index(), rz_bin_pdb_get_type_name(), rz_return_val_if_fail, rz_type_base_type_new(), rz_type_clone(), rz_type_db_get_base_type(), rz_type_db_save_base_type(), RZ_TYPE_KIND_IDENTIFIER, strdup(), rz_base_type_t::type, and tpi_types::type_data.
Referenced by parse_struct_member(), and parse_union_member().
|
static |
Definition at line 274 of file type_pdb.c.
References Tpi_LF_OneMethod::index, tpi_types::leaf_type, LF_MFUNCTION, NULL, parse_type_mfunction(), rz_bin_pdb_get_type_by_index(), rz_bin_pdb_get_type_name(), rz_return_val_if_fail, and tpi_types::type_data.
Referenced by parse_struct_member(), and parse_union_member().
|
static |
Definition at line 131 of file type_pdb.c.
References error(), rz_type_t::kind, NULL, parse_type(), rz_type_t::pointer, rz_bin_pdb_get_type_by_index(), RZ_NEW0, rz_return_val_if_fail, rz_type_free(), RZ_TYPE_KIND_POINTER, autogen_x86imm::tmp, type, and Tpi_LF_Pointer::utype.
Referenced by parse_regular_type(), and parse_type().
|
static |
Definition at line 197 of file type_pdb.c.
References Tpi_LF_Procedure::arg_list, rz_callable_at::args, Tpi_LF_Procedure::call_conv, rz_type_t::callable, rz_callable_at::cc, create_type_name_from_offset(), free(), rz_type_t::kind, rz_callable_at::name, rz_callable_at::noret, NULL, parse_type(), parse_type_arglist(), rz_callable_at::ret, Tpi_LF_Procedure::return_type, rz_bin_pdb_calling_convention_as_string(), rz_bin_pdb_get_type_by_index(), RZ_NEW0, rz_pvector_new(), rz_return_val_if_fail, rz_type_callable_arg_free(), rz_type_free(), rz_type_func_save(), RZ_TYPE_KIND_CALLABLE, strdup(), and type.
Referenced by parse_regular_type().
|
static |
Definition at line 299 of file type_pdb.c.
References Tpi_LF_StaticMember::index, NULL, parse_type(), rz_bin_pdb_get_type_by_index(), rz_return_val_if_fail, and tpi_types::type_data.
Referenced by parse_struct_member().
|
static |
Delegate the type parsing to appropriate function.
t | RzTypeDB instance |
stream | TPI Stream |
type | Current type |
Definition at line 771 of file type_pdb.c.
References LF_CLASS, LF_CLASS_19, LF_ENUM, LF_STRUCTURE, LF_STRUCTURE_19, LF_UNION, parse_enum(), parse_structure(), parse_union(), RZ_LOG_ERROR, rz_return_if_fail, and type.
Referenced by rz_parse_pdb_types().
|
static |
Parses union into BaseType and saves it into hashtable.
typedb | Types DB instance |
stream | TPI Stream |
type_info | Current RzPdbTpiType (enum case) |
Definition at line 577 of file type_pdb.c.
References rz_base_type_t::attrs, create_rztype(), free(), get_tpitype_basetype(), rz_type_t::identifier, rz_base_type_t::kind, tpi_types::leaf_type, LF_INDEX, rz_base_type_union_t::members, rz_base_type_t::name, NULL, parse_union_member(), RZ_BASE_TYPE_KIND_UNION, rz_bin_pdb_get_type_by_index(), rz_bin_pdb_get_type_members(), rz_bin_pdb_get_type_name(), rz_bin_pdb_get_type_val(), rz_bin_pdb_type_is_fwdref(), rz_list_append(), rz_list_first(), RZ_LOG_INFO, RZ_LOG_WARN, rz_return_val_if_fail, rz_type_base_type_free(), rz_type_base_type_kind_as_string(), rz_type_base_type_new(), rz_type_base_union_member_free(), rz_type_clone(), rz_type_db_delete_base_type(), rz_type_db_save_base_type(), RZ_TYPE_IDENTIFIER_KIND_UNION, RZ_TYPE_TYPECLASS_INVALID, RZ_TYPE_TYPECLASS_NONE, rz_vector_clear(), rz_vector_push(), rz_base_type_t::size, strdup(), type, rz_base_type_t::type, and rz_base_type_t::union_data.
Referenced by parse_regular_type(), and parse_types().
|
static |
Parses union member.
typedb | Types DB instance |
stream | TPI Stream |
type_info | Current RzPdbTpiType (member) |
Definition at line 527 of file type_pdb.c.
References cleanup(), tpi_types::leaf_type, LF_MEMBER, LF_NESTTYPE, LF_ONEMETHOD, rz_type_union_member_t::name, NULL, rz_type_union_member_t::offset, parse_type_member(), parse_type_nest(), parse_type_onemethod(), rz_bin_pdb_get_type_name(), rz_bin_pdb_get_type_val(), RZ_LOG_ERROR, RZ_LOG_INFO, RZ_NEW0, rz_return_val_if_fail, rz_type_free(), strdup(), type, rz_type_union_member_t::type, and ut64().
Referenced by parse_union().
Saves PDB types from TPI stream into the type database.
t | RzTypeDB instance |
pdb | PDB instance |
Definition at line 802 of file type_pdb.c.
References is_parsable_type(), parse_types(), tpi_stream_t::print_type, rz_list_new(), rz_rbtree_foreach, rz_return_if_fail, rz_pdb_t::s_tpi, and type.
Referenced by rz_core_pdb_load_info().