IDAPython 8.4
Loading...
Searching...
No Matches
cfunc_t Class Reference

Proxy of C++ cfunc_t class.

Inheritance diagram for cfunc_t:

Public Member Functions

 __init__ (self, *args, **kwargs)
 
"void" release (self, *args)
 release(self)
 
"void" build_c_tree (self, *args)
 build_c_tree(self) Generate the function body.
 
"void" verify (self, *args)
 verify(self, aul, even_without_debugger) Verify the ctree.
 
"void" print_dcl (self, *args)
 print_dcl(self) Print function prototype.
 
"void" print_func (self, *args)
 print_func(self, vp) Print function text.
 
"bool" get_func_type (self, *args)
 get_func_type(self, type) -> bool Get the function type.
 
"lvars_t *" get_lvars (self, *args)
 get_lvars(self) -> lvars_t Get vector of local variables.
 
"sval_t" get_stkoff_delta (self, *args)
 get_stkoff_delta(self) -> sval_t Get stack offset delta.
 
"citem_t *" find_label (self, *args)
 find_label(self, label) -> citem_t Find the label.
 
"void" remove_unused_labels (self, *args)
 remove_unused_labels(self) Remove unused labels.
 
"char const *" get_user_cmt (self, *args)
 get_user_cmt(self, loc, rt) -> char const * Retrieve a user defined comment.
 
"void" set_user_cmt (self, *args)
 set_user_cmt(self, loc, cmt) Set a user defined comment.
 
"int32" get_user_iflags (self, *args)
 get_user_iflags(self, loc) -> int32 Retrieve citem iflags.
 
"void" set_user_iflags (self, *args)
 set_user_iflags(self, loc, iflags) Set citem iflags.
 
"bool" has_orphan_cmts (self, *args)
 has_orphan_cmts(self) -> bool Check if there are orphan comments.
 
"int" del_orphan_cmts (self, *args)
 del_orphan_cmts(self) -> int Delete all orphan comments.
 
"bool" get_user_union_selection (self, *args)
 get_user_union_selection(self, ea, path) -> bool Retrieve a user defined union field selection.
 
"void" set_user_union_selection (self, *args)
 set_user_union_selection(self, ea, path) Set a union field selection.
 
"void" save_user_labels (self, *args)
 save_user_labels(self) Save user-defined labels into the database.
 
"void" save_user_cmts (self, *args)
 save_user_cmts(self) Save user-defined comments into the database.
 
"void" save_user_numforms (self, *args)
 save_user_numforms(self) Save user-defined number formats into the database.
 
"void" save_user_iflags (self, *args)
 save_user_iflags(self) Save user-defined iflags into the database.
 
"void" save_user_unions (self, *args)
 save_user_unions(self) Save user-defined union field selections into the database.
 
"bool" get_line_item (self, *args)
 get_line_item(self, line, x, is_ctree_line, phead, pitem, ptail) -> bool Get ctree item for the specified cursor position.
 
"hexwarns_t &" get_warnings (self, *args)
 get_warnings(self) -> hexwarns_t Get information about decompilation warnings.
 
"eamap_t &" get_eamap (self, *args)
 get_eamap(self) -> eamap_t Get pointer to ea->insn map.
 
"boundaries_t &" get_boundaries (self, *args)
 get_boundaries(self) -> boundaries_t Get pointer to map of instruction boundaries.
 
"strvec_t const &" get_pseudocode (self, *args)
 get_pseudocode(self) -> strvec_t Get pointer to decompilation output: the pseudocode.
 
"void" refresh_func_ctext (self, *args)
 refresh_func_ctext(self) Refresh ctext after a ctree modification.
 
"bool" gather_derefs (self, *args)
 gather_derefs(self, ci, udm=None) -> bool
 
"bool" locked (self, *args)
 locked(self) -> bool
 
"PyObject *" find_item_coords (self, *args)
 find_item_coords(self, item, px, py) -> bool
 
"qstring" __str__ (self, *args)
 str(self) -> qstring
 

