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

Static Public Attributes

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

Properties

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

Constructor & Destructor Documentation

◆ __init__()

__init__ ( self,
* args,
** kwargs )

Member Function Documentation

◆ __str__()

"qstring" __str__ ( self)

◆ build_c_tree()

"void" build_c_tree ( self)

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

◆ del_orphan_cmts()

"int" del_orphan_cmts ( self)

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,
"int" label )
Parameters
label(C++: int)
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 )
Parameters
cictree_item_t const &
udmudt_type_data_t *

◆ get_boundaries()

"boundaries_t &" get_boundaries ( self)

This function initializes the boundary map if not done yet.

◆ get_eamap()

"eamap_t &" get_eamap ( self)

This function initializes eamap if not done yet.

◆ get_func_type()

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

◆ get_line_item()

"bool" get_line_item ( self,
"char const *" line,
"int" x,
"bool" is_ctree_line,
"ctree_item_t" phead,
"ctree_item_t" pitem,
"ctree_item_t" ptail )
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)
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)

This function generates pseudocode if not done yet.

◆ get_stkoff_delta()

"sval_t" get_stkoff_delta ( self)

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,
"treeloc_t" loc,
"cmt_retrieval_type_t" rt )
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,
"citem_locator_t" loc )
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,
"ea_t" ea,
"intvec_t" path )
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)
Returns
: reference to the vector of warnings

◆ has_orphan_cmts()

"bool" has_orphan_cmts ( self)

◆ locked()

"bool" locked ( self)

◆ print_dcl()

"void" print_dcl ( self)

◆ print_func()

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

◆ refresh_func_ctext()

"void" refresh_func_ctext ( self)

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)

◆ remove_unused_labels()

"void" remove_unused_labels ( self)

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)

◆ save_user_iflags()

"void" save_user_iflags ( self)

◆ save_user_labels()

"void" save_user_labels ( self)

◆ save_user_numforms()

"void" save_user_numforms ( self)

◆ save_user_unions()

"void" save_user_unions ( self)

◆ set_user_cmt()

"void" set_user_cmt ( self,
"treeloc_t" loc,
"char const *" cmt )

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,
"citem_locator_t" loc,
"int32" iflags )
Parameters
loc(C++: const citem_locator_t &) citem locator
iflags(C++: int32) new iflags

◆ set_user_union_selection()

"void" set_user_union_selection ( self,
"ea_t" ea,
"intvec_t" path )

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,
"allow_unused_labels_t" aul,
"bool" even_without_debugger )

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

Member Data Documentation

◆ argidx

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

◆ body

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

◆ entry_ea

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

◆ hdrlines

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

◆ maturity

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

◆ mba

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

◆ numforms

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

◆ refcnt

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

◆ statebits

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

◆ treeitems

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

◆ user_cmts

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

◆ user_iflags

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

◆ user_labels

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

◆ user_unions

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

Property Documentation

◆ thisown

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

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