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

Public Member Functions

bool is_optional (self)
 
bool is_combined (self)
 
bool is_farcall (self)
 
bool is_cleaning_pop (self)
 
bool is_extstx (self)
 
bool is_tailcall (self)
 
bool is_fpinsn (self)
 
bool is_assert (self)
 
bool is_persistent (self)
 
bool is_wild_match (self)
 
bool is_propagatable (self)
 
bool is_ignlowsrc (self)
 
bool is_inverted_jx (self)
 
bool was_noret_icall (self)
 
bool is_multimov (self)
 
bool is_combinable (self)
 
bool was_split (self)
 
bool is_mbarrier (self)
 
bool was_unmerged (self)
 
bool was_unpaired (self)
 
None set_optional (self)
 
None clr_combined (self)
 
None set_farcall (self)
 
None set_cleaning_pop (self)
 
None set_extstx (self)
 
None set_tailcall (self)
 
None clr_tailcall (self)
 
None set_fpinsn (self)
 
None clr_fpinsn (self)
 
None set_assert (self)
 
None clr_assert (self)
 
None set_persistent (self)
 
None set_wild_match (self)
 
None clr_propagatable (self)
 
None set_ignlowsrc (self)
 
None clr_ignlowsrc (self)
 
None set_inverted_jx (self)
 
None set_noret_icall (self)
 
None clr_noret_icall (self)
 
None set_multimov (self)
 
None clr_multimov (self)
 
None set_combinable (self)
 
None clr_combinable (self)
 
None set_mbarrier (self)
 
None set_unmerged (self)
 
None set_split_size (self, int s)
 
int get_split_size (self)
 
 __init__ (self, *args)
 
None swap (self, 'minsn_t' m)
 
str dstr (self)
 
None setaddr (self, ida_idaapi.ea_t new_ea)
 
int optimize_solo (self, int optflags=0)
 
int optimize_subtree (self, 'mblock_t' blk, 'minsn_t' top, 'minsn_t' parent, 'ea_t *' converted_call, int optflags=2)
 
int for_all_ops (self, 'mop_visitor_t' mv)
 
int for_all_insns (self, 'minsn_visitor_t' mv)
 
bool equal_insns (self, 'minsn_t' m, int eqflags)
 
bool __lt__ (self, 'minsn_t' ri)
 
int lexcompare (self, 'minsn_t' ri)
 
bool is_noret_call (self, int flags=0)
 
bool is_unknown_call (self)
 
bool is_helper (self, str name)
 
'minsn_t *' find_call (self, bool with_helpers=False)
 
bool contains_call (self, bool with_helpers=False)
 
bool has_side_effects (self, bool include_ldx_and_divs=False)
 
'funcrole_t' get_role (self)
 
bool is_memcpy (self)
 
bool is_memset (self)
 
bool is_alloca (self)
 
bool is_bswap (self)
 
bool is_readflags (self)
 
bool contains_opcode (self, 'mcode_t' mcode)
 
'minsn_t *' find_opcode (self, 'mcode_t' mcode)
 
'minsn_t *' find_ins_op (self, 'mcode_t' op=m_nop)
 
'mop_t *' find_num_op (self)
 
bool is_mov (self)
 
bool is_like_move (self)
 
bool modifies_d (self)
 
bool modifies_pair_mop (self)
 
bool is_between (self, 'minsn_t' m1, 'minsn_t' m2)
 
bool is_after (self, 'minsn_t' m)
 
bool may_use_aliased_memory (self)
 
int serialize (self, 'bytevec_t *' b)
 
bool deserialize (self, 'uchar const *' bytes, int format_version)
 
 replace_by (self, o)
 

Static Public Attributes

str opcode
 
str iprops
 
str next
 
str prev
 
str ea
 
str l
 
str r
 
str d
 

Protected Member Functions

None _print (self, *args)
 
None _make_nop (self)
 
None _register (self)
 