Properties

 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
 
 entry_ea = property(_ida_hexrays.cfunc_t_entry_ea_get, _ida_hexrays.cfunc_t_entry_ea_set, doc=)
 
 mba = property(_ida_hexrays.cfunc_t_mba_get, _ida_hexrays.cfunc_t_mba_set, doc=)
 
 body = property(_ida_hexrays.cfunc_t_body_get, _ida_hexrays.cfunc_t_body_set, doc=)
 
 argidx = property(_ida_hexrays.cfunc_t_argidx_get, doc=)
 
 maturity = property(_ida_hexrays.cfunc_t_maturity_get, _ida_hexrays.cfunc_t_maturity_set, doc=)
 
 user_labels = property(_ida_hexrays.cfunc_t_user_labels_get, _ida_hexrays.cfunc_t_user_labels_set, doc=)
 
 user_cmts = property(_ida_hexrays.cfunc_t_user_cmts_get, _ida_hexrays.cfunc_t_user_cmts_set, doc=)
 
 numforms = property(_ida_hexrays.cfunc_t_numforms_get, _ida_hexrays.cfunc_t_numforms_set, doc=)
 
 user_iflags = property(_ida_hexrays.cfunc_t_user_iflags_get, _ida_hexrays.cfunc_t_user_iflags_set, doc=)
 
 user_unions = property(_ida_hexrays.cfunc_t_user_unions_get, _ida_hexrays.cfunc_t_user_unions_set, doc=)
 
 refcnt = property(_ida_hexrays.cfunc_t_refcnt_get, _ida_hexrays.cfunc_t_refcnt_set, doc=)
 
 statebits = property(_ida_hexrays.cfunc_t_statebits_get, _ida_hexrays.cfunc_t_statebits_set, doc=)
 
 hdrlines = property(_ida_hexrays.cfunc_t_hdrlines_get, _ida_hexrays.cfunc_t_hdrlines_set, doc=)
 
 treeitems = property(_ida_hexrays.cfunc_t_treeitems_get, _ida_hexrays.cfunc_t_treeitems_set, doc=)
 

Constructor & Destructor Documentation

◆ __init__()

__init__ ( self,
* args,
** kwargs )

Member Function Documentation

◆ __str__()

"qstring" __str__ ( self,
* args )

◆ build_c_tree()

"void" build_c_tree ( self,
* args )

This function (re)generates the function body from the underlying microcode.

◆ del_orphan_cmts()

"int" del_orphan_cmts ( self,
* args )

The save_user_cmts() function must be called after this call.

◆ find_item_coords()

"PyObject *" find_item_coords ( self,
* args )
Parameters
itemcitem_t const *
pxint *
pyint *

find_item_coords(self, item) -> PyObject *

Parameters
itemcitem_t const *

◆ find_label()

"citem_t *" find_label ( self,
* args )
Parameters
label(C++: int)
Returns
: pointer to the ctree item with the specified label number.

◆ gather_derefs()

"bool" gather_derefs ( self,
* args )
Parameters
cictree_item_t const &
udmudt_type_data_t *

◆ get_boundaries()

"boundaries_t &" get_boundaries ( self,
* args )

This function initializes the boundary map if not done yet.

◆ get_eamap()

"eamap_t &" get_eamap ( self,
* args )

This function initializes eamap if not done yet.

◆ get_func_type()

"bool" get_func_type ( self,
* args )
Parameters
type(C++: tinfo_t *) variable where the function type is returned
Returns
: false if failure

◆ get_line_item()

"bool" get_line_item ( self,
* args )
Parameters
line(C++: const char *) line of decompilation text (element of sv)
x(C++: int) x cursor coordinate in the line
is_ctree_line(C++: bool) does the line belong to statement area? (if not, it is assumed to belong to the declaration area)
phead(C++: ctree_item_t *) ptr to the first item on the line (used to attach block comments). May be nullptr
pitem(C++: ctree_item_t *) ptr to the current item. May be nullptr
ptail(C++: ctree_item_t *) ptr to the last item on the line (used to attach indented comments). May be nullptr
See also
: vdui_t.get_current_item()
Returns
: false if failed to get the current item

◆ get_lvars()

"lvars_t *" get_lvars ( self,
* args )
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,
* args )

This function generates pseudocode if not done yet.

◆ get_stkoff_delta()

"sval_t" get_stkoff_delta ( self,
* args )

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()

"char const *" get_user_cmt ( self,
* args )
Parameters
loc(C++: const treeloc_t &) ctree location
rt(C++: cmt_retrieval_type_t) should already retrieved comments retrieved again?
Returns
: pointer to the comment string or nullptr

◆ get_user_iflags()

"int32" get_user_iflags ( self,
* args )
Parameters
loc(C++: const citem_locator_t &) citem locator
Returns
: ctree item iflags bits or 0

◆ get_user_union_selection()

"bool" get_user_union_selection ( self,
* args )
Parameters
ea(C++: ea_t) address
path(C++: intvec_t *) out: path describing the union selection.
Returns
: pointer to the path or nullptr

◆ get_warnings()

"hexwarns_t &" get_warnings ( self,
* args )
Returns
: reference to the vector of warnings

◆ has_orphan_cmts()

"bool" has_orphan_cmts ( self,
* args )

◆ locked()

"bool" locked ( self,
* args )

◆ print_dcl()

"void" print_dcl ( self,
* args )

◆ print_func()

"void" print_func ( self,
* args )
Parameters
vp(C++: vc_printer_t &) printer helper class to receive the generated text.

◆ refresh_func_ctext()

"void" refresh_func_ctext ( self,
* args )

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()

"void" release ( self,
* args )

◆ remove_unused_labels()

"void" remove_unused_labels ( self,
* args )

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()

"void" save_user_cmts ( self,
* args )

◆ save_user_iflags()

"void" save_user_iflags ( self,
* args )

◆ save_user_labels()

"void" save_user_labels ( self,
* args )

◆ save_user_numforms()

"void" save_user_numforms ( self,
* args )

◆ save_user_unions()

"void" save_user_unions ( self,
* args )

◆ set_user_cmt()

"void" set_user_cmt ( self,
* args )

This function stores the specified comment in the cfunc_t structure. The save_user_cmts() function must be called after it.

Parameters
loc(C++: const treeloc_t &) ctree location
cmt(C++: const char *) new comment. if empty or nullptr, then an existing comment is deleted.

◆ set_user_iflags()

"void" set_user_iflags ( self,
* args )
Parameters
loc(C++: const citem_locator_t &) citem locator
iflags(C++: int32) new iflags

◆ set_user_union_selection()

"void" set_user_union_selection ( self,
* args )

The save_user_unions() function must be called after calling this function.

Parameters
ea(C++: ea_t) address
path(C++: const intvec_t &) in: path describing the union selection.

◆ verify()

"void" verify ( self,
* args )

This function verifies the ctree. If the ctree is malformed, an internal error is generated. Use it to verify the ctree after your modifications.

Parameters
aul(C++: allow_unused_labels_t) Are unused labels acceptable?
even_without_debugger(C++: bool) if false and there is no debugger, the verification will be skipped

Property Documentation

◆ argidx

argidx = property(_ida_hexrays.cfunc_t_argidx_get, doc=)
static

◆ body

body = property(_ida_hexrays.cfunc_t_body_get, _ida_hexrays.cfunc_t_body_set, doc=)
static

◆ entry_ea

entry_ea = property(_ida_hexrays.cfunc_t_entry_ea_get, _ida_hexrays.cfunc_t_entry_ea_set, doc=)
static

◆ hdrlines

hdrlines = property(_ida_hexrays.cfunc_t_hdrlines_get, _ida_hexrays.cfunc_t_hdrlines_set, doc=)
static

◆ maturity

maturity = property(_ida_hexrays.cfunc_t_maturity_get, _ida_hexrays.cfunc_t_maturity_set, doc=)
static

◆ mba

mba = property(_ida_hexrays.cfunc_t_mba_get, _ida_hexrays.cfunc_t_mba_set, doc=)
static

◆ numforms

numforms = property(_ida_hexrays.cfunc_t_numforms_get, _ida_hexrays.cfunc_t_numforms_set, doc=)
static

◆ refcnt

refcnt = property(_ida_hexrays.cfunc_t_refcnt_get, _ida_hexrays.cfunc_t_refcnt_set, doc=)
static

◆ statebits

statebits = property(_ida_hexrays.cfunc_t_statebits_get, _ida_hexrays.cfunc_t_statebits_set, doc=)
static

◆ thisown

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

◆ treeitems

treeitems = property(_ida_hexrays.cfunc_t_treeitems_get, _ida_hexrays.cfunc_t_treeitems_set, doc=)
static

◆ user_cmts

user_cmts = property(_ida_hexrays.cfunc_t_user_cmts_get, _ida_hexrays.cfunc_t_user_cmts_set, doc=)
static

◆ user_iflags

user_iflags = property(_ida_hexrays.cfunc_t_user_iflags_get, _ida_hexrays.cfunc_t_user_iflags_set, doc=)
static

◆ user_labels

user_labels = property(_ida_hexrays.cfunc_t_user_labels_get, _ida_hexrays.cfunc_t_user_labels_set, doc=)
static

◆ user_unions

user_unions = property(_ida_hexrays.cfunc_t_user_unions_get, _ida_hexrays.cfunc_t_user_unions_set, doc=)
static

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