IDAPython 9.0
Loading...
Searching...
No Matches
cfunc_t Class Reference
Inheritance diagram for cfunc_t:

Public Member Functions

 __init__ (self, *args, **kwargs)
 
None release (self)
 
None build_c_tree (self)
 
None verify (self, 'allow_unused_labels_t' aul, bool even_without_debugger)
 
None print_dcl (self)
 
None print_func (self, 'vc_printer_t' vp)
 
bool get_func_type (self, 'tinfo_t' type)
 
'lvars_t *' get_lvars (self)
 
int get_stkoff_delta (self)
 
'citem_t *' find_label (self, int label)
 
None remove_unused_labels (self)
 
str get_user_cmt (self, 'treeloc_t' loc, 'cmt_retrieval_type_t' rt)
 
None set_user_cmt (self, 'treeloc_t' loc, str cmt)
 
int get_user_iflags (self, 'citem_locator_t' loc)
 
None set_user_iflags (self, 'citem_locator_t' loc, int iflags)
 
bool has_orphan_cmts (self)
 
int del_orphan_cmts (self)
 
bool get_user_union_selection (self, ida_idaapi.ea_t ea, 'intvec_t' path)
 
None set_user_union_selection (self, ida_idaapi.ea_t ea, 'intvec_t' path)
 
None save_user_labels (self)
 
None save_user_cmts (self)
 
None save_user_numforms (self)
 
None save_user_iflags (self)
 
None save_user_unions (self)
 
bool get_line_item (self, str line, int x, bool is_ctree_line, 'ctree_item_t' phead, 'ctree_item_t' pitem, 'ctree_item_t' ptail)
 
'hexwarns_t &' get_warnings (self)
 
'eamap_t &' get_eamap (self)
 
'boundaries_t &' get_boundaries (self)
 
'strvec_t const &' get_pseudocode (self)
 
None refresh_func_ctext (self)
 
bool gather_derefs (self, 'ctree_item_t' ci, 'udt_type_data_t' udm=None)
 
bool locked (self)
 
 find_item_coords (self, *args)
 
str __str__ (self)
 

Static Public Attributes

str entry_ea
 
str mba
 
str body
 
str argidx = property(_ida_hexrays.cfunc_t_argidx_get)
 
str maturity
 
str user_labels
 
str user_cmts
 
str numforms
 
str user_iflags
 
str user_unions
 
str refcnt
 
str statebits
 
str hdrlines
 
str treeitems
 

Properties

 thisown
 

Constructor & Destructor Documentation

◆ __init__()

__init__ ( self,
* args,
** kwargs )

Member Function Documentation

◆ __str__()

str __str__ ( self)

◆ build_c_tree()

None build_c_tree ( self)
Generate the function body. This function (re)generates the function body from the underlying microcode. 

◆ del_orphan_cmts()

int del_orphan_cmts ( self)
Delete all orphan comments. The save_user_cmts() function must be called after this call. 

◆ find_item_coords()

find_item_coords ( self,
* args )
This method has the following signatures:

1. find_item_coords(item: citem_t) -> Tuple[int, int]
2. find_item_coords(item: citem_t, x: int_pointer, y: int_pointer) -> bool

NOTE: The second form is retained for backward-compatibility,
but we strongly recommend using the first.

@param item The item to find coordinates for in the pseudocode listing

◆ find_label()

'citem_t *' find_label ( self,
int label )
Find the label. 

@returns pointer to the ctree item with the specified label number.

◆ gather_derefs()

bool gather_derefs ( self,
'ctree_item_t' ci,
'udt_type_data_t' udm = None )

◆ get_boundaries()

'boundaries_t &' get_boundaries ( self)
Get pointer to map of instruction boundaries. This function initializes the boundary map if not done yet. 

◆ get_eamap()

'eamap_t &' get_eamap ( self)
Get pointer to ea->insn map. This function initializes eamap if not done yet. 

◆ get_func_type()

bool get_func_type ( self,
'tinfo_t' type )
Get the function type. 

@param type: variable where the function type is returned
@returns false if failure

◆ get_line_item()

bool get_line_item ( self,
str line,
int x,
bool is_ctree_line,
'ctree_item_t' phead,
'ctree_item_t' pitem,
'ctree_item_t' ptail )
Get ctree item for the specified cursor position. 

@param line: line of decompilation text (element of sv)
@param x: x cursor coordinate in the line
@param is_ctree_line: does the line belong to statement area? (if not, it is assumed to belong to the declaration area)
@param phead: ptr to the first item on the line (used to attach block comments). May be nullptr
@param pitem: ptr to the current item. May be nullptr
@param ptail: ptr to the last item on the line (used to attach indented comments). May be nullptr
@returns false if failed to get the current item

◆ get_lvars()

'lvars_t *' get_lvars ( self)
Get vector of local variables. 

@returns pointer to the vector of local variables. If you modify this vector, the ctree must be regenerated in order to have correct cast operators. Use build_c_tree() for that. Removing lvars should be done carefully: all references in ctree and microcode must be corrected after that.

◆ get_pseudocode()

'strvec_t const &' get_pseudocode ( self)
Get pointer to decompilation output: the pseudocode. This function generates pseudocode if not done yet. 

◆ get_stkoff_delta()

int get_stkoff_delta ( self)
Get stack offset delta. The local variable stack offsets retrieved by v.location.stkoff() should be adjusted before being used as stack frame offsets in IDA. 

@returns the delta to apply. example: ida_stkoff = v.location.stkoff() - f->get_stkoff_delta()

◆ get_user_cmt()

str get_user_cmt ( self,
'treeloc_t' loc,
'cmt_retrieval_type_t' rt )
Retrieve a user defined comment. 

@param loc: ctree location
@param rt: should already retrieved comments retrieved again?
@returns pointer to the comment string or nullptr

