Rizin
unix-like reverse engineering framework and cli tools
|
#include <rz_util.h>
#include <rz_type.h>
#include <rz_analysis.h>
#include <string.h>
#include <sdb.h>
Go to the source code of this file.
Classes | |
struct | TListMeta |
Functions | |
RZ_API bool | rz_analysis_type_link_exists (RzAnalysis *analysis, ut64 addr) |
Checks if the RzType linked to the given address. More... | |
RZ_API RZ_BORROW RzType * | rz_analysis_type_link_at (RzAnalysis *analysis, ut64 addr) |
Returns the RzType linked to the given address. More... | |
RZ_API bool | rz_analysis_type_set_link (RzAnalysis *analysis, RZ_BORROW RzType *type, ut64 addr) |
Links the given RzType to the address. More... | |
RZ_API bool | rz_analysis_type_unlink (RzAnalysis *analysis, ut64 addr) |
Removes the type link given the address. More... | |
RZ_API bool | rz_analysis_type_unlink_all (RzAnalysis *analysis) |
Removes all type links. More... | |
static bool | type_collect_cb (void *user, ut64 k, const void *v) |
RZ_API RZ_OWN RzList * | rz_analysis_type_links (RzAnalysis *analysis) |
Returns the list of all linked types. More... | |
static bool | type_paths_collect_by_offset_cb (void *user, ut64 k, const void *v) |
RZ_API RZ_OWN RzList * | rz_analysis_type_links_by_offset (RzAnalysis *analysis, ut64 offset) |
Returns the list of all structured types that are linked and have members matching the offset. More... | |
static bool | type_paths_collect_by_address_cb (void *user, ut64 k, const void *v) |
RZ_API RZ_OWN RzList * | rz_analysis_type_paths_by_address (RzAnalysis *analysis, ut64 addr) |
Returns the list of all type paths that are linked to some address and have suitable offset. More... | |
RZ_API RZ_BORROW RzType* rz_analysis_type_link_at | ( | RzAnalysis * | analysis, |
ut64 | addr | ||
) |
Returns the RzType linked to the given address.
analysis | RzAnalysis instance |
addr | The address to check the link at |
Definition at line 31 of file typelink.c.
References addr, found, NULL, rz_return_val_if_fail, rz_analysis_t::type_links, and UT64_MAX.
Referenced by rz_core_print_disasm(), and rz_core_types_link_show().
RZ_API bool rz_analysis_type_link_exists | ( | RzAnalysis * | analysis, |
ut64 | addr | ||
) |
Checks if the RzType linked to the given address.
analysis | RzAnalysis instance |
addr | The address to check the link at |
Definition at line 16 of file typelink.c.
References addr, found, rz_return_val_if_fail, rz_analysis_t::type_links, and UT64_MAX.
RZ_API RZ_OWN RzList* rz_analysis_type_links | ( | RzAnalysis * | analysis | ) |
Returns the list of all linked types.
analysis | RzAnalysis instance |
Definition at line 96 of file typelink.c.
References NULL, rz_list_new(), rz_return_val_if_fail, type_collect_cb(), rz_analysis_t::type_links, and types.
RZ_API RZ_OWN RzList* rz_analysis_type_links_by_offset | ( | RzAnalysis * | analysis, |
ut64 | offset | ||
) |
Returns the list of all structured types that are linked and have members matching the offset.
analysis | RzAnalysis instance |
offset | The offset of the member to match against |
Definition at line 142 of file typelink.c.
References NULL, rz_list_new(), rz_return_val_if_fail, rz_analysis_t::type_links, type_paths_collect_by_offset_cb(), TListMeta::typedb, rz_analysis_t::typedb, and UT64_MAX.
RZ_API RZ_OWN RzList* rz_analysis_type_paths_by_address | ( | RzAnalysis * | analysis, |
ut64 | addr | ||
) |
Returns the list of all type paths that are linked to some address and have suitable offset.
analysis | RzAnalysis instance |
addr | The address to check against possible matches |
Definition at line 201 of file typelink.c.
References addr, NULL, rz_list_new(), rz_return_val_if_fail, rz_analysis_t::type_links, type_paths_collect_by_address_cb(), TListMeta::typedb, rz_analysis_t::typedb, and UT64_MAX.
Referenced by resolve_type_links(), and set_offset_hint().
Links the given RzType to the address.
analysis | RzAnalysis instance |
type | RzType to link |
addr | The address to add the type link |
Definition at line 51 of file typelink.c.
References addr, rz_return_val_if_fail, type, and rz_analysis_t::type_links.
Referenced by rz_core_types_link().
RZ_API bool rz_analysis_type_unlink | ( | RzAnalysis * | analysis, |
ut64 | addr | ||
) |
Removes the type link given the address.
analysis | RzAnalysis instance |
addr | The address to remove the type link from |
Definition at line 63 of file typelink.c.
References addr, rz_return_val_if_fail, and rz_analysis_t::type_links.
Referenced by rz_type_link_del_handler().
RZ_API bool rz_analysis_type_unlink_all | ( | RzAnalysis * | analysis | ) |
Removes all type links.
analysis | RzAnalysis instance |
Definition at line 74 of file typelink.c.
References rz_return_val_if_fail, and rz_analysis_t::type_links.
Referenced by rz_type_link_del_all_handler().
Definition at line 84 of file typelink.c.
References rz_list_append(), rz_return_val_if_fail, and v.
Referenced by rz_analysis_type_links().
Definition at line 159 of file typelink.c.
References TListMeta::addr, rz_type_t::identifier, k, rz_base_type_t::kind, rz_type_t::kind, TListMeta::l, list(), RZ_BASE_TYPE_KIND_STRUCT, RZ_BASE_TYPE_KIND_UNION, rz_list_join(), rz_return_val_if_fail, rz_type_db_get_base_type(), RZ_TYPE_KIND_IDENTIFIER, rz_type_path_by_offset(), st64, TListMeta::typedb, and v.
Referenced by rz_analysis_type_paths_by_address().
Definition at line 111 of file typelink.c.
References rz_type_t::identifier, rz_base_type_t::kind, rz_type_t::kind, TListMeta::l, list(), TListMeta::offset, RZ_BASE_TYPE_KIND_STRUCT, RZ_BASE_TYPE_KIND_UNION, rz_list_join(), rz_return_val_if_fail, rz_type_db_get_base_type(), RZ_TYPE_KIND_IDENTIFIER, rz_type_path_by_offset(), TListMeta::typedb, and v.
Referenced by rz_analysis_type_links_by_offset().