IDAPython 9.0
Loading...
Searching...
No Matches
cexpr_t Class Reference
Inheritance diagram for cexpr_t:
citem_t carg_t

Public Member Functions

bool cpadone (self)
 
bool is_odd_lvalue (self)
 
bool is_fpop (self)
 
bool is_cstr (self)
 
bool is_undef_val (self)
 
bool is_jumpout (self)
 
bool is_vftable (self)
 
None set_cpadone (self)
 
None set_vftable (self)
 
 __init__ (self, *args)
 
None swap (self, 'cexpr_t' r)
 
'cexpr_t &' assign (self, 'cexpr_t' r)
 
bool __eq__ (self, 'cexpr_t' r)
 
bool __ne__ (self, 'cexpr_t' r)
 
bool __lt__ (self, 'cexpr_t' r)
 
bool __gt__ (self, 'cexpr_t' r)
 
bool __le__ (self, 'cexpr_t' r)
 
bool __ge__ (self, 'cexpr_t' r)
 
int compare (self, 'cexpr_t' r)
 
None cleanup (self)
 
None put_number (self, *args)
 
None print1 (self, 'cfunc_t' func)
 
None calc_type (self, bool recursive)
 
bool equal_effect (self, 'cexpr_t' r)
 
bool is_child_of (self, 'citem_t' parent)
 
bool contains_operator (self, 'ctype_t' needed_op, int times=1)
 
bool contains_comma (self, int times=1)
 
bool contains_insn (self, int times=1)
 
bool contains_insn_or_label (self)
 
bool contains_comma_or_insn_or_label (self, int maxcommas=1)
 
bool is_nice_expr (self)
 
bool is_nice_cond (self)
 
bool is_call_object_of (self, 'citem_t' parent)
 
bool is_call_arg_of (self, 'citem_t' parent)
 
'type_sign_t' get_type_sign (self)
 
bool is_type_unsigned (self)
 
bool is_type_signed (self)
 
'bit_bound_tget_high_nbit_bound (self)
 
int get_low_nbit_bound (self)
 
bool requires_lvalue (self, 'cexpr_t' child)
 
bool has_side_effects (self)
 
'uint64' numval (self)
 
bool is_const_value (self, 'uint64' _v)
 
bool is_negative_const (self)
 
bool is_non_negative_const (self)
 
bool is_non_zero_const (self)
 
bool is_zero_const (self)
 
bool get_const_value (self)
 
bool maybe_ptr (self)
 
'cexpr_t *' get_ptr_or_array (self)
 
'cexpr_t *' find_op (self, 'ctype_t' _op)
 
'cexpr_t *' find_num_op (self)
 
'cexpr_t *' theother (self, 'cexpr_t' what)
 
bool get_1num_op (self, 'cexpr_t **' o1, 'cexpr_t **' o2)
 
str dstr (self)
 
'var_ref_t *' get_v (self)
 
None set_v (self, 'var_ref_t' v)
 
- Public Member Functions inherited from citem_t
bool is_expr (self)
 
bool contains_expr (self, 'cexpr_t' e)
 
bool contains_label (self)
 
'citem_t *' find_parent_of (self, 'citem_t' item)
 
'citem_t *' find_closest_addr (self, ida_idaapi.ea_t _ea)
 
 replace_by (self, o)
 

Static Public Attributes

str type
 
str exflags
 
- Static Public Attributes inherited from citem_t
str ea
 
str label_num
 
str index
 
str cinsn = property(_ida_hexrays.citem_t_cinsn_get)
 
str cexpr = property(_ida_hexrays.citem_t_cexpr_get)
 

Protected Member Functions

None _replace_by (self, 'cexpr_t' r)
 
None _register (self)
 
None _deregister (self)
 
'cnumber_t *' _get_n (self)
 
None _set_n (self, 'cnumber_t' _v)
 
'fnumber_t *' _get_fpc (self)
 
None _set_fpc (self, 'fnumber_t' _v)
 
'cexpr_t *' _get_x (self)
 
None _set_x (self, 'cexpr_t' _v)
 
'cexpr_t *' _get_y (self)
 
None _set_y (self, 'cexpr_t' _v)
 
'cexpr_t *' _get_z (self)
 
None _set_z (self, 'cexpr_t' _v)
 
'carglist_t *' _get_a (self)
 
None _set_a (self, 'carglist_t' _v)
 
'cinsn_t *' _get_insn (self)
 
None _set_insn (self, 'cinsn_t' _v)
 
int _get_m (self)
 
None _set_m (self, int _v)
 
int _get_ptrsize (self)
 
None _set_ptrsize (self, int _v)
 
ida_idaapi.ea_t _get_obj_ea (self)
 
None _set_obj_ea (self, ida_idaapi.ea_t _v)
 
int _get_refwidth (self)
 
None _set_refwidth (self, int _v)
 
str _get_helper (self)
 
None _set_helper (self, str _v)
 
str _get_string (self)
 
None _set_string (self, str _v)
 
- Protected Member Functions inherited from citem_t
'ctype_t' _get_op (self)
 
None _set_op (self, 'ctype_t' v)
 
 _ensure_no_op (self)
 
'PyObject *' _obj_id (self)
 
 _ensure_cond (self, ok, cond_str)
 
 _ensure_no_obj (self, o, attr, attr_is_acquired)
 
 _ensure_ownership_transferrable (self, v)
 
 _acquire_ownership (self, v, acquire)
 
 _maybe_disown_and_deregister (self)
 
 _own_and_register (self)
 
 _meminfo (self)
 

Properties

 thisown
 
 v = property(lambda self: self.get_v(), lambda self, v: self.set_v(v))
 
 n
 
 fpc
 
 x
 
 y
 
 z
 
 a
 
 insn
 
 m
 
 ptrsize
 
 obj_ea
 
 refwidth
 
 helper
 
 string
 
- Properties inherited from citem_t
bool thisown
 
 op
 
 obj_id = property(_obj_id)
 
 meminfo = property(_meminfo)
 

Constructor & Destructor Documentation

◆ __init__()

__init__ ( self,
* args )

Reimplemented from citem_t.

Reimplemented in carg_t.

Member Function Documentation

◆ __eq__()

bool __eq__ ( self,
'cexpr_t' r )

Reimplemented in carg_t.

◆ __ge__()

bool __ge__ ( self,
'cexpr_t' r )

Reimplemented in carg_t.

◆ __gt__()

bool __gt__ ( self,
'cexpr_t' r )

Reimplemented in carg_t.

◆ __le__()

bool __le__ ( self,
'cexpr_t' r )

Reimplemented in carg_t.

◆ __lt__()

bool __lt__ ( self,
'cexpr_t' r )

Reimplemented in carg_t.

◆ __ne__()

bool __ne__ ( self,
'cexpr_t' r )

Reimplemented in carg_t.

◆ _deregister()

None _deregister ( self)
protected

◆ _get_a()

'carglist_t *' _get_a ( self)
protected

◆ _get_fpc()

'fnumber_t *' _get_fpc ( self)
protected

◆ _get_helper()

str _get_helper ( self)
protected

◆ _get_insn()

'cinsn_t *' _get_insn ( self)
protected

◆ _get_m()

int _get_m ( self)
protected

◆ _get_n()

'cnumber_t *' _get_n ( self)
protected

◆ _get_obj_ea()

ida_idaapi.ea_t _get_obj_ea ( self)
protected

◆ _get_ptrsize()

int _get_ptrsize ( self)
protected

◆ _get_refwidth()

int _get_refwidth ( self)
protected

◆ _get_string()

str _get_string ( self)
protected

◆ _get_x()

'cexpr_t *' _get_x ( self)
protected

◆ _get_y()

'cexpr_t *' _get_y ( self)
protected

◆ _get_z()

'cexpr_t *' _get_z ( self)
protected

◆ _register()

None _register ( self)
protected

◆ _replace_by()

None _replace_by ( self,
'cexpr_t' r )
protected

◆ _set_a()

None _set_a ( self,
'carglist_t' _v )
protected

◆ _set_fpc()

None _set_fpc ( self,
'fnumber_t' _v )
protected

◆ _set_helper()

None _set_helper ( self,
str _v )
protected

◆ _set_insn()

None _set_insn ( self,
'cinsn_t' _v )
protected

◆ _set_m()

None _set_m ( self,
int _v )
protected

◆ _set_n()

None _set_n ( self,
'cnumber_t' _v )
protected

◆ _set_obj_ea()

None _set_obj_ea ( self,
ida_idaapi.ea_t _v )
protected

◆ _set_ptrsize()

None _set_ptrsize ( self,
int _v )
protected

◆ _set_refwidth()

None _set_refwidth ( self,
int _v )
protected

◆ _set_string()

None _set_string ( self,
str _v )
protected

◆ _set_x()

None _set_x ( self,
'cexpr_t' _v )
protected

◆ _set_y()

None _set_y ( self,
'cexpr_t' _v )
protected

◆ _set_z()

None _set_z ( self,
'cexpr_t' _v )
protected

◆ assign()

'cexpr_t &' assign ( self,
'cexpr_t' r )

◆ calc_type()

None calc_type ( self,
bool recursive )
Calculate the type of the expression. Use this function to calculate the expression type when a new expression is built 

@param recursive: if true, types of all children expression will be calculated before calculating our type

◆ cleanup()

None cleanup ( self)
Cleanup the expression. This function properly deletes all children and sets the item type to cot_empty. 

◆ compare()

int compare ( self,
'cexpr_t' r )

Reimplemented in carg_t.

◆ contains_comma()

bool contains_comma ( self,
int times = 1 )
Does the expression contain a comma operator?

◆ contains_comma_or_insn_or_label()

bool contains_comma_or_insn_or_label ( self,
int maxcommas = 1 )
Does the expression contain a comma operator or an embedded statement operator or a label?

◆ contains_insn()

bool contains_insn ( self,
int times = 1 )
Does the expression contain an embedded statement operator?

◆ contains_insn_or_label()

bool contains_insn_or_label ( self)
Does the expression contain an embedded statement operator or a label?

◆ contains_operator()

bool contains_operator ( self,
'ctype_t' needed_op,
int times = 1 )
Check if the expression contains the specified operator. 

@param needed_op: operator code to search for
@param times: how many times the operator code should be present
@returns true if the expression has at least TIMES children with NEEDED_OP

◆ cpadone()

bool cpadone ( self)
Pointer arithmetic correction done for this expression?

◆ dstr()

str dstr ( self)

◆ equal_effect()

bool equal_effect ( self,
'cexpr_t' r )
Compare two expressions. This function tries to compare two expressions in an 'intelligent' manner. For example, it knows about commutitive operators and can ignore useless casts. 

@param r: the expression to compare against the current expression
@returns true expressions can be considered equal

◆ find_num_op()

'cexpr_t *' find_num_op ( self)
Find the operand with a numeric value.

◆ find_op()

'cexpr_t *' find_op ( self,
'ctype_t' _op )
Find the child with the specified operator.

◆ get_1num_op()

bool get_1num_op ( self,
'cexpr_t **' o1,
'cexpr_t **' o2 )
Get pointers to operands. at last one operand should be a number o1 will be pointer to the number 

◆ get_const_value()

bool get_const_value ( self)
Get expression value. 

@returns true if the expression is a number.

◆ get_high_nbit_bound()

'bit_bound_t' get_high_nbit_bound ( self)
Get max number of bits that can really be used by the expression. For example, x % 16 can yield only 4 non-zero bits, higher bits are zero 

◆ get_low_nbit_bound()

int get_low_nbit_bound ( self)
Get min number of bits that are certainly required to represent the expression. For example, constant 16 always uses 5 bits: 10000. 

◆ get_ptr_or_array()

'cexpr_t *' get_ptr_or_array ( self)
Find pointer or array child.

◆ get_type_sign()

'type_sign_t' get_type_sign ( self)
Get expression sign.

◆ get_v()

'var_ref_t *' get_v ( self)

