IDAPython 9.0
Loading...
Searching...
No Matches
ida_auto Namespace Reference

Detailed Description

Functions that work with the autoanalyzer queue.

The autoanalyzer works when IDA is not busy processing the user keystrokes. It has several queues, each queue having its own priority. The analyzer stops when all queues are empty.
A queue contains addresses or address ranges. The addresses are kept sorted by their values. The analyzer will process all addresses from the first queue, then switch to the second queue and so on. There are no limitations on the size of the queues.
This file also contains functions that deal with the IDA status indicator and the autoanalysis indicator. You may use these functions to change the indicator value. 

Classes

class  auto_display_t
 

Functions

'atype_t' get_auto_state ()
 
'atype_t' set_auto_state ('atype_t' new_state)
 
bool get_auto_display ('auto_display_t' auto_display)
 
None show_auto (*args)
 
None show_addr (ida_idaapi.ea_t ea)
 
'idastate_t' set_ida_state ('idastate_t' st)
 
bool may_create_stkvars ()
 
bool may_trace_sp ()
 
None auto_mark_range (ida_idaapi.ea_t start, ida_idaapi.ea_t end, 'atype_t' type)
 
None auto_mark (ida_idaapi.ea_t ea, 'atype_t' type)
 
None auto_unmark (ida_idaapi.ea_t start, ida_idaapi.ea_t end, 'atype_t' type)
 
None plan_ea (ida_idaapi.ea_t ea)
 
None plan_range (ida_idaapi.ea_t sEA, ida_idaapi.ea_t eEA)
 
None auto_make_code (ida_idaapi.ea_t ea)
 
None auto_make_proc (ida_idaapi.ea_t ea)
 
bool auto_postpone_analysis (ida_idaapi.ea_t ea)
 
None reanalyze_callers (ida_idaapi.ea_t ea, bool noret)
 
None revert_ida_decisions (ida_idaapi.ea_t ea1, ida_idaapi.ea_t ea2)
 
None auto_apply_type (ida_idaapi.ea_t caller, ida_idaapi.ea_t callee)
 
None auto_apply_tail (ida_idaapi.ea_t tail_ea, ida_idaapi.ea_t parent_ea)
 
int plan_and_wait (ida_idaapi.ea_t ea1, ida_idaapi.ea_t ea2, bool final_pass=True)
 
bool auto_wait ()
 
'ssize_t' auto_wait_range (ida_idaapi.ea_t ea1, ida_idaapi.ea_t ea2)
 
bool auto_make_step (ida_idaapi.ea_t ea1, ida_idaapi.ea_t ea2)
 
None auto_cancel (ida_idaapi.ea_t ea1, ida_idaapi.ea_t ea2)
 
bool auto_is_ok ()
 
ida_idaapi.ea_t peek_auto_queue (ida_idaapi.ea_t low_ea, 'atype_t' type)
 
ida_idaapi.ea_t auto_get ('atype_t *' type, ida_idaapi.ea_t lowEA, ida_idaapi.ea_t highEA)
 
int auto_recreate_insn (ida_idaapi.ea_t ea)
 
bool is_auto_enabled ()
 
bool enable_auto (bool enable)
 

Variables

 cvar = _ida_auto.cvar
 
 AU_NONE = cvar.AU_NONE
 
 AU_UNK = cvar.AU_UNK
 
 AU_CODE = cvar.AU_CODE
 
 AU_WEAK = cvar.AU_WEAK
 
 AU_PROC = cvar.AU_PROC
 
 AU_TAIL = cvar.AU_TAIL
 
 AU_FCHUNK = cvar.AU_FCHUNK
 
 AU_USED = cvar.AU_USED
 
 AU_USD2 = cvar.AU_USD2
 
 AU_TYPE = cvar.AU_TYPE
 
 AU_LIBF = cvar.AU_LIBF
 
 AU_LBF2 = cvar.AU_LBF2
 
 AU_LBF3 = cvar.AU_LBF3
 
 AU_CHLB = cvar.AU_CHLB
 
 AU_FINAL = cvar.AU_FINAL
 
 st_Ready = cvar.st_Ready
 
 st_Think = cvar.st_Think
 
 st_Waiting = cvar.st_Waiting
 
 st_Work = cvar.st_Work
 

Function Documentation

◆ auto_apply_tail()

None auto_apply_tail ( ida_idaapi.ea_t tail_ea,
ida_idaapi.ea_t parent_ea )
Plan to apply the tail_ea chunk to the parent 
    
@param tail_ea: linear address of start of tail
@param parent_ea: linear address within parent. If BADADDR, automatically try to find parent via xrefs.

◆ auto_apply_type()

None auto_apply_type ( ida_idaapi.ea_t caller,
ida_idaapi.ea_t callee )
Plan to apply the callee's type to the calling point.

◆ auto_cancel()

None auto_cancel ( ida_idaapi.ea_t ea1,
ida_idaapi.ea_t ea2 )
Remove an address range (ea1..ea2) from queues AU_CODE, AU_PROC, AU_USED. To remove an address range from other queues use auto_unmark() function. 'ea1' may be higher than 'ea2', the kernel will swap them in this case. 'ea2' doesn't belong to the range. 

◆ auto_get()

ida_idaapi.ea_t auto_get ( 'atype_t *' type,
ida_idaapi.ea_t lowEA,
ida_idaapi.ea_t highEA )
Retrieve an address from queues regarding their priority. Returns BADADDR if no addresses not lower than 'lowEA' and less than 'highEA' are found in the queues. Otherwise *type will have queue type. 

◆ auto_is_ok()

bool auto_is_ok ( )
Are all queues empty? (i.e. has autoanalysis finished?). 

◆ auto_make_code()

None auto_make_code ( ida_idaapi.ea_t ea)
Plan to make code.

◆ auto_make_proc()

None auto_make_proc ( ida_idaapi.ea_t ea)
Plan to make code&function.

◆ auto_make_step()

bool auto_make_step ( ida_idaapi.ea_t ea1,
ida_idaapi.ea_t ea2 )
Analyze one address in the specified range and return true. 
    
@returns if processed anything. false means that there is nothing to process in the specified range.

◆ auto_mark()

None auto_mark ( ida_idaapi.ea_t ea,
'atype_t' type )
Put single address into a queue. Queues keep addresses sorted.

◆ auto_mark_range()

None auto_mark_range ( ida_idaapi.ea_t start,
ida_idaapi.ea_t end,
'atype_t' type )
Put range of addresses into a queue. 'start' may be higher than 'end', the kernel will swap them in this case. 'end' doesn't belong to the range. 

◆ auto_postpone_analysis()

bool auto_postpone_analysis ( ida_idaapi.ea_t ea)
Plan to reanalyze on the second pass The typical usage of this function in emu.cpp is: if ( !auto_postpone_analysis(ea) ) op_offset(ea, 0, ...); (we make an offset only on the second pass) 

◆ auto_recreate_insn()

int auto_recreate_insn ( ida_idaapi.ea_t ea)
Try to create instruction 
    
@param ea: linear address of callee
@returns the length of the instruction or 0

◆ auto_unmark()

None auto_unmark ( ida_idaapi.ea_t start,
ida_idaapi.ea_t end,
'atype_t' type )
Remove range of addresses from a queue. 'start' may be higher than 'end', the kernel will swap them in this case. 'end' doesn't belong to the range. 

◆ auto_wait()

bool auto_wait ( )
Process everything in the queues and return true. 
    
@returns false if the user clicked cancel. (the wait box must be displayed by the caller if desired)

◆ auto_wait_range()

'ssize_t' auto_wait_range ( ida_idaapi.ea_t ea1,
ida_idaapi.ea_t ea2 )
Process everything in the specified range and return true. 
    
@returns number of autoanalysis steps made. -1 if the user clicked cancel. (the wait box must be displayed by the caller if desired)

◆ enable_auto()

bool enable_auto ( bool enable)
Temporarily enable/disable autoanalyzer. Not user-facing, but rather because IDA sometimes need to turn AA on/off regardless of inf.s_genflags:INFFL_AUTO 
    
@returns old state

◆ get_auto_display()

bool get_auto_display ( 'auto_display_t' auto_display)
Get structure which holds the autoanalysis indicator contents.

◆ get_auto_state()

'atype_t' get_auto_state ( )
Get current state of autoanalyzer. If auto_state == AU_NONE, IDA is currently not running the analysis (it could be temporarily interrupted to perform the user's requests, for example). 

◆ is_auto_enabled()

bool is_auto_enabled ( )
Get autoanalyzer state.

◆ may_create_stkvars()

bool may_create_stkvars ( )
Is it allowed to create stack variables automatically?. This function should be used by IDP modules before creating stack vars. 

◆ may_trace_sp()

bool may_trace_sp ( )
Is it allowed to trace stack pointer automatically?. This function should be used by IDP modules before tracing sp. 

◆ peek_auto_queue()

ida_idaapi.ea_t peek_auto_queue ( ida_idaapi.ea_t low_ea,
'atype_t' type )
Peek into a queue 'type' for an address not lower than 'low_ea'. Do not remove address from the queue. 
    
@returns the address or BADADDR

◆ plan_and_wait()

int plan_and_wait ( ida_idaapi.ea_t ea1,
ida_idaapi.ea_t ea2,
bool final_pass = True )
Analyze the specified range. Try to create instructions where possible. Make the final pass over the specified range if specified. This function doesn't return until the range is analyzed. 
    
@retval 1: ok
@retval 0: Ctrl-Break was pressed

◆ plan_ea()

None plan_ea ( ida_idaapi.ea_t ea)
Plan to perform reanalysis.

◆ plan_range()

None plan_range ( ida_idaapi.ea_t sEA,
ida_idaapi.ea_t eEA )
Plan to perform reanalysis.

◆ reanalyze_callers()

None reanalyze_callers ( ida_idaapi.ea_t ea,
bool noret )
Plan to reanalyze callers of the specified address. This function will add to AU_USED queue all instructions that call (not jump to) the specified address. 
    
@param ea: linear address of callee
@param noret: !=0: the callee doesn't return, mark to undefine subsequent instructions in the caller. 0: do nothing.

◆ revert_ida_decisions()

None revert_ida_decisions ( ida_idaapi.ea_t ea1,
ida_idaapi.ea_t ea2 )
Delete all analysis info that IDA generated for for the given range.

◆ set_auto_state()

'atype_t' set_auto_state ( 'atype_t' new_state)
Set current state of autoanalyzer. 
    
@param new_state: new state of autoanalyzer
@returns previous state

◆ set_ida_state()

'idastate_t' set_ida_state ( 'idastate_t' st)
Change IDA status indicator value 
    
@param st: - new indicator status
@returns old indicator status

◆ show_addr()

None show_addr ( ida_idaapi.ea_t ea)
Show an address on the autoanalysis indicator. The address is displayed in the form " @:12345678". 
    
@param ea: - linear address to display

◆ show_auto()

None show_auto ( * args)
Change autoanalysis indicator value. 
    
@param ea: linear address being analyzed
@param type: autoanalysis type (see Autoanalysis queues)

Variable Documentation

◆ AU_CHLB

AU_CHLB = cvar.AU_CHLB

◆ AU_CODE

AU_CODE = cvar.AU_CODE

◆ AU_FCHUNK

AU_FCHUNK = cvar.AU_FCHUNK

◆ AU_FINAL

AU_FINAL = cvar.AU_FINAL

◆ AU_LBF2

AU_LBF2 = cvar.AU_LBF2

◆ AU_LBF3

AU_LBF3 = cvar.AU_LBF3

◆ AU_LIBF

AU_LIBF = cvar.AU_LIBF

◆ AU_NONE

AU_NONE = cvar.AU_NONE

◆ AU_PROC

AU_PROC = cvar.AU_PROC

◆ AU_TAIL

AU_TAIL = cvar.AU_TAIL

◆ AU_TYPE

AU_TYPE = cvar.AU_TYPE

◆ AU_UNK

AU_UNK = cvar.AU_UNK

◆ AU_USD2

AU_USD2 = cvar.AU_USD2

◆ AU_USED

AU_USED = cvar.AU_USED

◆ AU_WEAK

AU_WEAK = cvar.AU_WEAK

◆ cvar

cvar = _ida_auto.cvar

◆ st_Ready

st_Ready = cvar.st_Ready

◆ st_Think

st_Think = cvar.st_Think

◆ st_Waiting

st_Waiting = cvar.st_Waiting

◆ st_Work

st_Work = cvar.st_Work