Rizin
unix-like reverse engineering framework and cli tools
|
Go to the source code of this file.
Definition at line 39 of file path.c.
References eprintf, free(), rz_type_t::identifier, rz_type_t::kind, malloc(), NULL, path, rz_return_val_if_fail, rz_type_db_get_bitsize(), rz_type_db_struct_member_packed_offset(), RZ_TYPE_IDENTIFIER_KIND_STRUCT, RZ_TYPE_IDENTIFIER_KIND_UNION, rz_type_identifier_of_base_type_str(), RZ_TYPE_KIND_ARRAY, RZ_TYPE_KIND_IDENTIFIER, st64, and ut64().
Referenced by rz_type_offset_by_path().
Returns the list of all structured types that have members matching the offset.
typedb | Types Database instance |
offset | The offset of the member to match against |
Definition at line 219 of file path.c.
References rz_base_type_t::kind, list(), NULL, RZ_BASE_TYPE_KIND_STRUCT, RZ_BASE_TYPE_KIND_UNION, rz_list_free(), rz_list_join(), rz_list_newf(), rz_return_val_if_fail, rz_type_db_get_base_types(), rz_type_path_by_offset(), rz_type_path_free(), and types.
Referenced by rz_analysis_list_struct_offsets_handler(), and rz_core_analysis_hint_set_offset().
RZ_API ut64 rz_type_db_struct_member_offset | ( | RZ_NONNULL const RzTypeDB * | typedb, |
RZ_NONNULL const char * | name, | ||
RZ_NONNULL const char * | member | ||
) |
Returns the offset in bytes of the structure member if there is a match.
typedb | Types Database instance |
name | The structure type name |
name | The structure member name |
Definition at line 269 of file path.c.
References rz_base_type_t::kind, rz_base_type_struct_t::members, rz_type_struct_member_t::name, rz_type_struct_member_t::offset, RZ_BASE_TYPE_KIND_STRUCT, rz_return_val_if_fail, rz_type_db_get_base_type(), rz_vector_foreach, and rz_base_type_t::struct_data.
Referenced by rz_debug_dmp_init(), and winkd_build_profile().
RZ_API ut64 rz_type_db_struct_member_packed_offset | ( | RZ_NONNULL const RzTypeDB * | typedb, |
RZ_NONNULL const char * | name, | ||
RZ_NONNULL const char * | member | ||
) |
Returns the packed offset in bits of the structure member if there is a match.
typedb | Types Database instance |
name | The structure type name |
name | The structure member name |
Definition at line 244 of file path.c.
References rz_base_type_t::kind, rz_base_type_struct_t::members, rz_type_struct_member_t::name, RZ_BASE_TYPE_KIND_STRUCT, rz_return_val_if_fail, rz_type_db_get_base_type(), rz_type_db_get_bitsize(), rz_vector_foreach, rz_base_type_t::struct_data, rz_type_struct_member_t::type, and ut64().
Referenced by path_walker().
Returns the offset of the member given path.
Resolves the path in the form of "a.b[20].c" where "b" is a member of "a" and "c" is a member of "b" array and located inside the 20-th element, and calculates the offset. Opposite function of "rz_type_path_by_offset"
type | RzTypePath |
Definition at line 120 of file path.c.
References path, path_walker(), and rz_return_val_if_fail.
RZ_API RZ_OWN RzList* rz_type_path_by_offset | ( | const RzTypeDB * | typedb, |
RzBaseType * | btype, | ||
ut64 | offset | ||
) |
Returns the list of all type paths matching the offset.
typedb | Types Database instance |
btype | The base type |
offset | The offset of the path to match against |
Definition at line 176 of file path.c.
References free(), rz_base_type_t::kind, list(), rz_base_type_struct_t::members, rz_base_type_union_t::members, rz_type_struct_member_t::name, rz_type_union_member_t::name, rz_base_type_t::name, path, RZ_BASE_TYPE_KIND_STRUCT, RZ_BASE_TYPE_KIND_UNION, rz_list_append(), rz_list_newf(), rz_str_newf(), rz_type_db_get_bitsize(), rz_type_identifier_of_base_type(), rz_type_path_free(), rz_type_path_new(), rz_vector_foreach, rz_warn_if_reached, rz_base_type_t::struct_data, structured_member_walker(), rz_type_struct_member_t::type, rz_type_union_member_t::type, rz_base_type_t::union_data, and ut64().
Referenced by rz_type_db_get_by_offset(), type_paths_collect_by_address_cb(), and type_paths_collect_by_offset_cb().
RZ_API void rz_type_path_free | ( | RZ_NULLABLE RzTypePath * | tpath | ) |
Frees the RzTypePath.
Doesn't free the underlying RzBaseType, only the path.
type | RzTypePath |
Definition at line 31 of file path.c.
References free().
Referenced by rz_type_db_get_by_offset(), and rz_type_path_by_offset().
RZ_API RZ_OWN RzTypePath* rz_type_path_new | ( | RZ_BORROW RZ_NONNULL RzType * | type, |
RZ_OWN RZ_NONNULL char * | path | ||
) |
Creates a new instance of RzTypePath.
type | RzType pointer |
path | String representation of type path |
Definition at line 13 of file path.c.
References NULL, rz_type_path_t::path, path, RZ_NEW0, rz_return_val_if_fail, rz_type_path_t::typ, and type.
Referenced by rz_type_path_by_offset(), and structured_member_walker().
|
static |
Definition at line 126 of file path.c.
References free(), list(), rz_base_type_struct_t::members, rz_base_type_union_t::members, rz_type_struct_member_t::name, rz_type_union_member_t::name, rz_base_type_t::name, path, rz_list_append(), rz_return_val_if_fail, rz_str_newf(), rz_type_db_get_base_type(), rz_type_db_get_bitsize(), RZ_TYPE_IDENTIFIER_KIND_STRUCT, RZ_TYPE_IDENTIFIER_KIND_UNION, RZ_TYPE_KIND_IDENTIFIER, rz_type_path_new(), rz_vector_foreach, rz_base_type_t::struct_data, type, rz_type_struct_member_t::type, rz_type_union_member_t::type, rz_base_type_t::union_data, and ut64().
Referenced by rz_type_path_by_offset().