IDA C++ SDK 9.2
Loading...
Searching...
No Matches
auto.hpp
Go to the documentation of this file.
1/*
2 * Interactive disassembler (IDA).
3 * Copyright (c) 1990-2025 Hex-Rays
4 * ALL RIGHTS RESERVED.
5 *
6 */
7
8#ifndef _AUTO_HPP
9#define _AUTO_HPP
10#include <ida.hpp>
11
30
31typedef int atype_t;
32
36const atype_t
37 AU_NONE = 00,
38 AU_UNK = 10,
39 AU_CODE = 20,
40 AU_WEAK = 25,
41 AU_PROC = 30,
42 AU_TAIL = 35,
44 AU_USED = 40,
45 AU_USD2 = 45,
46 AU_TYPE = 50,
47 AU_LIBF = 60,
48 AU_LBF2 = 70,
49 AU_LBF3 = 80,
50 AU_CHLB = 90,
53
54
55typedef int idastate_t;
56
59const idastate_t
60 // meaning
64 st_Work = 3;
66
67
71
72idaman atype_t ida_export get_auto_state(void);
73
74
78
79idaman atype_t ida_export set_auto_state(atype_t new_state);
80
81
89
91
92idaman bool ida_export get_auto_display(auto_display_t *auto_display);
93
94
98
99idaman void ida_export show_auto(ea_t ea, atype_t type=AU_NONE);
100
101
105
106inline void show_addr(ea_t ea) { show_auto(ea); }
107
108
112
113idaman idastate_t ida_export set_ida_state(idastate_t st);
114
115
118
119inline bool may_create_stkvars(void)
120{
122}
123
124
127
128inline bool may_trace_sp(void)
129{
130 if ( inf_should_trace_sp() )
131 {
132 atype_t auto_state = get_auto_state();
133 return auto_state == AU_USED;
134 }
135 return false;
136}
137
138
142
143idaman void ida_export auto_mark_range(ea_t start, ea_t end, atype_t type);
144
145
147
148inline void auto_mark(ea_t ea, atype_t type)
149{
150 auto_mark_range(ea, ea+1, type);
151}
152
153
157
158idaman void ida_export auto_unmark(ea_t start, ea_t end, atype_t type);
159
160// Convenience functions
161
163inline void plan_ea(ea_t ea)
164{
165 auto_mark(ea, AU_USED);
166}
167
168inline void plan_range(ea_t sEA, ea_t eEA)
169{
170 auto_mark_range(sEA, eEA, AU_USED);
171}
172
173inline void auto_make_code(ea_t ea)
174{
175 auto_mark(ea, AU_CODE);
176}
177
178inline void auto_make_proc(ea_t ea)
179{
180 auto_make_code(ea);
181 auto_mark(ea, AU_PROC);
182}
183
189{
190 atype_t state = get_auto_state();
191 if ( state == AU_USD2 )
192 return false;
193 if ( state == AU_USED )
194 auto_mark(ea, AU_USD2);
195 return true;
196}
197
204
205idaman void ida_export reanalyze_callers(ea_t ea, bool noret);
206
207
209
210idaman void ida_export revert_ida_decisions(ea_t ea1, ea_t ea2);
211
212
214
215idaman void ida_export auto_apply_type(ea_t caller, ea_t callee);
216
221
222idaman void ida_export auto_apply_tail(ea_t tail_ea, ea_t parent_ea);
223
230
231idaman int ida_export plan_and_wait(ea_t ea1, ea_t ea2, bool final_pass=true);
232
233
237
238idaman bool ida_export auto_wait(void);
239
240
244
245idaman ssize_t ida_export auto_wait_range(ea_t ea1, ea_t ea2);
246
247
251
252idaman bool ida_export auto_make_step(ea_t ea1, ea_t ea2);
253
254
259
260idaman void ida_export auto_cancel(ea_t ea1, ea_t ea2);
261
262
265
266idaman bool ida_export auto_is_ok(void);
267
268
272
273idaman ea_t ida_export peek_auto_queue(ea_t low_ea, atype_t type);
274
275
280
281idaman ea_t ida_export auto_get(atype_t *type, ea_t lowEA, ea_t highEA);
282
283
287
288idaman int ida_export auto_recreate_insn(ea_t ea);
289
290
292
293idaman bool ida_export is_auto_enabled(void);
294
295
299
300idaman bool ida_export enable_auto(bool enable);
301
302
303
304#endif // _AUTO_HPP
void auto_make_proc(ea_t ea)
Plan to make code&function.
Definition auto.hpp:178
idaman void ida_export auto_cancel(ea_t ea1, ea_t ea2)
Remove an address range (ea1..ea2) from queues AU_CODE, AU_PROC, AU_USED.
idaman bool ida_export get_auto_display(auto_display_t *auto_display)
Get structure which holds the autoanalysis indicator contents.
void auto_make_code(ea_t ea)
Plan to make code.
Definition auto.hpp:173
idaman ea_t ida_export auto_get(atype_t *type, ea_t lowEA, ea_t highEA)
Retrieve an address from queues regarding their priority.
idaman void ida_export auto_apply_type(ea_t caller, ea_t callee)
Plan to apply the callee's type to the calling point.
idaman bool ida_export auto_make_step(ea_t ea1, ea_t ea2)
Analyze one address in the specified range and return true.
void show_addr(ea_t ea)
Show an address on the autoanalysis indicator.
Definition auto.hpp:106
idaman int ida_export plan_and_wait(ea_t ea1, ea_t ea2, bool final_pass=true)
Analyze the specified range.
void auto_mark(ea_t ea, atype_t type)
Put single address into a queue. Queues keep addresses sorted.
Definition auto.hpp:148
idaman bool ida_export is_auto_enabled(void)
Get autoanalyzer state.
idaman void ida_export auto_apply_tail(ea_t tail_ea, ea_t parent_ea)
Plan to apply the tail_ea chunk to the parent.
void plan_range(ea_t sEA, ea_t eEA)
Plan to perform reanalysis.
Definition auto.hpp:168
idaman int ida_export auto_recreate_insn(ea_t ea)
Try to create instruction.
idaman void ida_export revert_ida_decisions(ea_t ea1, ea_t ea2)
Delete all analysis info that IDA generated for for the given range.
idaman atype_t ida_export set_auto_state(atype_t new_state)
Set current state of autoanalyzer.
idaman bool ida_export auto_wait(void)
Process everything in the queues and return true.
idaman void ida_export auto_mark_range(ea_t start, ea_t end, atype_t type)
Put range of addresses into a queue.
idaman idastate_t ida_export set_ida_state(idastate_t st)
Change IDA status indicator value.
idaman bool ida_export enable_auto(bool enable)
Temporarily enable/disable autoanalyzer.
idaman ssize_t ida_export auto_wait_range(ea_t ea1, ea_t ea2)
Process everything in the specified range and return true.
idaman ea_t ida_export peek_auto_queue(ea_t low_ea, atype_t type)
Peek into a queue 'type' for an address not lower than 'low_ea'.
int idastate_t
IDA status indicator - see Status indicator states.
Definition auto.hpp:55
idaman void ida_export auto_unmark(ea_t start, ea_t end, atype_t type)
Remove range of addresses from a queue.
bool may_trace_sp(void)
Is it allowed to trace stack pointer automatically?
Definition auto.hpp:128
int atype_t
identifies an autoanalysis queue - see Autoanalysis queues
Definition auto.hpp:31
bool auto_postpone_analysis(ea_t ea)
Plan to reanalyze on the second pass The typical usage of this function in emu.cpp is: if ( !...
Definition auto.hpp:188
bool may_create_stkvars(void)
Is it allowed to create stack variables automatically?
Definition auto.hpp:119
idaman atype_t ida_export get_auto_state(void)
Get current state of autoanalyzer.
idaman void ida_export reanalyze_callers(ea_t ea, bool noret)
Plan to reanalyze callers of the specified address.
idaman void ida_export show_auto(ea_t ea, atype_t type=AU_NONE)
Change autoanalysis indicator value.
idaman bool ida_export auto_is_ok(void)
Are all queues empty?
void plan_ea(ea_t ea)
Plan to perform reanalysis.
Definition auto.hpp:163
const atype_t AU_TYPE
8: apply type information
Definition auto.hpp:46
const atype_t AU_USED
6: reanalyze
Definition auto.hpp:44
const atype_t AU_CODE
1: convert to instruction
Definition auto.hpp:39
const atype_t AU_LBF2
10: the same, second pass
Definition auto.hpp:48
const atype_t AU_TAIL
4: add a procedure tail
Definition auto.hpp:42
const atype_t AU_PROC
3: convert to procedure start
Definition auto.hpp:41
const atype_t AU_CHLB
12: load signature file (file name is kept separately)
Definition auto.hpp:50
const atype_t AU_NONE
placeholder, not used
Definition auto.hpp:37
const atype_t AU_WEAK
2: convert to instruction (ida decision)
Definition auto.hpp:40
const atype_t AU_FCHUNK
5: find func chunks
Definition auto.hpp:43
const atype_t AU_UNK
0: convert to unexplored
Definition auto.hpp:38
const atype_t AU_LIBF
9: apply signature to address
Definition auto.hpp:47
const atype_t AU_USD2
7: reanalyze, second pass
Definition auto.hpp:45
const atype_t AU_FINAL
13: final pass
Definition auto.hpp:51
const atype_t AU_LBF3
11: the same, third pass
Definition auto.hpp:49
idaman const char * end
Definition pro.h:1001
const idastate_t st_Ready
READY: IDA is doing nothing.
Definition auto.hpp:61
const idastate_t st_Think
THINKING: Autoanalysis on, the user may press keys.
Definition auto.hpp:62
const idastate_t st_Waiting
WAITING: Waiting for the user input.
Definition auto.hpp:63
const idastate_t st_Work
BUSY: IDA is busy.
Definition auto.hpp:64
const tinfo_t & type
Definition hexrays.hpp:7301
Contains the inf structure definition and some functions common to the whole IDA project.
bool inf_should_create_stkvars(void)
Definition ida.hpp:715
bool inf_should_trace_sp(void)
Definition ida.hpp:721
uint64 ea_t
Definition pro.h:421
ptrdiff_t ssize_t
Signed size_t - used to check for size overflows when the counter becomes negative.
Definition pro.h:381
See get_auto_display.
Definition auto.hpp:84
idastate_t state
Definition auto.hpp:87
atype_t type
Definition auto.hpp:85
ea_t ea
Definition auto.hpp:86