IDAPython 8.4
Loading...
Searching...
No Matches
codegen_t Class Reference

Proxy of C++ codegen_t class.

Inheritance diagram for codegen_t:

Public Member Functions

 __init__ (self, *args, **kwargs)
 
"merror_t" analyze_prolog (self, *args)
 analyze_prolog(self, fc, reachable) -> merror_t Analyze prolog/epilog of the function to decompile.
 
"merror_t" gen_micro (self, *args)
 gen_micro(self) -> merror_t Generate microcode for one instruction.
 
"mreg_t" load_operand (self, *args)
 load_operand(self, opnum, flags=0) -> mreg_t Generate microcode to load one operand.
 
"void" microgen_completed (self, *args)
 microgen_completed(self) This method is called when the microcode generation is done.
 
"merror_t" prepare_gen_micro (self, *args)
 prepare_gen_micro(self) -> merror_t Setup internal data to handle new instruction.
 
"mreg_t" load_effective_address (self, *args)
 load_effective_address(self, n, flags=0) -> mreg_t Generate microcode to calculate the address of a memory operand.
 
"bool" store_operand (self, *args)
 store_operand(self, n, mop, flags=0, outins=None) -> bool Generate microcode to store an operand.
 
"minsn_t *" emit_micro_mvm (self, *args)
 emit_micro_mvm(self, code, dtype, l, r, d, offsize) -> minsn_t Emit one microinstruction.
 
"minsn_t *" emit (self, *args)
 emit(self, code, width, l, r, d, offsize) -> minsn_t Emit one microinstruction.
 

Properties

 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
 
 mba = property(_ida_hexrays.codegen_t_mba_get, _ida_hexrays.codegen_t_mba_set, doc=)
 
 mb = property(_ida_hexrays.codegen_t_mb_get, _ida_hexrays.codegen_t_mb_set, doc=)
 
 insn = property(_ida_hexrays.codegen_t_insn_get, _ida_hexrays.codegen_t_insn_set, doc=)
 
 ignore_micro = property(_ida_hexrays.codegen_t_ignore_micro_get, _ida_hexrays.codegen_t_ignore_micro_set, doc=)
 
 ii = property(_ida_hexrays.codegen_t_ii_get, _ida_hexrays.codegen_t_ii_set, doc=)
 

Constructor & Destructor Documentation

◆ __init__()

__init__ ( self,
* args,
** kwargs )

Member Function Documentation

◆ analyze_prolog()

"merror_t" analyze_prolog ( self,
* args )

If prolog is found, allocate and fill 'mba->pi' structure.

Parameters
fc(C++: const class qflow_chart_t &) flow chart
reachable(C++: const class bitset_t &) bitmap of reachable blocks
Returns
: error code

◆ emit()

"minsn_t *" emit ( self,
* args )

This variant accepts pointers to operands. It is more difficult to use but permits to create virtually any instruction. Operands may be nullptr when it makes sense.

Parameters
code(C++: mcode_t) enum mcode_t
widthint
l(C++: const mop_t *) uval_t
r(C++: const mop_t *) uval_t
d(C++: const mop_t *) uval_t
offsizeint

emit(self, code, l, r, d) -> minsn_t

Parameters
codeenum mcode_t
lmop_t const *
rmop_t const *
dmop_t const *

◆ emit_micro_mvm()

"minsn_t *" emit_micro_mvm ( self,
* args )

This variant takes a data type not a size.

Parameters
code(C++: mcode_t) enum mcode_t
dtype(C++: op_dtype_t)
l(C++: uval_t)
r(C++: uval_t)
d(C++: uval_t)
offsize(C++: int)

◆ gen_micro()

"merror_t" gen_micro ( self,
* args )

The instruction is in INSN

Returns
: MERR_OK - all ok MERR_BLOCK - all ok, need to switch to new block MERR_BADBLK - delete current block and continue other error codes are fatal

◆ load_effective_address()

"mreg_t" load_effective_address ( self,
* args )
Parameters
n(C++: int) - number of INSN operand
flags(C++: int) - reserved for future use
Returns
: register containing the operand address. mr_none - failed (not a memory operand)

◆ load_operand()

"mreg_t" load_operand ( self,
* args )
Parameters
opnum(C++: int) number of INSN operand
flags(C++: int) reserved for future use
Returns
: register containing the operand.

◆ microgen_completed()

"void" microgen_completed ( self,
* args )

◆ prepare_gen_micro()

"merror_t" prepare_gen_micro ( self,
* args )

This method should be called before calling gen_micro(). Usually gen_micro() is called by the decompiler. You have to call this function explicitly only if you yourself call gen_micro(). The instruction is in INSN

Returns
: MERR_OK - all ok other error codes are fatal

◆ store_operand()

"bool" store_operand ( self,
* args )

In case of success an arbitrary number of instructions can be generated (and even no instruction if the source and target are the same)

Parameters
n(C++: int) - number of target INSN operand
mop(C++: const mop_t &) - operand to be stored
flags(C++: int) - reserved for future use
outins(C++: minsn_t **) - (OUT) the last generated instruction
Returns
: success

Property Documentation

◆ ignore_micro

ignore_micro = property(_ida_hexrays.codegen_t_ignore_micro_get, _ida_hexrays.codegen_t_ignore_micro_set, doc=)
static

◆ ii

ii = property(_ida_hexrays.codegen_t_ii_get, _ida_hexrays.codegen_t_ii_set, doc=)
static

◆ insn

insn = property(_ida_hexrays.codegen_t_insn_get, _ida_hexrays.codegen_t_insn_set, doc=)
static

◆ mb

mb = property(_ida_hexrays.codegen_t_mb_get, _ida_hexrays.codegen_t_mb_set, doc=)
static

◆ mba

mba = property(_ida_hexrays.codegen_t_mba_get, _ida_hexrays.codegen_t_mba_set, doc=)
static

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