◆ get_user_iflags()

int get_user_iflags ( self,
'citem_locator_t' loc )
Retrieve citem iflags. 

@param loc: citem locator
@returns ctree item iflags bits or 0

◆ get_user_union_selection()

bool get_user_union_selection ( self,
ida_idaapi.ea_t ea,
'intvec_t' path )
Retrieve a user defined union field selection. 

@param ea: address
@param path: out: path describing the union selection.
@returns pointer to the path or nullptr

◆ get_warnings()

'hexwarns_t &' get_warnings ( self)
Get information about decompilation warnings. 

@returns reference to the vector of warnings

◆ has_orphan_cmts()

bool has_orphan_cmts ( self)
Check if there are orphan comments.

◆ locked()

bool locked ( self)

◆ print_dcl()

None print_dcl ( self)
Print function prototype. 

◆ print_func()

None print_func ( self,
'vc_printer_t' vp )
Print function text. 

@param vp: printer helper class to receive the generated text.

◆ refresh_func_ctext()

None refresh_func_ctext ( self)
Refresh ctext after a ctree modification. This function informs the decompiler that ctree (body) have been modified and ctext (sv) does not correspond to it anymore. It also refreshes the pseudocode windows if there is any. 

◆ release()

None release ( self)

◆ remove_unused_labels()

None remove_unused_labels ( self)
Remove unused labels. This function checks what labels are really used by the function and removes the unused ones. You must call it after deleting a goto statement. 

◆ save_user_cmts()

None save_user_cmts ( self)
Save user-defined comments into the database.

◆ save_user_iflags()

None save_user_iflags ( self)
Save user-defined iflags into the database.

◆ save_user_labels()

None save_user_labels ( self)
Save user-defined labels into the database.

◆ save_user_numforms()

None save_user_numforms ( self)
Save user-defined number formats into the database.

◆ save_user_unions()

None save_user_unions ( self)
Save user-defined union field selections into the database.

◆ set_user_cmt()

None set_user_cmt ( self,
'treeloc_t' loc,
str cmt )
Set a user defined comment. This function stores the specified comment in the cfunc_t structure. The save_user_cmts() function must be called after it. 

@param loc: ctree location
@param cmt: new comment. if empty or nullptr, then an existing comment is deleted.

◆ set_user_iflags()

None set_user_iflags ( self,
'citem_locator_t' loc,
int iflags )
Set citem iflags. 

@param loc: citem locator
@param iflags: new iflags

◆ set_user_union_selection()

None set_user_union_selection ( self,
ida_idaapi.ea_t ea,
'intvec_t' path )
Set a union field selection. The save_user_unions() function must be called after calling this function. 

@param ea: address
@param path: in: path describing the union selection.

◆ verify()

None verify ( self,
'allow_unused_labels_t' aul,
bool even_without_debugger )
Verify the ctree. This function verifies the ctree. If the ctree is malformed, an internal error is generated. Use it to verify the ctree after your modifications. 

@param aul: Are unused labels acceptable?
@param even_without_debugger: if false and there is no debugger, the verification will be skipped

Member Data Documentation

◆ argidx

str argidx = property(_ida_hexrays.cfunc_t_argidx_get)
static

◆ body

str body
static
Initial value:
= property(_ida_hexrays.cfunc_t_body_get, _ida_hexrays.
cfunc_t_body_set)

◆ entry_ea

str entry_ea
static
Initial value:
= property(_ida_hexrays.cfunc_t_entry_ea_get,
_ida_hexrays.cfunc_t_entry_ea_set)

◆ hdrlines

str hdrlines
static
Initial value:
= property(_ida_hexrays.cfunc_t_hdrlines_get,
_ida_hexrays.cfunc_t_hdrlines_set)

◆ maturity

str maturity
static
Initial value:
= property(_ida_hexrays.
cfunc_t_maturity_get, _ida_hexrays.cfunc_t_maturity_set)

◆ mba

str mba
static
Initial value:
= property(_ida_hexrays.cfunc_t_mba_get, _ida_hexrays.
cfunc_t_mba_set)

◆ numforms

str numforms
static
Initial value:
= property(_ida_hexrays.
cfunc_t_numforms_get, _ida_hexrays.cfunc_t_numforms_set)

◆ refcnt

str refcnt
static
Initial value:
= property(_ida_hexrays.cfunc_t_refcnt_get, _ida_hexrays.
cfunc_t_refcnt_set)

◆ statebits

str statebits
static
Initial value:
= property(_ida_hexrays.cfunc_t_statebits_get,
_ida_hexrays.cfunc_t_statebits_set)

◆ treeitems

str treeitems
static
Initial value:
= property(_ida_hexrays.
cfunc_t_treeitems_get, _ida_hexrays.cfunc_t_treeitems_set)

◆ user_cmts

str user_cmts
static
Initial value:
= property(_ida_hexrays.
cfunc_t_user_cmts_get, _ida_hexrays.cfunc_t_user_cmts_set)

◆ user_iflags

str user_iflags
static
Initial value:
= property(_ida_hexrays.
cfunc_t_user_iflags_get, _ida_hexrays.cfunc_t_user_iflags_set)

◆ user_labels

str user_labels
static
Initial value:
= property(_ida_hexrays.
cfunc_t_user_labels_get, _ida_hexrays.cfunc_t_user_labels_set)

◆ user_unions

str user_unions
static
Initial value:
= property(_ida_hexrays.
cfunc_t_user_unions_get, _ida_hexrays.cfunc_t_user_unions_set)

Property Documentation

◆ thisown

thisown
static
Initial value:
= property(lambda x: x.this.own(), lambda x, v: x.this.own(v),
doc='The membership flag')

The documentation for this class was generated from the following file: