IDA C++ SDK 9.2
|
Microinstruction class #insn. More...
#include <hexrays.hpp>
Public Member Functions | |
bool | is_optional () const |
bool | is_combined () const |
bool | is_farcall () const |
bool | is_cleaning_pop () const |
bool | is_extstx () const |
bool | is_tailcall () const |
bool | is_fpinsn () const |
bool | is_assert () const |
bool | is_persistent () const |
bool | is_wild_match () const |
bool | is_propagatable () const |
bool | is_ignlowsrc () const |
bool | is_inverted_jx () const |
bool | was_noret_icall () const |
bool | is_multimov () const |
bool | is_combinable () const |
bool | was_split () const |
bool | is_mbarrier () const |
bool | was_unmerged () const |
bool | was_unpaired () const |
void | set_optional () |
void hexapi | set_combined () |
void | clr_combined () |
void | set_farcall () |
void | set_cleaning_pop () |
void | set_extstx () |
void | set_tailcall () |
void | clr_tailcall () |
void | set_fpinsn () |
void | clr_fpinsn () |
void | set_assert () |
void | clr_assert () |
void | set_persistent () |
void | set_wild_match () |
void | clr_propagatable () |
void | set_ignlowsrc () |
void | clr_ignlowsrc () |
void | set_inverted_jx () |
void | set_noret_icall () |
void | clr_noret_icall () |
void | set_multimov () |
void | clr_multimov () |
void | set_combinable () |
void | clr_combinable () |
void | set_mbarrier () |
void | set_unmerged () |
void | set_split_size (int s) |
int | get_split_size () const |
minsn_t (ea_t _ea) | |
Constructor. | |
minsn_t (const minsn_t &m) | |
HEXRAYS_MEMORY_ALLOCATION_FUNCS () minsn_t &operator | |
Assignment operator. It does not copy prev/next fields. | |
void hexapi | print (qstring *vout, int shins_flags=SHINS_SHORT|SHINS_VALNUM) const |
Generate insn text into the buffer. | |
const char *hexapi | dstr () const |
Get displayable text without tags in a static buffer. | |
void hexapi | setaddr (ea_t new_ea) |
Change the instruction address. | |
int | optimize_solo (int optflags=0) |
Optimize one instruction without context. | |
int hexapi | optimize_subtree (mblock_t *blk, minsn_t *top, minsn_t *parent, ea_t *converted_call, int optflags=OPTI_MINSTKREF) |
Optimize instruction in its context. | |
int hexapi | for_all_ops (mop_visitor_t &mv) |
Visit all instruction operands. | |
int hexapi | for_all_insns (minsn_visitor_t &mv) |
Visit all instructions. | |
void hexapi | _make_nop () |
Convert instruction to nop. | |
bool hexapi | equal_insns (const minsn_t &m, int eqflags) const |
Compare instructions. | |
bool | operator< (const minsn_t &ri) const |
Lexographical comparison It can be used to store minsn_t in various containers, like std::set. | |
int hexapi | lexcompare (const minsn_t &ri) const |
bool hexapi | is_noret_call (int flags=0) |
Is a non-returing call? | |
bool | is_unknown_call () const |
Is an unknown call? | |
bool hexapi | is_helper (const char *name) const |
Is a helper call with the specified name? | |
minsn_t *hexapi | find_call (bool with_helpers=false) const |
Find a call instruction. | |
bool | contains_call (bool with_helpers=false) const |
Does the instruction contain a call? | |
bool hexapi | has_side_effects (bool include_ldx_and_divs=false) const |
Does the instruction have a side effect? | |
funcrole_t | get_role () const |
Get the function role of a call. | |
bool | is_memcpy () const |
bool | is_memset () const |
bool | is_alloca () const |
bool | is_bswap () const |
bool | is_readflags () const |
bool | contains_opcode (mcode_t mcode) const |
Does the instruction have the specified opcode? | |
const minsn_t * | find_opcode (mcode_t mcode) const |
Find a (sub)insruction with the specified opcode. | |
minsn_t *hexapi | find_opcode (mcode_t mcode) |
const minsn_t *hexapi | find_ins_op (const mop_t **other, mcode_t op=m_nop) const |
Find an operand that is a subinsruction with the specified opcode. | |
minsn_t * | find_ins_op (mop_t **other, mcode_t op=m_nop) |
const mop_t *hexapi | find_num_op (const mop_t **other) const |
Find a numeric operand of the current instruction. | |
mop_t * | find_num_op (mop_t **other) |
bool | is_mov () const |
bool | is_like_move () const |
bool hexapi | modifies_d () const |
Does the instruction modify its 'd' operand? | |
bool | modifies_pair_mop () const |
bool hexapi | is_between (const minsn_t *m1, const minsn_t *m2) const |
Is the instruction in the specified range of instructions? | |
bool | is_after (const minsn_t *m) const |
Is the instruction after the specified one? | |
bool hexapi | may_use_aliased_memory () const |
Is it possible for the instruction to use aliased memory? | |
int hexapi | serialize (bytevec_t *b) const |
Serialize an instruction. | |
bool hexapi | deserialize (const uchar *bytes, size_t nbytes, int format_version) |
Deserialize an instruction. |
Public Attributes | |
mcode_t | opcode |
instruction opcode | |
int | iprops |
combination of instruction property bits bits | |
minsn_t * | next |
next insn in doubly linked list. check also nexti() | |
minsn_t * | prev |
prev insn in doubly linked list. check also previ() | |
ea_t | ea |
instruction address | |
mop_t | l |
left operand | |
mop_t | r |
right operand | |
mop_t | d |
destination operand |
Microinstruction class #insn.
|
inline |
Constructor.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
minsn_t::HEXRAYS_MEMORY_ALLOCATION_FUNCS | ( | ) | & |
Assignment operator. It does not copy prev/next fields.
Generate insn text into the buffer.
|
inline |
Get displayable text without tags in a static buffer.
Change the instruction address.
This function modifies subinstructions as well.
|
inline |
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.
optflags | combination of optimization flags bits |
|
inline |
Optimize instruction in its context.
Do not use this function, use mblock_t::optimize()
|
inline |
Visit all instruction operands.
This function visits subinstruction operands as well.
mv | operand visitor |
|
inline |
Visit all instructions.
This function visits the instruction itself and all its subinstructions.
mv | instruction visitor |
|
inline |
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.
Compare instructions.
This is the main comparison function for instructions.
m | instruction to compare with |
eqflags | combination of comparison bits bits |
Lexographical comparison It can be used to store minsn_t in various containers, like std::set.
|
inline |
|
inline |
Is a non-returing call?
flags | combination of NORET_... bits |
|
inline |
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
|
inline |
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.
Find a call instruction.
Check for the current instruction and its subinstructions.
with_helpers | consider helper calls as well? |
Does the instruction contain a call?
Does the instruction have a side effect?
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. |
|
inline |
Get the function role of a call.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Does the instruction have the specified opcode?
This function searches subinstructions as well.
mcode | opcode to search for. |
Find a (sub)insruction with the specified opcode.
mcode | opcode to search for. |
Find an operand that is a subinsruction with the specified opcode.
This function checks only the 'l' and 'r' operands of the current insn.
[out] | other | pointer to the other operand (&r if we return &l and vice versa) |
op | opcode to search for |
Find a numeric operand of the current instruction.
This function checks only the 'l' and 'r' operands of the current insn.
[out] | other | pointer to the other operand (&r if we return &l and vice versa) |
|
inline |
|
inline |
|
inline |
Does the instruction modify its 'd' operand?
Some instructions (e.g. m_stx) do not modify the 'd' operand.
|
inline |
Is the instruction in the specified range of instructions?
m1 | beginning of the range in the doubly linked list |
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 the instruction after the specified one?
m | the instruction to compare against in the list |
|
inline |
Is it possible for the instruction to use aliased memory?
|
inline |
Serialize an instruction.
b | the output buffer |
Deserialize an instruction.
bytes | pointer to serialized data |
nbytes | number of bytes to deserialize |
format_version | serialization format version. this value is returned by minsn_t::serialize() |
mcode_t minsn_t::opcode |
instruction opcode
int minsn_t::iprops |
combination of instruction property bits bits
minsn_t* minsn_t::next |
next insn in doubly linked list. check also nexti()
minsn_t* minsn_t::prev |
prev insn in doubly linked list. check also previ()
ea_t minsn_t::ea |
instruction address
mop_t minsn_t::l |
left operand
mop_t minsn_t::r |
right operand
mop_t minsn_t::d |
destination operand