Rizin
unix-like reverse engineering framework and cli tools
rtti.c
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: 2009-2018 pancake <pancake@nopcode.org>
2 // SPDX-FileCopyrightText: 2009-2018 maijin <maijin21@gmail.com>
3 // SPDX-FileCopyrightText: 2009-2018 thestr4ng3r <info@florianmaerkl.de>
4 // SPDX-License-Identifier: LGPL-3.0-only
5 
6 #include "rz_analysis.h"
7 
9  RVTableContext context;
11  if (context.abi == RZ_ANALYSIS_CPP_ABI_MSVC) {
13  }
15 }
16 
18  bool use_json = mode == RZ_OUTPUT_MODE_JSON;
19  if (use_json) {
20  rz_cons_print("[");
21  }
22 
23  RVTableContext context;
25  if (context.abi == RZ_ANALYSIS_CPP_ABI_MSVC) {
27  } else {
29  }
30 
31  if (use_json) {
32  rz_cons_print("]\n");
33  }
34 }
35 
37  RVTableContext context;
39 
40  bool use_json = mode == RZ_OUTPUT_MODE_JSON;
41  if (use_json) {
42  rz_cons_print("[");
43  }
44 
47  RzListIter *vtableIter;
48  RVTableInfo *table;
49 
50  if (vtables) {
51  bool comma = false;
52  bool success = false;
53  rz_list_foreach (vtables, vtableIter, table) {
54  if (rz_cons_is_breaked()) {
55  break;
56  }
57  if (use_json && success) {
58  rz_cons_print(",");
59  comma = true;
60  }
61  if (context.abi == RZ_ANALYSIS_CPP_ABI_MSVC) {
62  success = rz_analysis_rtti_msvc_print_at_vtable(&context, table->saddr, mode, true);
63  } else {
64  success = rz_analysis_rtti_itanium_print_at_vtable(&context, table->saddr, mode);
65  }
66  if (success) {
67  comma = false;
68  if (!use_json) {
69  rz_cons_print("\n");
70  }
71  }
72  }
73  if (use_json && !success && comma) {
74  // drop last comma if necessary
75  rz_cons_drop(1);
76  }
77  }
78  rz_list_free(vtables);
79 
80  if (use_json) {
81  rz_cons_print("]\n");
82  }
83 
85 }
86 
88  RVTableContext context;
90 
93  if (vtables) {
94  if (context.abi == RZ_ANALYSIS_CPP_ABI_MSVC) {
96  } else {
98  }
99  }
100  rz_list_free(vtables);
102 }
RZ_API bool rz_cons_drop(int n)
Definition: cons.c:1891
RZ_API void rz_cons_break_pop(void)
Definition: cons.c:361
RZ_API void rz_cons_break_push(RzConsBreak cb, void *user)
Definition: cons.c:357
RZ_API bool rz_cons_is_breaked(void)
Definition: cons.c:373
#define RZ_API
#define NULL
Definition: cris-opc.c:27
const char int mode
Definition: ioapi.h:137
RZ_API void rz_list_free(RZ_NONNULL RzList *list)
Empties the list and frees the list pointer.
Definition: list.c:137
RZ_API char * rz_analysis_rtti_demangle_class_name(RzAnalysis *analysis, const char *name)
Definition: rtti.c:8
RZ_API void rz_analysis_rtti_print_at_vtable(RzAnalysis *analysis, ut64 addr, RzOutputMode mode)
Definition: rtti.c:17
RZ_API void rz_analysis_rtti_print_all(RzAnalysis *analysis, RzOutputMode mode)
Definition: rtti.c:36
RZ_API void rz_analysis_rtti_recover_all(RzAnalysis *analysis)
Definition: rtti.c:87
RZ_API void rz_analysis_rtti_itanium_recover_all(RVTableContext *context, RzList *vtables)
Definition: rtti_itanium.c:860
RZ_API char * rz_analysis_rtti_itanium_demangle_class_name(RVTableContext *context, const char *name)
Definition: rtti_itanium.c:743
RZ_API bool rz_analysis_rtti_itanium_print_at_vtable(RVTableContext *context, ut64 addr, RzOutputMode mode)
Definition: rtti_itanium.c:700
RZ_API void rz_analysis_rtti_msvc_recover_all(RVTableContext *vt_context, RzList *vtables)
Definition: rtti_msvc.c:966
RZ_API char * rz_analysis_rtti_msvc_demangle_class_name(RVTableContext *context, const char *name)
Definition: rtti_msvc.c:393
RZ_API bool rz_analysis_rtti_msvc_print_at_vtable(RVTableContext *context, ut64 addr, RzOutputMode mode, bool strict)
Definition: rtti_msvc.c:617
@ RZ_ANALYSIS_CPP_ABI_MSVC
Definition: rz_analysis.h:543
RzOutputMode
Enum to describe the way data are printed.
Definition: rz_types.h:38
@ RZ_OUTPUT_MODE_JSON
Definition: rz_types.h:40
Definition: z80asm.h:102
RZ_API RzList * rz_analysis_vtable_search(RVTableContext *context)
Definition: vtable.c:219
RZ_API bool rz_analysis_vtable_begin(RzAnalysis *analysis, RVTableContext *context)
Definition: vtable.c:41
ut64(WINAPI *w32_GetEnabledXStateFeatures)()
static int comma
Definition: z80asm.c:76
static int addr
Definition: z80asm.c:58