◆ has_side_effects()

bool has_side_effects ( self)
Check if the expression has side effects. Calls, pre/post inc/dec, and assignments have side effects. 

◆ is_call_arg_of()

bool is_call_arg_of ( self,
'citem_t' parent )
Is call argument? 

@returns true if our expression is a call argument of the specified parent expression.

◆ is_call_object_of()

bool is_call_object_of ( self,
'citem_t' parent )
Is call object? 

@returns true if our expression is the call object of the specified parent expression.

◆ is_child_of()

bool is_child_of ( self,
'citem_t' parent )
Verify if the specified item is our parent. 

@param parent: possible parent item
@returns true if the specified item is our parent

◆ is_const_value()

bool is_const_value ( self,
'uint64' _v )
Check if the expression is a number with the specified value.

◆ is_cstr()

bool is_cstr ( self)

◆ is_fpop()

bool is_fpop ( self)

◆ is_jumpout()

bool is_jumpout ( self)

◆ is_negative_const()

bool is_negative_const ( self)
Check if the expression is a negative number.

◆ is_nice_cond()

bool is_nice_cond ( self)
Is nice condition?. Nice condition is a nice expression of the boolean type. 

◆ is_nice_expr()

bool is_nice_expr ( self)
Is nice expression? Nice expressions do not contain comma operators, embedded statements, or labels. 

◆ is_non_negative_const()

bool is_non_negative_const ( self)
Check if the expression is a non-negative number.

◆ is_non_zero_const()

bool is_non_zero_const ( self)
Check if the expression is a non-zero number.

◆ is_odd_lvalue()

bool is_odd_lvalue ( self)

◆ is_type_signed()

bool is_type_signed ( self)
Is expression signed?

◆ is_type_unsigned()

bool is_type_unsigned ( self)
Is expression unsigned?

◆ is_undef_val()

bool is_undef_val ( self)

◆ is_vftable()

bool is_vftable ( self)

◆ is_zero_const()

bool is_zero_const ( self)
Check if the expression is a zero.

◆ maybe_ptr()

bool maybe_ptr ( self)
May the expression be a pointer?

◆ numval()

'uint64' numval ( self)
Get numeric value of the expression. This function can be called only on cot_num expressions! 

◆ print1()

None print1 ( self,
'cfunc_t' func )
Print expression into one line. 

@param func: parent function. This argument is used to find out the referenced variable names.

Reimplemented from citem_t.

◆ put_number()

None put_number ( self,
* args )
Assign a number to the expression. 

@param func: current function
@param value: number value
@param nbytes: size of the number in bytes
@param sign: number sign

◆ requires_lvalue()

bool requires_lvalue ( self,
'cexpr_t' child )
Check if the expression requires an lvalue. 

@param child: The function will check if this child of our expression must be an lvalue.
@returns true if child must be an lvalue.

◆ set_cpadone()

None set_cpadone ( self)

◆ set_v()

None set_v ( self,
'var_ref_t' v )

◆ set_vftable()

None set_vftable ( self)

◆ swap()

None swap ( self,
'cexpr_t' r )
Swap two citem_t.

Reimplemented from citem_t.

◆ theother()

'cexpr_t *' theother ( self,
'cexpr_t' what )
Get the other operand. This function returns the other operand (not the specified one) for binary expressions. 

Member Data Documentation

◆ exflags

str exflags
static
Initial value:
= property(_ida_hexrays.cexpr_t_exflags_get,
_ida_hexrays.cexpr_t_exflags_set)

◆ type

str type
static
Initial value:
= property(_ida_hexrays.cexpr_t_type_get, _ida_hexrays.
cexpr_t_type_set)

Property Documentation

◆ a

a
static
Initial value:
= property(lambda self: self._get_a() if self.op == cot_call else
None, lambda self, v: self._ensure_cond(self.op == cot_call,
'self.op == cot_call') and self._ensure_no_obj(self._get_a(), 'a',
True) and self._acquire_ownership(v, True) and self._set_a(v))

◆ fpc

fpc
static
Initial value:
= property(lambda self: self._get_fpc() if self.op == cot_fnum else
None, lambda self, v: self._ensure_cond(self.op == cot_fnum,
'self.op == cot_fnum') and self._ensure_no_obj(self._get_fpc(),
'fpc', True) and self._acquire_ownership(v, True) and self._set_fpc(v))

◆ helper

helper
static
Initial value:
= property(lambda self: self._get_helper() if self.op ==
cot_helper else None, lambda self, v: self._ensure_cond(self.op ==
cot_helper, 'self.op == cot_helper') and self._ensure_no_obj(self.
_get_helper(), 'helper', False) and self._acquire_ownership(v,
False) and self._set_helper(v))

◆ insn

insn
static
Initial value:
= property(lambda self: self._get_insn() if self.op == cot_insn else
None, lambda self, v: self._ensure_cond(self.op == cot_insn,
'self.op == cot_insn') and self._ensure_no_obj(self._get_insn(),
'insn', True) and self._acquire_ownership(v, True) and self.
_set_insn(v))

◆ m

m
static
Initial value:
= property(lambda self: self._get_m() if self.op == cot_memptr or
self.op == cot_memref else 0, lambda self, v: self._ensure_cond(
self.op == cot_memptr or self.op == cot_memref,
'self.op == cot_memptr or self.op == cot_memref') and self._set_m(v))

◆ n

n
static
Initial value:
= property(lambda self: self._get_n() if self.op == cot_num else None,
lambda self, v: self._ensure_cond(self.op == cot_num,
'self.op == cot_num') and self._ensure_no_obj(self._get_n(), 'n',
True) and self._acquire_ownership(v, True) and self._set_n(v))

◆ obj_ea

obj_ea
static
Initial value:
= property(lambda self: self._get_obj_ea() if self.op == cot_obj
else ida_idaapi.BADADDR, lambda self, v: self._ensure_cond(self.op ==
cot_obj, 'self.op == cot_obj') and self._set_obj_ea(v))

◆ ptrsize

ptrsize
static
Initial value:
= property(lambda self: self._get_ptrsize() if self.op ==
cot_ptr or self.op == cot_memptr else 0, lambda self, v: self.
_ensure_cond(self.op == cot_ptr or self.op == cot_memptr,
'self.op == cot_ptr or self.op == cot_memptr') and self._set_ptrsize(v)
)

◆ refwidth

refwidth
static
Initial value:
= property(lambda self: self._get_refwidth() if True else 0,
lambda self, v: self._ensure_cond(True, 'True') and self.
_set_refwidth(v))

◆ string

string
static
Initial value:
= property(lambda self: self._get_string() if self.op == cot_str
else None, lambda self, v: self._ensure_cond(self.op == cot_str,
'self.op == cot_str') and self._ensure_no_obj(self._get_string(),
'string', False) and self._acquire_ownership(v, False) and self.
_set_string(v))

◆ thisown

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

◆ v

v = property(lambda self: self.get_v(), lambda self, v: self.set_v(v))
static

◆ x

x
static
Initial value:
= property(lambda self: self._get_x() if op_uses_x(self.op) else None,
lambda self, v: self._ensure_cond(op_uses_x(self.op),
'op_uses_x(self.op)') and self._ensure_no_obj(self._get_x(), 'x',
True) and self._acquire_ownership(v, True) and self._set_x(v))

◆ y

y
static
Initial value:
= property(lambda self: self._get_y() if op_uses_y(self.op) else None,
lambda self, v: self._ensure_cond(op_uses_y(self.op),
'op_uses_y(self.op)') and self._ensure_no_obj(self._get_y(), 'y',
True) and self._acquire_ownership(v, True) and self._set_y(v))

◆ z

z
static
Initial value:
= property(lambda self: self._get_z() if op_uses_z(self.op) else None,
lambda self, v: self._ensure_cond(op_uses_z(self.op),
'op_uses_z(self.op)') and self._ensure_no_obj(self._get_z(), 'z',
True) and self._acquire_ownership(v, True) and self._set_z(v))

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