IDA C++ SDK 9.2
Loading...
Searching...
No Matches
gdl.hpp
Go to the documentation of this file.
1/*
2 * Interactive disassembler (IDA).
3 * Copyright (c) 1990-2026 Hex-Rays
4 * ALL RIGHTS RESERVED.
5 *
6 *
7 * Graph drawing support
8 *
9 */
10
11#ifndef __GDLDRAW_HPP
12#define __GDLDRAW_HPP
13
14#include <funcs.hpp>
15
21
22//-------------------------------------------------------------------------
23// forward declarations:
24class node_iterator;
25class qflow_chart_t;
27class gdl_graph_t;
28
41
42#ifndef SWIG
43#define DECLARE_HELPER(decl) \
44decl node_iterator *ida_export node_iterator_goup(node_iterator *); \
45decl void ida_export create_qflow_chart(qflow_chart_t &); \
46decl bool ida_export append_to_flowchart(qflow_chart_t &, ea_t, ea_t); \
47decl fc_block_type_t ida_export fc_calc_block_type(const qflow_chart_t &, size_t); \
48decl bool ida_export create_multirange_qflow_chart(qflow_chart_t &, const rangevec_t &);
49
50#define DECLARE_FC_HELPER(decl) \
51decl void ida_export create_func_flow_chart(qflow_chart_ea_t &); \
52decl bool ida_export append_to_func_flow_chart(qflow_chart_ea_t &, ea_t, ea_t); \
53decl fc_block_type_t ida_export fc_calc_func_block_type(const qflow_chart_ea_t &, size_t); \
54decl bool ida_export create_multirange_func_flow_chart(qflow_chart_ea_t &, const rangevec_t &);
55#else
56#define DECLARE_HELPER(decl)
57#define DECLARE_FC_HELPER(decl)
58#endif // SWIG
59
60DECLARE_HELPER(idaman)
61DECLARE_FC_HELPER(idaman)
62
63//-------------------------------------------------------------------------
65class intset_t : public std::set<int>
66{
67public:
68 DEFINE_MEMORY_ALLOCATION_FUNCS()
69 size_t idaapi print(char *buf, size_t bufsize) const;
70 const char *idaapi dstr(void) const;
71 bool has(int value) const
72 {
73 const_iterator p = find(value);
74 const_iterator q = end();
75 return p != q;
76 }
77};
78
80
82class intmap_t : public std::map<int, int>
83{
84public:
86 size_t idaapi print(char *buf, size_t bufsize) const;
87 const char *idaapi dstr(void) const;
88};
89
91
92//-------------------------------------------------------------------------
94struct edge_t
95{
96 int src = 0;
97 int dst = 0;
98 edge_t(int x=0, int y=0) : src(x), dst(y) {}
99 bool operator < (const edge_t &y) const
100 { return src < y.src || (src == y.src && dst < y.dst); }
101 bool operator == (const edge_t &y) const
102 { return src == y.src && dst == y.dst; }
103 bool operator != (const edge_t &y) const
104 { return src != y.src || dst != y.dst; }
105};
107
108struct edgevec_t : public qvector<edge_t>
109{
110};
111
112
113struct edgeset_t;
114struct edge_segs_vec_t;
115struct edge_infos_t;
116struct destset_t;
117
119{
125 EDGE_SUBGRAPH = 5 // edge of a subgraph (used in collapse)
126};
127
128//-------------------------------------------------------------------------
130class node_set_t : public intset_t
131{
132public:
133 idaapi node_set_t(void) {}
134 idaapi node_set_t(int node) { insert(node); }
135 idaapi node_set_t(const gdl_graph_t *g);
136 bool idaapi add(int node) { return insert(node).second; }
137 void idaapi sub(int node) { erase(node); }
138 void idaapi sub(const node_set_t &r);
139 void idaapi add(const node_set_t &r);
140 void idaapi intersect(const node_set_t &r);
141 void idaapi extract(intvec_t &out) const;
142 int idaapi first(void) const { return empty() ? -1 : *begin(); }
143};
144
146
147//-------------------------------------------------------------------------
152{
153 intvec_t node_by_order;
154 intvec_t order_by_node;
155
156 void ensure_order_by_node()
157 {
158 if ( order_by_node.empty() )
159 {
160 size_t n = size();
161 order_by_node.resize(n, -1);
162 for ( size_t i = 0; i < n; i++ )
163 {
164 int idx = node_by_order[i];
165 if ( idx != -1 )
166 order_by_node[idx] = int(i);
167 }
168 }
169 }
170
171public:
173 void idaapi clear(void)
174 {
175 node_by_order.clear();
176 order_by_node.clear();
177 }
178
179 void idaapi resize(int n)
180 {
181 clear();
182 if ( n >= 0 )
183 node_by_order.resize(n, -1);
184 }
185
186 size_t idaapi size(void) const
187 {
188 return node_by_order.size();
189 }
190
191 void idaapi set(int _node, int num)
192 {
193 ensure_order_by_node();
194 if ( num >= 0 && num < node_by_order.size()
195 && _node >= 0 && _node < order_by_node.size() )
196 {
197 node_by_order[num] = _node;
198 order_by_node[_node] = num;
199 }
200 }
201
202 bool idaapi clr(int _node)
203 {
204 if ( _node < 0 )
205 return false;
206 ensure_order_by_node();
207 if ( _node >= order_by_node.size() )
208 return false;
209 int old = order_by_node[_node];
210 if ( old < 0 || old >= node_by_order.size() )
211 return false;
212 order_by_node[_node] = -1;
213 node_by_order[old] = -1;
214 // shift all order numbers higher than the deleted order number by one
215 size_t n = size();
216 for ( size_t i = 0; i < n; i++ )
217 if ( order_by_node[i] > old )
218 order_by_node[i]--;
219 int rest = int(n - old - 1);
220 if ( rest > 0 )
221 memmove(&node_by_order[old], &node_by_order[old+1], rest*sizeof(int));
222 return true;
223 }
224
225 int idaapi node(size_t _order) const
226 {
227 return _order < node_by_order.size() ? node_by_order[_order] : -1;
228 }
229
230 int idaapi order(int _node)
231 {
232 ensure_order_by_node();
233 return (_node >= 0 && _node < order_by_node.size()) ? order_by_node[_node] : -1;
234 }
235};
236
237//-------------------------------------------------------------------------
240{
241 DECLARE_HELPER(friend)
242 friend class gdl_graph_t;
243 friend struct kdata_t;
244 const gdl_graph_t *g;
245 int i;
246 node_iterator &_goup(void);
247 node_iterator &goup(void) { return *node_iterator_goup(this); }
248public:
249 node_iterator(const gdl_graph_t *_g, int n) : g(_g), i(n) {}
250 node_iterator &operator++(void) { i++; return goup(); }
251 bool operator==(const node_iterator &n) const { return i == n.i && g == n.g; }
252 bool operator!=(const node_iterator &n) const { return !(*this == n); }
253 int operator*(void) const { return i; }
254};
255
256//-------------------------------------------------------------------------
259{
260 // does a path from 'm' to 'n' exist?
261 bool idaapi path(node_set_t &visited, int m, int n) const;
262public:
265 virtual char *idaapi get_node_label(char *iobuf, int iobufsize, int n) const { qnotused(iobufsize); qnotused(n); iobuf[0] = '\0'; return iobuf; }
266 virtual void idaapi print_graph_attributes(FILE *fp) const { qnotused(fp); }
267 virtual bool idaapi print_node(FILE *fp, int n) const { qnotused(fp); qnotused(n); return false; }
268 virtual bool idaapi print_edge(FILE *fp, int i, int j) const { qnotused(fp); qnotused(i); qnotused(j); return false; }
269 virtual void idaapi print_node_attributes(FILE *fp, int n) const { qnotused(fp); qnotused(n); }
270 virtual int idaapi size(void) const = 0; // number of the max node number
271 virtual int idaapi node_qty(void) const { return size(); } // number of alive nodes
272 virtual bool idaapi exists(int node) const { qnotused(node); return true; }
273 virtual int idaapi entry(void) const { return 0; }
274 virtual int idaapi exit(void) const { return size()-1; }
275 virtual int idaapi nsucc(int node) const = 0;
276 virtual int idaapi npred(int node) const = 0;
277 virtual int idaapi succ(int node, int i) const = 0;
278 virtual int idaapi pred(int node, int i) const = 0;
279 virtual bool idaapi empty(void) const { return node_qty() == 0; }
280 virtual bgcolor_t idaapi get_node_color(int n) const { qnotused(n); return DEFCOLOR; }
281 virtual bgcolor_t idaapi get_edge_color(int i, int j) const { qnotused(i); qnotused(j); return DEFCOLOR; }
282 void idaapi gen_gdl(FILE *fp) const;
283 void idaapi gen_gdl(const char *file) const;
284 size_t idaapi nedge(int node, bool ispred) const { return ispred ? npred(node) : nsucc(node); }
285 int idaapi edge(int node, int i, bool ispred) const { return ispred ? pred(node, i) : succ(node, i); }
286 int idaapi front(void) { return *begin(); }
287 node_iterator idaapi begin(void) const { return node_iterator(this, 0).goup(); }
288 node_iterator idaapi end(void) const { return node_iterator(this, size()); }
289 // does a path from 'm' to 'n' exist?
290 bool idaapi path_exists(int m, int n) const { node_set_t v; return path(v, m, n); }
291
292 void idaapi gen_dot(FILE *fp) const;
293 void idaapi gen_dot(const char *file) const;
294};
295
296
298
299idaman void ida_export gen_gdl(const gdl_graph_t *g, const char *fname);
300
301
308
309idaman int ida_export display_gdl(const char *fname);
310
311
312//-------------------------------------------------------------------------
313// Build and display program graphs
314
325
326idaman DEPRECATED bool ida_export gen_flow_graph(
327 const char *filename,
328 const char *title,
329 func_t *pfn,
330 ea_t ea1,
331 ea_t ea2,
332 int gflags);
333
343
344idaman bool ida_export gen_flow_graph_ea(
345 const char *filename,
346 const char *title,
347 ea_t func_ea,
348 ea_t ea1,
349 ea_t ea2,
350 int gflags);
351
359#define CHART_PRINT_NAMES 0x1000
360#define CHART_GEN_DOT 0x2000
361#define CHART_GEN_GDL 0x4000
362#define CHART_WINGRAPH 0x8000
364
365
374
375idaman bool ida_export gen_simple_call_chart(
376 const char *filename,
377 const char *wait,
378 const char *title,
379 int gflags);
380
381
392
393idaman bool ida_export gen_complex_call_chart(
394 const char *filename,
395 const char *wait,
396 const char *title,
397 ea_t ea1,
398 ea_t ea2,
399 int flags,
400 int32 recursion_depth=-1);
401
405#define CHART_NOLIBFUNCS 0x0400
406#define CHART_REFERENCING 0x0001
407#define CHART_REFERENCED 0x0002
408#define CHART_RECURSIVE 0x0004
409#define CHART_FOLLOW_DIRECTION 0x0008
410#define CHART_IGNORE_XTRN 0x0010
411#define CHART_IGNORE_DATA_BSS 0x0020
412#define CHART_IGNORE_LIB_TO 0x0040
413#define CHART_IGNORE_LIB_FROM 0x0080
414#define CHART_PRINT_COMMENTS 0x0100
415#define CHART_PRINT_DOTS 0x0200
417
418
422
423idaman void ida_export setup_graph_subsystem(const char *_grapher, bgcolor_t (idaapi *get_graph_color)(int color));
424
425
427{
428public:
429 mutable bool cancelled = false;
430 char padding[3]; // make the class nicely aligned. otherwise we have
431 // problems with gcc in qflow_chart_t.
433 bool idaapi check_cancel(void) const;
434};
435
436//--------------------------------------------------------------------------
443
445inline THREAD_SAFE bool is_noret_block(fc_block_type_t btype)
446{
447 return btype == fcb_noret || btype == fcb_enoret;
448}
449
451inline THREAD_SAFE bool is_ret_block(fc_block_type_t btype)
452{
453 return btype == fcb_ret || btype == fcb_cndret;
454}
455
459#define FC_PRINT 0x0001
460#define FC_NOEXT 0x0002
464#define FC_RESERVED 0x0004
465#define FC_APPND 0x0008
466#define FC_CHKBREAK 0x0010
467#define FC_CALL_ENDS 0x0020
468#define FC_NOPREDS 0x0040
469#define FC_OUTLINES 0x0080
471
474{
475public:
478 qstring title;
480 func_t *pfn = nullptr;
481 int flags = 0;
483 int nproper = 0;
484
485 idaapi qflow_chart_t(void) {}
486 idaapi qflow_chart_t(const char *_title, func_t *_pfn, ea_t _ea1, ea_t _ea2, int _flags)
487 : title(_title), bounds(_ea1, _ea2), pfn(_pfn), flags(_flags)
488 {
489 refresh();
490 }
491 virtual ~qflow_chart_t() {}
492 void idaapi create(const char *_title, func_t *_pfn, ea_t _ea1, ea_t _ea2, int _flags)
493 {
494 title = _title;
495 pfn = _pfn;
496 bounds = range_t(_ea1, _ea2);
497 flags = _flags;
498 refresh();
499 }
500 void idaapi create(const char *_title, const rangevec_t &ranges, int _flags)
501 {
502 title = _title;
503 flags = _flags;
504 create_multirange_qflow_chart(*this, ranges);
505 }
506 void idaapi append_to_flowchart(ea_t ea1, ea_t ea2) { ::append_to_flowchart(*this, ea1, ea2); }
507 void idaapi refresh(void) { create_qflow_chart(*this); }
508 fc_block_type_t calc_block_type(size_t blknum) const
509 { return fc_calc_block_type(*this, blknum); }
510 bool is_ret_block(size_t blknum) const { return ::is_ret_block(calc_block_type(blknum)); }
511 bool is_noret_block(size_t blknum) const { return ::is_noret_block(calc_block_type(blknum)); }
512 virtual void idaapi print_node_attributes(FILE *fp, int n) const override { qnotused(fp); qnotused(n); }
513 virtual int idaapi nsucc(int node) const override { return int(blocks[node].succ.size()); }
514 virtual int idaapi npred(int node) const override { return int(blocks[node].pred.size()); }
515 virtual int idaapi succ(int node, int i) const override { return blocks[node].succ[i]; }
516 virtual int idaapi pred(int node, int i) const override { return blocks[node].pred[i]; }
517 virtual char *idaapi get_node_label(char *iobuf, int iobufsize, int n) const override { qnotused(iobuf); qnotused(iobufsize); qnotused(n); return nullptr; }
518 virtual int idaapi size(void) const override { return int(blocks.size()); }
519 bool idaapi print_names(void) const { return (flags & FC_PRINT) != 0; }
520};
521
527{
528public:
531 qstring title;
533 ea_t func_ea = BADADDR;
534 int flags = 0;
536 int nproper = 0;
537
538 idaapi qflow_chart_ea_t(void) {}
540 const char *_title,
541 ea_t _func_ea,
542 ea_t _ea1,
543 ea_t _ea2,
544 int _flags)
545 : title(_title), bounds(_ea1, _ea2), func_ea(_func_ea), flags(_flags)
546 {
547 refresh();
548 }
549 virtual ~qflow_chart_ea_t() {}
550 void idaapi create(
551 const char *_title,
552 ea_t _func_ea,
553 ea_t _ea1,
554 ea_t _ea2,
555 int _flags)
556 {
557 title = _title;
558 func_ea = _func_ea;
559 bounds = range_t(_ea1, _ea2);
560 flags = _flags;
561 refresh();
562 }
563 void idaapi create(const char *_title, const rangevec_t &ranges, int _flags)
564 {
565 title = _title;
566 func_ea = BADADDR;
567 flags = _flags;
568 create_multirange_func_flow_chart(*this, ranges);
569 }
570 void idaapi append_to_flowchart(ea_t ea1, ea_t ea2) { ::append_to_func_flow_chart(*this, ea1, ea2); }
571 void idaapi refresh(void) { create_func_flow_chart(*this); }
572 fc_block_type_t calc_block_type(size_t blknum) const
573 { return fc_calc_func_block_type(*this, blknum); }
574 bool is_ret_block(size_t blknum) const { return ::is_ret_block(calc_block_type(blknum)); }
575 bool is_noret_block(size_t blknum) const { return ::is_noret_block(calc_block_type(blknum)); }
576 virtual void idaapi print_node_attributes(FILE *fp, int n) const override { qnotused(fp); qnotused(n); }
577 virtual int idaapi nsucc(int node) const override { return int(blocks[node].succ.size()); }
578 virtual int idaapi npred(int node) const override { return int(blocks[node].pred.size()); }
579 virtual int idaapi succ(int node, int i) const override { return blocks[node].succ[i]; }
580 virtual int idaapi pred(int node, int i) const override { return blocks[node].pred[i]; }
581 virtual char *idaapi get_node_label(char *iobuf, int iobufsize, int n) const override { qnotused(iobuf); qnotused(iobufsize); qnotused(n); return nullptr; }
582 virtual int idaapi size(void) const override { return int(blocks.size()); }
583 bool idaapi print_names(void) const { return (flags & FC_PRINT) != 0; }
584};
585
586#endif // __GDLDRAW_HPP
Definition gdl.hpp:427
bool cancelled
Definition gdl.hpp:429
char padding[3]
Definition gdl.hpp:430
bool idaapi check_cancel(void) const
virtual ~cancellable_graph_t()
Definition gdl.hpp:432
A function is a set of continuous ranges of addresses with characteristics.
Definition funcs.hpp:106
gdl graph interface - includes only functions required to draw it
Definition gdl.hpp:259
virtual int idaapi npred(int node) const =0
void idaapi gen_gdl(const char *file) const
int idaapi edge(int node, int i, bool ispred) const
Definition gdl.hpp:285
size_t idaapi nedge(int node, bool ispred) const
Definition gdl.hpp:284
virtual bool idaapi exists(int node) const
Definition gdl.hpp:272
virtual void idaapi print_graph_attributes(FILE *fp) const
Definition gdl.hpp:266
virtual int idaapi pred(int node, int i) const =0
virtual char *idaapi get_node_label(char *iobuf, int iobufsize, int n) const
Definition gdl.hpp:265
virtual bool idaapi print_edge(FILE *fp, int i, int j) const
Definition gdl.hpp:268
virtual int idaapi exit(void) const
Definition gdl.hpp:274
node_iterator idaapi end(void) const
Definition gdl.hpp:288
virtual int idaapi node_qty(void) const
Definition gdl.hpp:271
void idaapi gen_dot(const char *file) const
virtual int idaapi nsucc(int node) const =0
virtual void idaapi print_node_attributes(FILE *fp, int n) const
Definition gdl.hpp:269
virtual bool idaapi print_node(FILE *fp, int n) const
Definition gdl.hpp:267
virtual int idaapi succ(int node, int i) const =0
DEFINE_MEMORY_ALLOCATION_FUNCS() virtual ~gdl_graph_t()
Definition gdl.hpp:263
void idaapi gen_dot(FILE *fp) const
virtual int idaapi size(void) const =0
virtual int idaapi entry(void) const
Definition gdl.hpp:273
virtual bgcolor_t idaapi get_edge_color(int i, int j) const
Definition gdl.hpp:281
bool idaapi path_exists(int m, int n) const
Definition gdl.hpp:290
virtual bgcolor_t idaapi get_node_color(int n) const
Definition gdl.hpp:280
node_iterator idaapi begin(void) const
Definition gdl.hpp:287
int idaapi front(void)
Definition gdl.hpp:286
virtual bool idaapi empty(void) const
Definition gdl.hpp:279
void idaapi gen_gdl(FILE *fp) const
Map of integer constants to integer constants.
Definition gdl.hpp:83
DEFINE_MEMORY_ALLOCATION_FUNCS() size_t idaapi print(char *buf
size_t bufsize const
Definition gdl.hpp:86
const char *idaapi dstr(void) const
Node iterator (used to draw graphs)
Definition gdl.hpp:240
node_iterator(const gdl_graph_t *_g, int n)
Definition gdl.hpp:249
bool operator==(const node_iterator &n) const
Definition gdl.hpp:251
node_iterator & operator++(void)
Definition gdl.hpp:250
int operator*(void) const
Definition gdl.hpp:253
friend struct kdata_t
Definition gdl.hpp:243
bool operator!=(const node_iterator &n) const
Definition gdl.hpp:252
Node ordering in a graph.
Definition gdl.hpp:152
bool idaapi clr(int _node)
Definition gdl.hpp:202
size_t idaapi size(void) const
Definition gdl.hpp:186
void idaapi resize(int n)
Definition gdl.hpp:179
int idaapi order(int _node)
Definition gdl.hpp:230
void idaapi set(int _node, int num)
Definition gdl.hpp:191
int idaapi node(size_t _order) const
Definition gdl.hpp:225
DEFINE_MEMORY_ALLOCATION_FUNCS() void idaapi clear(void)
Definition gdl.hpp:172
Set of graph nodes.
Definition gdl.hpp:131
bool idaapi add(int node)
Definition gdl.hpp:136
void idaapi sub(int node)
Definition gdl.hpp:137
int idaapi first(void) const
Definition gdl.hpp:142
idaapi node_set_t(void)
Definition gdl.hpp:133
void idaapi extract(intvec_t &out) const
void idaapi sub(const node_set_t &r)
idaapi node_set_t(const gdl_graph_t *g)
idaapi node_set_t(int node)
Definition gdl.hpp:134
void idaapi intersect(const node_set_t &r)
void idaapi add(const node_set_t &r)
A flow chart for a function (ea-based, no func_t pointers).
Definition gdl.hpp:527
bool idaapi print_names(void) const
Definition gdl.hpp:583
ea_t func_ea
start address of the function (BADADDR for range-based charts)
Definition gdl.hpp:533
int flags
flags. See Flow chart flags
Definition gdl.hpp:534
virtual int idaapi nsucc(int node) const override
Definition gdl.hpp:577
DECLARE_FC_HELPER(friend) qstring title
range_t bounds
overall bounds of the qflow_chart_ea_t instance
Definition gdl.hpp:532
bool is_noret_block(size_t blknum) const
Definition gdl.hpp:575
idaapi qflow_chart_ea_t(const char *_title, ea_t _func_ea, ea_t _ea1, ea_t _ea2, int _flags)
Definition gdl.hpp:539
bool is_ret_block(size_t blknum) const
Definition gdl.hpp:574
void idaapi create(const char *_title, const rangevec_t &ranges, int _flags)
Definition gdl.hpp:563
virtual int idaapi succ(int node, int i) const override
Definition gdl.hpp:579
blocks_t blocks
basic blocks
Definition gdl.hpp:535
virtual char *idaapi get_node_label(char *iobuf, int iobufsize, int n) const override
Definition gdl.hpp:581
virtual int idaapi size(void) const override
Definition gdl.hpp:582
idaapi qflow_chart_ea_t(void)
Definition gdl.hpp:538
void idaapi refresh(void)
Definition gdl.hpp:571
void idaapi append_to_flowchart(ea_t ea1, ea_t ea2)
Definition gdl.hpp:570
virtual ~qflow_chart_ea_t()
Definition gdl.hpp:549
virtual int idaapi pred(int node, int i) const override
Definition gdl.hpp:580
int nproper
number of basic blocks belonging to the specified range
Definition gdl.hpp:536
virtual int idaapi npred(int node) const override
Definition gdl.hpp:578
fc_block_type_t calc_block_type(size_t blknum) const
Definition gdl.hpp:572
qvector< qbasic_block_t > blocks_t
Definition gdl.hpp:529
virtual void idaapi print_node_attributes(FILE *fp, int n) const override
Definition gdl.hpp:576
void idaapi create(const char *_title, ea_t _func_ea, ea_t _ea1, ea_t _ea2, int _flags)
Definition gdl.hpp:550
Definition gdl.hpp:474
void idaapi create(const char *_title, const rangevec_t &ranges, int _flags)
Definition gdl.hpp:500
idaapi qflow_chart_t(const char *_title, func_t *_pfn, ea_t _ea1, ea_t _ea2, int _flags)
Definition gdl.hpp:486
virtual void idaapi print_node_attributes(FILE *fp, int n) const override
Definition gdl.hpp:512
bool is_ret_block(size_t blknum) const
Definition gdl.hpp:510
virtual char *idaapi get_node_label(char *iobuf, int iobufsize, int n) const override
Definition gdl.hpp:517
idaapi qflow_chart_t(void)
Definition gdl.hpp:485
range_t bounds
overall bounds of the qflow_chart_t instance
Definition gdl.hpp:479
virtual int idaapi nsucc(int node) const override
Definition gdl.hpp:513
virtual int idaapi pred(int node, int i) const override
Definition gdl.hpp:516
virtual int idaapi succ(int node, int i) const override
Definition gdl.hpp:515
blocks_t blocks
basic blocks
Definition gdl.hpp:482
void idaapi create(const char *_title, func_t *_pfn, ea_t _ea1, ea_t _ea2, int _flags)
Definition gdl.hpp:492
virtual ~qflow_chart_t()
Definition gdl.hpp:491
func_t * pfn
the function this instance was built upon
Definition gdl.hpp:480
fc_block_type_t calc_block_type(size_t blknum) const
Definition gdl.hpp:508
void idaapi refresh(void)
Definition gdl.hpp:507
bool idaapi print_names(void) const
Definition gdl.hpp:519
DECLARE_HELPER(friend) qstring title
int flags
flags. See Flow chart flags
Definition gdl.hpp:481
bool is_noret_block(size_t blknum) const
Definition gdl.hpp:511
qvector< qbasic_block_t > blocks_t
Definition gdl.hpp:476
virtual int idaapi npred(int node) const override
Definition gdl.hpp:514
void idaapi append_to_flowchart(ea_t ea1, ea_t ea2)
Definition gdl.hpp:506
virtual int idaapi size(void) const override
Definition gdl.hpp:518
int nproper
number of basic blocks belonging to the specified range
Definition gdl.hpp:483
Reimplementation of vector class from STL.
Definition pro.h:2262
qvector(void)
Definition pro.h:2374
Routines for working with functions within the disassembled program.
DECLARE_HELPER(idaman) DECLARE_FC_HELPER(idaman) class intset_t typedef qvector< intvec_t > array_of_intvec_t
Set of integer constants.
Definition gdl.hpp:60
THREAD_SAFE bool is_noret_block(fc_block_type_t btype)
Does this block never return?
Definition gdl.hpp:445
idaman DEPRECATED bool ida_export gen_flow_graph(const char *filename, const char *title, func_t *pfn, ea_t ea1, ea_t ea2, int gflags)
Build and display a flow graph.
idaman void ida_export gen_gdl(const gdl_graph_t *g, const char *fname)
Create GDL file for graph.
qvector< node_set_t > array_of_node_set_t
Definition gdl.hpp:145
idaman bool ida_export gen_simple_call_chart(const char *filename, const char *wait, const char *title, int gflags)
Build and display a simple function call graph.
DECLARE_TYPE_AS_MOVABLE(edge_t)
idaman int ida_export display_gdl(const char *fname)
Display GDL file by calling wingraph32.
idaman void ida_export setup_graph_subsystem(const char *_grapher, bgcolor_t(idaapi *get_graph_color)(int color))
Setup the user-defined graph colors and graph viewer program.
idaman bool ida_export gen_complex_call_chart(const char *filename, const char *wait, const char *title, ea_t ea1, ea_t ea2, int flags, int32 recursion_depth=-1)
Build and display a complex xref graph.
qvector< intmap_t > array_of_intmap_t
Definition gdl.hpp:90
edge_type_t
Definition gdl.hpp:119
@ EDGE_FORWARD
Definition gdl.hpp:122
@ EDGE_NONE
Definition gdl.hpp:120
@ EDGE_CROSS
Definition gdl.hpp:124
@ EDGE_SUBGRAPH
Definition gdl.hpp:125
@ EDGE_BACK
Definition gdl.hpp:123
@ EDGE_TREE
Definition gdl.hpp:121
THREAD_SAFE bool is_ret_block(fc_block_type_t btype)
Does this block return?
Definition gdl.hpp:451
idaman bool ida_export gen_flow_graph_ea(const char *filename, const char *title, ea_t func_ea, ea_t ea1, ea_t ea2, int gflags)
Build and display a flow graph (ea-based).
fc_block_type_t
Flow chart block types.
Definition gdl.hpp:31
@ fcb_normal
normal block
Definition gdl.hpp:32
@ fcb_ret
return block
Definition gdl.hpp:34
@ fcb_noret
noreturn block
Definition gdl.hpp:36
@ fcb_enoret
external noreturn block (does not belong to the function)
Definition gdl.hpp:37
@ fcb_cndret
conditional return block
Definition gdl.hpp:35
@ fcb_error
block passes execution past the function end
Definition gdl.hpp:39
@ fcb_indjump
block ends with indirect jump
Definition gdl.hpp:33
@ fcb_extern
external normal block
Definition gdl.hpp:38
idaman const char * end
Definition pro.h:1004
idaman size_t n
Definition pro.h:1000
const char *hexapi dstr(const tinfo_t *tif)
Print the specified type info.
Definition hexrays.hpp:11173
asize_t size
Definition kernwin.hpp:6701
void(idaapi *range_marker)(ea_t ea
Pointer to range marker function (for idaviews and hexviews) This pointer is initialized by setup_ran...
qvector< int > intvec_t
vector of integers
Definition pro.h:2839
uint32 bgcolor_t
background color in RGB
Definition pro.h:5109
uint64 ea_t
Definition pro.h:425
int int32
signed 32 bit value
Definition pro.h:351
idaman size_t bufsize
Definition pro.h:604
_qstring< char > qstring
regular string
Definition pro.h:3771
unsigned int
Definition pronet.h:99
constexpr bool operator<(qpair< F, S > const &a, qpair< F, S > const &b)
Definition qpair.hpp:108
constexpr bool operator!=(qpair< F, S > const &a, qpair< F, S > const &b)
Definition qpair.hpp:103
constexpr bool operator==(qpair< F, S > const &a, qpair< F, S > const &b)
Definition qpair.hpp:98
Edge connecting two graph nodes.
Definition gdl.hpp:95
edge_t(int x=0, int y=0)
Definition gdl.hpp:98
int dst
destination node number
Definition gdl.hpp:97
int src
source node number
Definition gdl.hpp:96
Definition gdl.hpp:109
Information about a basic block of a qflow_chart_t.
Definition gdl.hpp:439
intvec_t pred
list of node predecessors
Definition gdl.hpp:441
intvec_t succ
list of node successors
Definition gdl.hpp:440
Base class for an range.
Definition range.hpp:35
range_t(ea_t ea1=0, ea_t ea2=0)
Definition range.hpp:39
Vector of range_t instances.
Definition range.hpp:93