IDAPython 9.0
|
Public Member Functions | |
None | set_impptr_done (self) |
None | set_udt (self) |
None | set_undef_val (self) |
None | set_lowaddr (self) |
bool | is_impptr_done (self) |
bool | is_udt (self) |
bool | probably_floating (self) |
bool | is_undef_val (self) |
bool | is_lowaddr (self) |
bool | is_ccflags (self) |
bool | is_pcval (self) |
bool | is_glbaddr_from_fixup (self) |
__init__ (self, *args) | |
'mop_t &' | assign (self, 'mop_t' rop) |
None | zero (self) |
None | swap (self, 'mop_t' rop) |
None | erase (self) |
None | erase_but_keep_size (self) |
str | dstr (self) |
bool | create_from_mlist (self, 'mba_t' mba, 'mlist_t' lst, int fullsize) |
bool | create_from_ivlset (self, 'mba_t' mba, 'ivlset_t' ivs, int fullsize) |
None | create_from_vdloc (self, 'mba_t' mba, 'vdloc_t' loc, int _size) |
None | create_from_scattered_vdloc (self, 'mba_t' mba, str name, 'tinfo_t' type, 'vdloc_t' loc) |
None | create_from_insn (self, 'minsn_t' m) |
None | make_number (self, *args) |
bool | make_fpnum (self, 'void const *' bytes) |
None | make_reg (self, *args) |
None | make_gvar (self, ida_idaapi.ea_t ea) |
None | make_stkvar (self, 'mba_t' mba, int off) |
None | make_reg_pair (self, int loreg, int hireg, int halfsize) |
None | make_insn (self, 'minsn_t' ins) |
None | make_blkref (self, int blknum) |
None | make_helper (self, str name) |
bool | empty (self) |
bool | is_reg (self, *args) |
bool | is_arglist (self) |
bool | is_cc (self) |
bool | is_bit_reg (self, *args) |
bool | is_kreg (self) |
bool | is_mob (self, int serial) |
bool | is_scattered (self) |
bool | is_glbaddr (self, *args) |
bool | is_stkaddr (self) |
bool | is_insn (self, *args) |
bool | has_side_effects (self, bool include_ldx_and_divs=False) |
bool | may_use_aliased_memory (self) |
bool | is01 (self) |
bool | is_sign_extended_from (self, int nbytes) |
bool | is_zero_extended_from (self, int nbytes) |
bool | is_extended_from (self, int nbytes, bool is_signed) |
bool | equal_mops (self, 'mop_t' rop, int eqflags) |
bool | __eq__ (self, 'mop_t' rop) |
bool | __ne__ (self, 'mop_t' rop) |
bool | __lt__ (self, 'mop_t' rop) |
int | lexcompare (self, 'mop_t' rop) |
int | for_all_ops (self, 'mop_visitor_t' mv, 'tinfo_t' type=None, bool is_target=False) |
int | for_all_scattered_submops (self, 'scif_visitor_t' sv) |
'uint64' | value (self, bool is_signed) |
'int64' | signed_value (self) |
'uint64' | unsigned_value (self) |
None | update_numop_value (self, 'uint64' val) |
bool | is_constant (self, bool is_signed=True) |
bool | is_equal_to (self, 'uint64' n, bool is_signed=True) |
bool | is_zero (self) |
bool | is_one (self) |
bool | is_positive_constant (self) |
bool | is_negative_constant (self) |
'ssize_t' | get_stkvar (self, 'udm_t' udm=None, 'uval_t *' p_idaoff=None) |
bool | get_stkoff (self, 'sval_t *' p_vdoff) |
'minsn_t *' | get_insn (self, 'mcode_t' code) |
bool | make_low_half (self, int width) |
bool | make_high_half (self, int width) |
bool | make_first_half (self, int width) |
bool | make_second_half (self, int width) |
bool | shift_mop (self, int offset) |
bool | change_size (self, int nsize, 'side_effect_t' sideff=WITH_SIDEFF) |
bool | double_size (self, 'side_effect_t' sideff=WITH_SIDEFF) |
bool | preserve_side_effects (self, 'mblock_t' blk, 'minsn_t' top, 'bool *' moved_calls=None) |
None | apply_ld_mcode (self, 'mcode_t' mcode, ida_idaapi.ea_t ea, int newsize) |
None | apply_xdu (self, ida_idaapi.ea_t ea, int newsize) |
None | apply_xds (self, ida_idaapi.ea_t ea, int newsize) |
replace_by (self, o) | |
Static Public Attributes | |
str | t = property(_ida_hexrays.mop_t_t_get, _ida_hexrays.mop_t_t_set) |
str | oprops |
str | valnum |
str | size |
Protected Member Functions | |
None | _print (self, *args) |
None | _make_reg (self, *args) |
None | _make_lvar (self, 'mba_t' mba, int idx, int off=0) |
None | _make_gvar (self, ida_idaapi.ea_t ea) |
None | _make_stkvar (self, 'mba_t' mba, int off) |
None | _make_insn (self, 'minsn_t' ins) |
None | _make_blkref (self, int blknum) |
None | _make_strlit (self, str str) |
None | _make_callinfo (self, 'mcallinfo_t' fi) |
None | _make_cases (self, 'mcases_t' _cases) |
None | _make_pair (self, 'mop_pair_t' _pair) |
None | _register (self) |
None | _deregister (self) |
'mopt_t' | _get_t (self) |
None | _set_t (self, 'mopt_t' v) |
_ensure_no_t (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) | |
'mnumber_t *' | _get_nnn (self) |
None | _set_nnn (self, 'mnumber_t' _v) |
'minsn_t *' | _get_d (self) |
None | _set_d (self, 'minsn_t' _v) |
'stkvar_ref_t *' | _get_s (self) |
None | _set_s (self, 'stkvar_ref_t' _v) |
'mcallinfo_t *' | _get_f (self) |
None | _set_f (self, 'mcallinfo_t' _v) |
'lvar_ref_t *' | _get_l (self) |
None | _set_l (self, 'lvar_ref_t' _v) |
'mop_addr_t *' | _get_a (self) |
None | _set_a (self, 'mop_addr_t' _v) |
'mcases_t *' | _get_c (self) |
None | _set_c (self, 'mcases_t' _v) |
'fnumber_t *' | _get_fpc (self) |
None | _set_fpc (self, 'fnumber_t' _v) |
'mop_pair_t *' | _get_pair (self) |
None | _set_pair (self, 'mop_pair_t' _v) |
'scif_t *' | _get_scif (self) |
None | _set_scif (self, 'scif_t' _v) |
'mreg_t' | _get_r (self) |
None | _set_r (self, 'mreg_t' _v) |
ida_idaapi.ea_t | _get_g (self) |
None | _set_g (self, ida_idaapi.ea_t _v) |
int | _get_b (self) |
None | _set_b (self, int _v) |
str | _get_cstr (self) |
None | _set_cstr (self, str _v) |
str | _get_helper (self) |
None | _set_helper (self, str _v) |
Properties | |
bool | thisown |
obj_id = property(_obj_id) | |
meminfo = property(_meminfo) | |
nnn | |
d | |
s | |
f | |
l | |
a | |
c | |
fpc | |
pair | |
scif | |
r | |
g | |
b | |
cstr | |
helper | |
__init__ | ( | self, | |
* | args ) |
Reimplemented in mcallarg_t, and mop_addr_t.
bool __eq__ | ( | self, | |
'mop_t' | rop ) |
bool __lt__ | ( | self, | |
'mop_t' | rop ) |
bool __ne__ | ( | self, | |
'mop_t' | rop ) |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Create a block reference operand without erasing previous data. @param blknum: block number Note: this function does not erase the previous contents of the operand; call erase() if necessary
|
protected |
Create a call info operand without erasing previous data. @param fi: callinfo Note: this function does not erase the previous contents of the operand; call erase() if necessary
|
protected |
Create a 'switch cases' operand without erasing previous data. Note: this function does not erase the previous contents of the operand; call erase() if necessary
|
protected |
Create a global variable operand without erasing previous data. @param ea: address of the variable Note: this function does not erase the previous contents of the operand; call erase() if necessary
|
protected |
Create a nested instruction without erasing previous data. @param ins: pointer to the instruction to encapsulate into the operand Note: this function does not erase the previous contents of the operand; call erase() if necessary See also create_from_insn, which is higher level
|
protected |
Create a local variable operand. @param mba: pointer to microcode @param idx: index into mba->vars @param off: offset from the beginning of the variable Note: this function does not erase the previous contents of the operand; call erase() if necessary
|
protected |
Create a pair operand without erasing previous data. Note: this function does not erase the previous contents of the operand; call erase() if necessary
|
protected |
This function has the following signatures: 0. _make_reg(reg: mreg_t) -> None 1. _make_reg(reg: mreg_t, _size: int) -> None # 0: _make_reg(reg: mreg_t) -> None Create a register operand without erasing previous data. # 1: _make_reg(reg: mreg_t, _size: int) -> None
|
protected |
Create a stack variable operand. @param mba: pointer to microcode @param off: decompiler stkoff Note: this function does not erase the previous contents of the operand; call erase() if necessary
|
protected |
Create a constant string operand.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Reimplemented in mcallarg_t.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
None apply_ld_mcode | ( | self, | |
'mcode_t' | mcode, | ||
ida_idaapi.ea_t | ea, | ||
int | newsize ) |
Apply a unary opcode to the operand. @param mcode: opcode to apply. it must accept 'l' and 'd' operands but not 'r'. examples: m_low/m_high/m_xds/m_xdu @param ea: value of minsn_t::ea for the newly created insruction @param newsize: new operand size Example: apply_ld_mcode(m_low) will convert op => low(op)
None apply_xds | ( | self, | |
ida_idaapi.ea_t | ea, | ||
int | newsize ) |
None apply_xdu | ( | self, | |
ida_idaapi.ea_t | ea, | ||
int | newsize ) |
bool change_size | ( | self, | |
int | nsize, | ||
'side_effect_t' | sideff = WITH_SIDEFF ) |
Change the operand size. Examples: change_size(AL.1, 2) -> AX.2 change_size(qword_00000008.8, 4) -> dword_00000008.4 change_size(xdu.8(op.4), 4) -> op.4 change_size(#0x12345678.4, 1) -> #0x78.1 @param nsize: new operand size @param sideff: may modify the database because of the size change? @returns success
None create_from_insn | ( | self, | |
'minsn_t' | m ) |
Create operand from an instruction. This function creates a nested instruction that can be used as an operand. Example: if m="add x,y,z", our operand will be (t=mop_d,d=m). The destination operand of 'add' (z) is lost. @param m: instruction to embed into operand. may not be nullptr.
Create operand from ivlset_t. Example: if IVS contains [glbvar..glbvar+4), our operand will be (t=mop_v, g=&glbvar, size=4) @param mba: pointer to microcode @param ivs: set of memory intervals @param fullsize: mba->fullsize @returns success
Create operand from mlist_t. Example: if LST contains 4 bits for R0.4, our operand will be (t=mop_r, r=R0, size=4) @param mba: pointer to microcode @param lst: list of locations @param fullsize: mba->fullsize @returns success
Create operand from scattered vdloc_t. Example: if LOC is (ALOC_DIST, {EAX.4, EDX.4}) and TYPE is _LARGE_INTEGER, our operand will be (t=mop_sc, scif={EAX.4, EDX.4}) @param mba: pointer to microcode @param name: name of the operand, if available @param type: type of the operand, must be present @param loc: a scattered location @returns success
Create operand from vdloc_t. Example: if LOC contains (type=ALOC_REG1, r=R0), our operand will be (t=mop_r, r=R0, size=_SIZE) @param mba: pointer to microcode @param loc: location @param _size: operand size Note: this function cannot handle scattered locations. @returns success
bool double_size | ( | self, | |
'side_effect_t' | sideff = WITH_SIDEFF ) |
str dstr | ( | self | ) |
Reimplemented in mcallarg_t.
bool empty | ( | self | ) |
bool equal_mops | ( | self, | |
'mop_t' | rop, | ||
int | eqflags ) |
Compare operands. This is the main comparison function for operands. @param rop: operand to compare with @param eqflags: combination of comparison bits bits
None erase | ( | self | ) |
None erase_but_keep_size | ( | self | ) |
int for_all_ops | ( | self, | |
'mop_visitor_t' | mv, | ||
'tinfo_t' | type = None, | ||
bool | is_target = False ) |
Visit the operand and all its sub-operands. This function visits the current operand as well. @param mv: visitor object @param type: operand type @param is_target: is a destination operand?
int for_all_scattered_submops | ( | self, | |
'scif_visitor_t' | sv ) |
Visit all sub-operands of a scattered operand. This function does not visit the current operand, only its sub-operands. All sub-operands are synthetic and are destroyed after the visitor. This function works only with scattered operands. @param sv: visitor object
'minsn_t *' get_insn | ( | self, | |
'mcode_t' | code ) |
Get subinstruction of the operand. If the operand has a subinstruction with the specified opcode, return it. @param code: desired opcode @returns pointer to the instruction or nullptr
bool get_stkoff | ( | self, | |
'sval_t *' | p_vdoff ) |
Get the referenced stack offset. This function can also handle mop_sc if it is entirely mapped into a continuous stack region. @param p_vdoff: the output buffer @returns success
'ssize_t' get_stkvar | ( | self, | |
'udm_t' | udm = None, | ||
'uval_t *' | p_idaoff = None ) |
Retrieve the referenced stack variable. @param udm: stkvar, may be nullptr @param p_idaoff: if specified, will hold IDA stkoff after the call. @returns index of stkvar in the frame or -1
bool has_side_effects | ( | self, | |
bool | include_ldx_and_divs = False ) |
Has any side effects? @param include_ldx_and_divs: consider ldx/div/mod as having side effects?
bool is01 | ( | self | ) |
Are the possible values of the operand only 0 and 1? This function returns true for 0/1 constants, bit registers, the result of 'set' insns, etc.
bool is_arglist | ( | self | ) |
Is a list of arguments?
bool is_bit_reg | ( | self, | |
* | args ) |
This function has the following signatures: 0. is_bit_reg() -> bool 1. is_bit_reg(reg: mreg_t) -> bool # 0: is_bit_reg() -> bool # 1: is_bit_reg(reg: mreg_t) -> bool Is a bit register? This includes condition codes and eventually other bit registers
bool is_cc | ( | self | ) |
Is a condition code?
bool is_ccflags | ( | self | ) |
bool is_constant | ( | self, | |
bool | is_signed = True ) |
Retrieve value of a constant integer operand. @param is_signed: should treat the value as signed @returns true if the operand is mop_n
bool is_equal_to | ( | self, | |
'uint64' | n, | ||
bool | is_signed = True ) |
bool is_extended_from | ( | self, | |
int | nbytes, | ||
bool | is_signed ) |
Does the high part of the operand consist of zero or sign bytes?
bool is_glbaddr | ( | self, | |
* | args ) |
This function has the following signatures: 0. is_glbaddr() -> bool 1. is_glbaddr(ea: ida_idaapi.ea_t) -> bool # 0: is_glbaddr() -> bool Is address of a global memory cell? # 1: is_glbaddr(ea: ida_idaapi.ea_t) -> bool Is address of the specified global memory cell?
bool is_glbaddr_from_fixup | ( | self | ) |
bool is_impptr_done | ( | self | ) |
bool is_insn | ( | self, | |
* | args ) |
This function has the following signatures: 0. is_insn() -> bool 1. is_insn(code: mcode_t) -> bool # 0: is_insn() -> bool Is a sub-instruction? # 1: is_insn(code: mcode_t) -> bool Is a sub-instruction with the specified opcode?
bool is_kreg | ( | self | ) |
Is a kernel register?
bool is_lowaddr | ( | self | ) |
bool is_mob | ( | self, | |
int | serial ) |
Is a block reference to the specified block?
bool is_negative_constant | ( | self | ) |
bool is_one | ( | self | ) |
bool is_pcval | ( | self | ) |
bool is_positive_constant | ( | self | ) |
bool is_reg | ( | self, | |
* | args ) |
This function has the following signatures: 0. is_reg() -> bool 1. is_reg(_r: mreg_t) -> bool 2. is_reg(_r: mreg_t, _size: int) -> bool # 0: is_reg() -> bool Is a register operand? See also get_mreg_name() # 1: is_reg(_r: mreg_t) -> bool Is the specified register? # 2: is_reg(_r: mreg_t, _size: int) -> bool Is the specified register of the specified size?
bool is_scattered | ( | self | ) |
Is a scattered operand?
bool is_sign_extended_from | ( | self, | |
int | nbytes ) |
Does the high part of the operand consist of the sign bytes? @param nbytes: number of bytes that were sign extended. the remaining size-nbytes high bytes must be sign bytes Example: is_sign_extended_from(xds.4(op.1), 1) -> true because the high 3 bytes are certainly sign bits
bool is_stkaddr | ( | self | ) |
Is address of a stack variable?
bool is_udt | ( | self | ) |
bool is_undef_val | ( | self | ) |
bool is_zero | ( | self | ) |
bool is_zero_extended_from | ( | self, | |
int | nbytes ) |
Does the high part of the operand consist of zero bytes? @param nbytes: number of bytes that were zero extended. the remaining size-nbytes high bytes must be zero Example: is_zero_extended_from(xdu.8(op.1), 2) -> true because the high 6 bytes are certainly zero
int lexcompare | ( | self, | |
'mop_t' | rop ) |
Reimplemented in mop_addr_t.
None make_blkref | ( | self, | |
int | blknum ) |
Create a global variable operand.
bool make_first_half | ( | self, | |
int | width ) |
Make the first part of the operand. This function does not care about the memory endianness @param width: the desired size of the operand part in bytes @returns success
bool make_fpnum | ( | self, | |
'void const *' | bytes ) |
Create a floating point constant operand. @param bytes: pointer to the floating point value as used by the current processor (e.g. for x86 it must be in IEEE 754) @returns success
None make_gvar | ( | self, | |
ida_idaapi.ea_t | ea ) |
Create a global variable operand.
None make_helper | ( | self, | |
str | name ) |
Create a helper operand. A helper operand usually keeps a built-in function name like "va_start" It is essentially just an arbitrary identifier without any additional info.
bool make_high_half | ( | self, | |
int | width ) |
Make the high part of the operand. This function takes into account the memory endianness (byte sex) @param width: the desired size of the operand part in bytes @returns success
None make_insn | ( | self, | |
'minsn_t' | ins ) |
Create a nested instruction.
bool make_low_half | ( | self, | |
int | width ) |
Make the low part of the operand. This function takes into account the memory endianness (byte sex) @param width: the desired size of the operand part in bytes @returns success
None make_number | ( | self, | |
* | args ) |
Create an integer constant operand. @param _value: value to store in the operand @param _size: size of the value in bytes (1,2,4,8) @param _ea: address of the processor instruction that made the value @param opnum: operand number of the processor instruction
None make_reg | ( | self, | |
* | args ) |
This function has the following signatures: 0. make_reg(reg: mreg_t) -> None 1. make_reg(reg: mreg_t, _size: int) -> None # 0: make_reg(reg: mreg_t) -> None Create a register operand. # 1: make_reg(reg: mreg_t, _size: int) -> None
None make_reg_pair | ( | self, | |
int | loreg, | ||
int | hireg, | ||
int | halfsize ) |
Create pair of registers. @param loreg: register holding the low part of the value @param hireg: register holding the high part of the value @param halfsize: the size of each of loreg/hireg
bool make_second_half | ( | self, | |
int | width ) |
Make the second part of the operand. This function does not care about the memory endianness @param width: the desired size of the operand part in bytes @returns success
None make_stkvar | ( | self, | |
'mba_t' | mba, | ||
int | off ) |
bool may_use_aliased_memory | ( | self | ) |
Is it possible for the operand to use aliased memory?
Move subinstructions with side effects out of the operand. If we decide to delete an instruction operand, it is a good idea to call this function. Alternatively we should skip such operands by calling mop_t::has_side_effects() For example, if we transform: jnz x, x, @blk => goto @blk then we must call this function before deleting the X operands. @param blk: current block @param top: top level instruction that contains our operand @param moved_calls: pointer to the boolean that will track if all side effects get handled correctly. must be false initially. @returns false failed to preserve a side effect, it is not safe to delete the operand true no side effects or successfully preserved them
bool probably_floating | ( | self | ) |
replace_by | ( | self, | |
o ) |
None set_impptr_done | ( | self | ) |
None set_lowaddr | ( | self | ) |
None set_udt | ( | self | ) |
None set_undef_val | ( | self | ) |
bool shift_mop | ( | self, | |
int | offset ) |
Shift the operand. This function shifts only the beginning of the operand. The operand size will be changed. Examples: shift_mop(AH.1, -1) -> AX.2 shift_mop(qword_00000008.8, 4) -> dword_0000000C.4 shift_mop(xdu.8(op.4), 4) -> #0.4 shift_mop(#0x12345678.4, 3) -> #12.1 @param offset: shift count (the number of bytes to shift) @returns success
'int64' signed_value | ( | self | ) |
None swap | ( | self, | |
'mop_t' | rop ) |
'uint64' unsigned_value | ( | self | ) |
None update_numop_value | ( | self, | |
'uint64' | val ) |
'uint64' value | ( | self, | |
bool | is_signed ) |
Retrieve value of a constant integer operand. These functions can be called only for mop_n operands. See is_constant() that can be called on any operand.
None zero | ( | self | ) |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |