IDA Domain
basic_block.hpp
Go to the documentation of this file.
1 #ifndef IDA_DOMAIN_BLOCK_HPP
2 #define IDA_DOMAIN_BLOCK_HPP
3 
6 
7 #include <vector>
8 #include <memory>
9 #include <ua.hpp>
10 #include <gdl.hpp>
11 
12 #ifndef SWIG
14 {
15 #endif
16  class Database;
17 
20  {
22  const Database &m_database;
23 
25  BasicBlocks() = delete;
26 
27  public:
30  {
32  const Database &m_database;
33 
35  const ea_t m_start_ea;
36 
38  const ea_t m_end_ea;
39 
41  qflow_chart_t m_flowchart;
42 
44  Iterator() = delete;
45 
47  bool create_flowchart();
48 
49  public:
54  Iterator(const Database &database, const ea_t start_ea, const ea_t end_ea)
55  : m_database(database), m_start_ea(start_ea), m_end_ea(end_ea)
56  {
57  }
58 
61  int get_count();
62 
66  qbasic_block_t get_at_index(int index);
67  };
68 
69  public:
72  BasicBlocks(const Database &database) : m_database(database)
73  {
74  }
75 
79  Instructions::Iterator get_instructions(const qbasic_block_t &block) const;
80 
85  Iterator get_between(const ea_t start_ea, const ea_t end_ea) const
86  {
87  return Iterator(m_database, start_ea, end_ea);
88  }
89  };
90 #ifndef SWIG
91 }
92 #endif
93 
94 #endif // IDA_DOMAIN_BLOCK_HPP
Iterator for basic blocks in a function.
Definition: basic_block.hpp:30
Iterator(const Database &database, const ea_t start_ea, const ea_t end_ea)
Constructs a basic block iterator for the specified function.
Definition: basic_block.hpp:54
int get_count()
Retrieves the number of basic blocks in the current range.
qbasic_block_t get_at_index(int index)
Retrieves the basic block at the given index.
Interface for working with basic blocks in functions.
Definition: basic_block.hpp:20
Instructions::Iterator get_instructions(const qbasic_block_t &block) const
Retrieves the instructions within a given basic block.
Iterator get_between(const ea_t start_ea, const ea_t end_ea) const
Retrieves all basic blocks between two addresses.
Definition: basic_block.hpp:85
BasicBlocks(const Database &database)
Constructs a basic block handler for the given database.
Definition: basic_block.hpp:72
Provides access and control over the loaded IDA database.
Definition: database.hpp:25
Iterator for instructions within a specified address range.
Definition: instruction.hpp:27
#define IDA_API
Definition: common_defines.hpp:11
#define ABI_VERSION_NS
Definition: version.hpp:17