None _deregister (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

bool thisown
 
 obj_id = property(_obj_id)
 
 meminfo = property(_meminfo)
 

Constructor & Destructor Documentation

◆ __init__()

__init__ ( self,
* args )

Member Function Documentation

◆ __lt__()

bool __lt__ ( self,
'minsn_t' ri )

◆ _acquire_ownership()

_acquire_ownership ( self,
v,
acquire )
protected

◆ _deregister()

None _deregister ( self)
protected

◆ _ensure_cond()

_ensure_cond ( self,
ok,
cond_str )
protected

◆ _ensure_no_obj()

_ensure_no_obj ( self,
o,
attr,
attr_is_acquired )
protected

◆ _ensure_ownership_transferrable()

_ensure_ownership_transferrable ( self,
v )
protected

◆ _make_nop()

None _make_nop ( self)
protected
Convert instruction to nop. This function erases all info but the prev/next fields. In most cases it is better to use mblock_t::make_nop(), which also marks the block lists as dirty. 

◆ _maybe_disown_and_deregister()

_maybe_disown_and_deregister ( self)
protected

◆ _meminfo()

_meminfo ( self)
protected

◆ _obj_id()

'PyObject *' _obj_id ( self)
protected

◆ _own_and_register()

_own_and_register ( self)
protected

◆ _print()

None _print ( self,
* args )
protected

◆ _register()

None _register ( self)
protected

◆ clr_assert()

None clr_assert ( self)

◆ clr_combinable()

None clr_combinable ( self)

◆ clr_combined()

None clr_combined ( self)

◆ clr_fpinsn()

None clr_fpinsn ( self)

◆ clr_ignlowsrc()

None clr_ignlowsrc ( self)

◆ clr_multimov()

None clr_multimov ( self)

◆ clr_noret_icall()

None clr_noret_icall ( self)

◆ clr_propagatable()

None clr_propagatable ( self)

◆ clr_tailcall()

None clr_tailcall ( self)

◆ contains_call()

bool contains_call ( self,
bool with_helpers = False )
Does the instruction contain a call?

◆ contains_opcode()

bool contains_opcode ( self,
'mcode_t' mcode )
Does the instruction have the specified opcode? This function searches subinstructions as well. 

@param mcode: opcode to search for.

◆ deserialize()

bool deserialize ( self,
'uchar const *' bytes,
int format_version )
Deserialize an instruction 

@param bytes: pointer to serialized data
@param format_version: serialization format version. this value is returned by minsn_t::serialize()
@returns success

◆ dstr()

str dstr ( self)
Get displayable text without tags in a static buffer.

◆ equal_insns()

bool equal_insns ( self,
'minsn_t' m,
int eqflags )
Compare instructions. This is the main comparison function for instructions. 

@param m: instruction to compare with
@param eqflags: combination of comparison bits bits

◆ find_call()

'minsn_t *' find_call ( self,
bool with_helpers = False )
Find a call instruction. Check for the current instruction and its subinstructions. 

@param with_helpers: consider helper calls as well?

◆ find_ins_op()

'minsn_t *' find_ins_op ( self,
'mcode_t' op = m_nop )
Find an operand that is a subinsruction with the specified opcode. This function checks only the 'l' and 'r' operands of the current insn. 

@param op: opcode to search for
@returns &l or &r or nullptr

◆ find_num_op()

'mop_t *' find_num_op ( self)
Find a numeric operand of the current instruction. This function checks only the 'l' and 'r' operands of the current insn. 

@returns &l or &r or nullptr

◆ find_opcode()

'minsn_t *' find_opcode ( self,
'mcode_t' mcode )
Find a (sub)insruction with the specified opcode. 

@param mcode: opcode to search for.

◆ for_all_insns()

int for_all_insns ( self,
'minsn_visitor_t' mv )
Visit all instructions. This function visits the instruction itself and all its subinstructions. 

@param mv: instruction visitor
@returns non-zero value returned by mv.visit_mop() or zero

◆ for_all_ops()

int for_all_ops ( self,
'mop_visitor_t' mv )
Visit all instruction operands. This function visits subinstruction operands as well. 

@param mv: operand visitor
@returns non-zero value returned by mv.visit_mop() or zero

◆ get_role()

'funcrole_t' get_role ( self)
Get the function role of a call.

◆ get_split_size()

int get_split_size ( self)

◆ has_side_effects()

bool has_side_effects ( self,
bool include_ldx_and_divs = False )
Does the instruction have a side effect? 

@param include_ldx_and_divs: consider ldx/div/mod as having side effects? stx is always considered as having side effects. Apart from ldx/std only call may have side effects.

◆ is_after()

bool is_after ( self,
'minsn_t' m )
Is the instruction after the specified one? 

@param m: the instruction to compare against in the list

◆ is_alloca()

bool is_alloca ( self)

◆ is_assert()

bool is_assert ( self)

◆ is_between()

bool is_between ( self,
'minsn_t' m1,
'minsn_t' m2 )
Is the instruction in the specified range of instructions? 

@param m1: beginning of the range in the doubly linked list
@param m2: end of the range in the doubly linked list (excluded, may be nullptr) This function assumes that m1 and m2 belong to the same basic block and they are top level instructions.

◆ is_bswap()

bool is_bswap ( self)

◆ is_cleaning_pop()

bool is_cleaning_pop ( self)

◆ is_combinable()

bool is_combinable ( self)

◆ is_combined()

bool is_combined ( self)

◆ is_extstx()

bool is_extstx ( self)

◆ is_farcall()

bool is_farcall ( self)

◆ is_fpinsn()

bool is_fpinsn ( self)

◆ is_helper()

bool is_helper ( self,
str name )
Is a helper call with the specified name? Helper calls usually have well-known function names (see Well known function names) but they may have any other name. The decompiler does not assume any special meaning for non-well-known names. 

◆ is_ignlowsrc()

bool is_ignlowsrc ( self)

◆ is_inverted_jx()

bool is_inverted_jx ( self)

◆ is_like_move()

bool is_like_move ( self)

◆ is_mbarrier()

bool is_mbarrier ( self)

◆ is_memcpy()

bool is_memcpy ( self)

◆ is_memset()

bool is_memset ( self)

◆ is_mov()

bool is_mov ( self)

◆ is_multimov()

bool is_multimov ( self)

◆ is_noret_call()

bool is_noret_call ( self,
int flags = 0 )
Is a non-returing call? 

@param flags: combination of NORET_... bits

◆ is_optional()

bool is_optional ( self)

◆ is_persistent()

bool is_persistent ( self)

◆ is_propagatable()

bool is_propagatable ( self)

◆ is_readflags()

bool is_readflags ( self)

◆ is_tailcall()

bool is_tailcall ( self)

◆ is_unknown_call()

bool is_unknown_call ( self)
Is an unknown call? Unknown calls are calls without the argument list (mcallinfo_t). Usually the argument lists are determined by mba_t::analyze_calls(). Unknown calls exist until the MMAT_CALLS maturity level. See also mblock_t::is_call_block 

◆ is_wild_match()

bool is_wild_match ( self)

◆ lexcompare()

int lexcompare ( self,
'minsn_t' ri )

◆ may_use_aliased_memory()

bool may_use_aliased_memory ( self)
Is it possible for the instruction to use aliased memory?

◆ modifies_d()

bool modifies_d ( self)
Does the instruction modify its 'd' operand? Some instructions (e.g. m_stx) do not modify the 'd' operand. 

◆ modifies_pair_mop()

bool modifies_pair_mop ( self)

◆ optimize_solo()

int optimize_solo ( self,
int optflags = 0 )
Optimize one instruction without context. This function does not have access to the instruction context (the previous and next instructions in the list, the block number, etc). It performs only basic optimizations that are available without this info. 

@param optflags: combination of optimization flags bits
@returns number of changes, 0-unchanged See also mblock_t::optimize_insn()

◆ optimize_subtree()

int optimize_subtree ( self,
'mblock_t' blk,
'minsn_t' top,
'minsn_t' parent,
'ea_t *' converted_call,
int optflags = 2 )
Optimize instruction in its context. Do not use this function, use mblock_t::optimize() 

◆ replace_by()

replace_by ( self,
o )

◆ serialize()

int serialize ( self,
'bytevec_t *' b )
Serialize an instruction 

@param b: the output buffer
@returns the serialization format that was used to store info

◆ set_assert()

None set_assert ( self)

◆ set_cleaning_pop()

None set_cleaning_pop ( self)

◆ set_combinable()

None set_combinable ( self)

◆ set_extstx()

None set_extstx ( self)

◆ set_farcall()

None set_farcall ( self)

◆ set_fpinsn()

None set_fpinsn ( self)

◆ set_ignlowsrc()

None set_ignlowsrc ( self)

◆ set_inverted_jx()

None set_inverted_jx ( self)

◆ set_mbarrier()

None set_mbarrier ( self)

◆ set_multimov()

None set_multimov ( self)

◆ set_noret_icall()

None set_noret_icall ( self)

◆ set_optional()

None set_optional ( self)

◆ set_persistent()

None set_persistent ( self)

◆ set_split_size()

None set_split_size ( self,
int s )

◆ set_tailcall()

None set_tailcall ( self)

◆ set_unmerged()

None set_unmerged ( self)

◆ set_wild_match()

None set_wild_match ( self)

◆ setaddr()

None setaddr ( self,
ida_idaapi.ea_t new_ea )
Change the instruction address. This function modifies subinstructions as well. 

◆ swap()

None swap ( self,
'minsn_t' m )
Swap two instructions. The prev/next fields are not modified by this function because it would corrupt the doubly linked list. 

◆ was_noret_icall()

bool was_noret_icall ( self)

◆ was_split()

bool was_split ( self)

◆ was_unmerged()

bool was_unmerged ( self)

◆ was_unpaired()

bool was_unpaired ( self)

Member Data Documentation

◆ d

str d
static
Initial value:
= property(_ida_hexrays.minsn_t_d_get, _ida_hexrays.
minsn_t_d_set)

◆ ea

str ea
static
Initial value:
= property(_ida_hexrays.minsn_t_ea_get, _ida_hexrays.
minsn_t_ea_set)

◆ iprops

str iprops
static
Initial value:
= property(_ida_hexrays.minsn_t_iprops_get, _ida_hexrays.
minsn_t_iprops_set)

◆ l

str l
static
Initial value:
= property(_ida_hexrays.minsn_t_l_get, _ida_hexrays.
minsn_t_l_set)

◆ next

str next
static
Initial value:
= property(_ida_hexrays.minsn_t_next_get,
_ida_hexrays.minsn_t_next_set)

◆ opcode

str opcode
static
Initial value:
= property(_ida_hexrays.minsn_t_opcode_get,
_ida_hexrays.minsn_t_opcode_set)

◆ prev

str prev
static
Initial value:
= property(_ida_hexrays.minsn_t_prev_get,
_ida_hexrays.minsn_t_prev_set)

◆ r

str r
static
Initial value:
= property(_ida_hexrays.minsn_t_r_get, _ida_hexrays.
minsn_t_r_set)

Property Documentation

◆ meminfo

meminfo = property(_meminfo)
static

◆ obj_id

obj_id = property(_obj_id)
static

◆ thisown

bool 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: