ida_hexrays
There are 2 representations of the binary code in the decompiler:
Hex-Rays Decompiler project Copyright (c) 1990-2025 Hex-Rays ALL RIGHTS RESERVED.
microcode: processor instructions are translated into it and then the decompiler optimizes and transforms it
ctree: ctree is built from the optimized microcode and represents AST-like tree with C statements and expressions. It can be printed as C code.
Microcode is represented by the following classes: * mba_t keeps general info about the decompiled code and array of basic blocks. usually mba_t is named ‘mba’ * mblock_t a basic block. includes list of instructions * minsn_t an instruction. contains 3 operands: left, right, and destination * mop_t an operand. depending on its type may hold various info like a number, register, stack variable, etc. * mlist_t list of memory or register locations; can hold vast areas of memory and multiple registers. this class is used very extensively in the decompiler. it may represent list of locations accessed by an instruction or even an entire basic block. it is also used as argument of many functions. for example, there is a function that searches for an instruction that refers to a mlist_t.
See [https://hex-rays.com/blog/microcode-in-pictures](https://hex-rays.com/blog/microcode-in-pictures) for a few pictures. Ctree is represented by: * cfunc_t keeps general info about the decompiled code, including a pointer to mba_t. deleting cfunc_t will delete mba_t too (however, decompiler returns cfuncptr_t, which is a reference counting object and deletes the underlying function as soon as all references to it go out of scope). cfunc_t has ‘body’, which represents the decompiled function body as cinsn_t. * cinsn_t a C statement. can be a compound statement or any other legal C statements (like if, for, while, return, expression-statement, etc). depending on the statement type has pointers to additional info. for example, the ‘if’ statement has poiner to cif_t, which holds the ‘if’ condition, ‘then’ branch, and optionally ‘else’ branch. Please note that despite of the name cinsn_t we say “statements”, not “instructions”. For us instructions are part of microcode, not ctree. * cexpr_t a C expression. is used as part of a C statement, when necessary. cexpr_t has ‘type’ field, which keeps the expression type. * citem_t a base class for cinsn_t and cexpr_t, holds common info like the address, label, and opcode. * cnumber_t a constant 64-bit number. in addition to its value also holds information how to represent it: decimal, hex, or as a symbolic constant (enum member). please note that numbers are represented by another class (mnumber_t) in microcode.
See [https://hex-rays.com/blog/hex-rays-decompiler-primer](https://hex-rays.com/blog/hex-rays-decompiler-primer) for more pictures and more details. Both microcode and ctree use the following class: * lvar_t a local variable. may represent a stack or register variable. a variable has a name, type, location, etc. the list of variables is stored in mba->vars. * lvar_locator_t holds a variable location (vdloc_t) and its definition address. * vdloc_t describes a variable location, like a register number, a stack offset, or, in complex cases, can be a mix of register and stack locations. very similar to argloc_t, which is used in ida. the differences between argloc_t and vdloc_t are: * vdloc_t never uses ARGLOC_REG2 * vdloc_t uses micro register numbers instead of processor register numbers * the stack offsets are never negative in vdloc_t, while in argloc_t there can be negative offsets
The above are the most important classes in this header file. There are many auxiliary classes, please see their definitions in the header file. See also the description of Virtual Machine used by Microcode.
Attributes
ok |
|
no error, switch to new block |
|
internal error |
|
cannot convert to microcode |
|
not enough memory |
|
bad block found |
|
positive sp value has been found |
|
prolog analysis failed |
|
wrong switch idiom |
|
exception analysis failed |
|
stack frame is too big |
|
local variable allocation failed |
|
16-bit functions cannot be decompiled |
|
could not determine call arguments |
|
function frame is wrong |
|
undefined type s (currently unused error code) |
|
inconsistent database information |
|
wrong basic type sizes in compiler settings |
|
redecompilation has been requested |
|
decompilation has been cancelled |
|
max recursion depth reached during lvar allocation |
|
variables would overlap: s |
|
partially initialized variable s |
|
too complex function |
|
no license available |
|
only 32-bit functions can be decompiled for the current database |
|
only 64-bit functions can be decompiled for the current database |
|
already decompiling a function |
|
far memory model is supported only for pc |
|
special segments cannot be decompiled |
|
too big function |
|
bad input ranges |
|
current architecture is not supported |
|
bad instruction in the delay slot |
|
no error, stop the analysis |
|
cloud: s |
|
emulator: s |
|
internal code: redo last loop (never reported) |
|
number format has been defined by the user |
|
temporary internal bit: negation has been performed |
|
temporary internal bit: inverting bits is done |
|
The user asked to negate the constant. |
|
The user asked to invert bits of the constant. |
|
internal bit: stroff or enum is valid for enums: this bit is set immediately for stroffs: this bit is set at the end of decompilation |
|
preserve saved user settings regardless of vars for example, if a var loses all its user-defined attributes or even gets destroyed, keep its lvar_saved_info_t. this is used for ephemeral variables that get destroyed by macro recognition. |
|
split allocation of a new variable. forces the decompiler to create a new variable at ll.defea |
|
variable type should not be a pointer |
|
forbid automatic mapping of the variable |
|
unused argument, corresponds to CVAR_UNUSED |
|
don't propagate assignments to this lvar (CVAR_NOPROP) |
|
Use precise defea's for lvar locations. |
|
apply lvar name |
|
apply lvar type |
|
apply lvar comment |
|
set LVINF_... bits |
|
clear LVINF_... bits |
|
none |
|
register (they exist until MMAT_LVARS) |
|
immediate number constant |
|
immediate string constant (user representation) |
|
result of another instruction |
|
local stack variable (they exist until MMAT_LVARS) |
|
global variable |
|
micro basic block (mblock_t) |
|
list of arguments |
|
local variable |
|
mop_addr_t: address of operand (mop_l, mop_v, mop_S, mop_r) |
|
helper function |
|
mcases |
|
floating point constant |
|
operand pair |
|
scattered |
|
wrong or unexisting operand size |
|
display definition addresses for numbers |
|
display value numbers |
|
do not display use-def chains and other attrs |
|
display address of ldx expressions (not used) |
|
do not display the ea |
|
change operand size but ignore side effects if you decide to keep the changed operand, handle_new_size() must be called |
|
change operand size and handle side effects |
|
only handle side effects |
|
any register size is permitted |
|
any size of floating operand is permitted |
|
imported operand (a pointer) has been dereferenced |
|
a struct or union |
|
possibly floating value |
|
mop_n: a pc-relative value mop_a: an address obtained from a relocation else: value of a condition code register (like mr_cc) |
|
uses undefined value |
|
a low address offset |
|
is used to organize arg/retval of a call such operands should be combined more carefully than others at least on BE platforms |
|
unknown function role |
|
empty, does not do anything (maybe spoils regs) |
|
memset(void *dst, uchar value, size_t count); |
|
memset32(void *dst, uint32 value, size_t count); |
|
memset64(void *dst, uint64 value, size_t count); |
|
strlen(const char *src); |
|
BUG() helper macro: never returns, causes exception. |
|
alloca() function |
|
bswap() function (any size) |
|
present() function (used in patterns) |
|
CONTAINING_RECORD() macro. |
|
__fastfail() |
|
__readeflags, __readcallersflags |
|
is_mul_ok |
|
saturated_mul |
|
[lock] bt |
|
[lock] bts |
|
[lock] btr |
|
[lock] btc |
|
va_arg() macro |
|
va_copy() function |
|
va_start() function |
|
va_end() function |
|
rotate left |
|
rotate right |
|
carry flag after subtract with carry |
|
overflow flag after subtract with carry |
|
integer absolute value |
|
3-way compare helper, returns -1/0/1 |
|
3-way compare helper, returns 0/1/2 |
|
wchar_t *wmemcpy(wchar_t *dst, const wchar_t *src, size_t n) |
|
size_t wcslen(const wchar_t *s) |
|
e.g. _mm_cmpgt_ss |
|
e.g. _mm_cmpgt_sd |
|
__eh_try() try block start |
|
__eh_wind() wind state (C++ destructors) |
|
__eh_catch() catch block start |
|
__eh_catch_type() typed catch clause |
|
__eh_catch_ellipsis() catch-all |
|
__eh_unwind() destructor handler |
|
__eh_throw() throw statement |
|
__eh_try_continuation() internal |
|
__eh_scope_strut() internal |
|
__eh_dead_end_try() internal |
|
__eh_dead_end_wind() internal |
|
__eh_propagate_exception_into_caller() |
|
__eh_continue_unwinding() |
|
__eh_enter_wind_state() internal |
|
__eh_enter_try_state() internal |
|
__eh_exit_wind_state() internal |
|
__eh_exit_try_state() internal |
|
__eh_no_unwind_handler() internal |
|
__eh_caught_type() paired with catch_type |
|
__eh_caught_ellipsis() paired with catch_ellipsis |
|
__eh_caught() internal |
|
__eh_rethrow_uncaught_exception() internal |
|
__eh_unwind_handler_absent() internal |
|
__eh_catch_handler_absent() internal |
|
allocate new object instance |
|
allocate new array |
|
allocate and fill new array |
|
get array length |
|
check and cast object type |
|
test object type (returns 0/1) |
|
acquire lock (monitor enter) |
|
release lock (monitor exit) |
|
get instance field |
|
set instance field |
|
get static field |
|
set static field |
|
get array element |
|
set array element |
|
floating-point remainder (fmod) |
|
instance method call (obj.method) |
|
parent class method call (super.method) |
|
constructor call on new object (merged with new) |
|
constructor chain to parent (super(args)) |
|
constructor chain to self (this(args)) |
|
get caught exception object (Dalvik MOVE_EXCEPTION) |
|
get class reference (Dalvik CONST_CLASS) |
|
fill existing array with constant data (Dalvik FILL_ARRAY_DATA, no allocation) |
|
call has been propagated |
|
some return registers were determined dead |
|
call type is final, should not be changed |
|
call does not return |
|
pure function |
|
call does not have side effects |
|
spoiled/visible_memory lists have been optimized. for some functions we can reduce them as soon as information about the arguments becomes available. in order not to try optimize them again we use this bit. |
|
A function is an synthetic helper combined from several instructions and at least one of them was a call to a real functions |
|
A variadic function with recognized printf- or scanf-style format string |
|
all arglocs are specified explicitly |
|
is chain initialized? (valid only after lvar allocation) |
|
chain operands have been replaced? |
|
overlapped chain |
|
fake chain created by widen_chains() |
|
pass-thru chain, must use the input variable to the block |
|
terminating chain; the variable does not survive across the block |
|
include empty chains |
|
include chains for special registers |
|
enumerate only allocated chains |
|
enumerate only non-allocated chains |
|
consider only chains of the first block |
|
consider only chains of the last block |
|
optional instruction |
|
persistent insn; they are not destroyed |
|
match multiple insns |
|
the purpose of the instruction is to clean stack (e.g. "pop ecx" is often used for that) |
|
floating point insn |
|
call of a far function using push cs/call sequence |
|
tail call |
|
assertion: usually mov #val, op. assertions are used to help the optimizer. assertions are ignored when generating ctree |
|
the instruction has been split: |
|
into 1 byte |
|
into 2 bytes |
|
into 4 bytes |
|
into 8 bytes |
|
insn has been modified because of a partial reference |
|
this is m_ext propagated into m_stx |
|
low part of the instruction source operand has been created artificially (this bit is used only for 'and x, 80...') |
|
inverted conditional jump |
|
was noret icall |
|
bits that can be set by plugins: |
|
may not propagate |
|
may not combine this instruction with others |
|
this instruction acts as a memory barrier (instructions accessing memory may not be reordered past it) |
|
'goto' instruction was transformed info 'call' |
|
instruction is a result of del_dest_pairs() transformation |
|
mov-instruction was initially a memcpy call |
|
optimize all address expressions (&x+N; &x-&y) |
|
may update minstkref |
|
may combine insns (only for optimize_insn) |
|
the function is called after the propagation attempt, we do not optimize low/high(ldx) in this case |
|
forbid using valranges |
|
ignore source operand sizes |
|
ignore instruction opcodes |
|
compare instruction destinations |
|
optimize mop_d operands |
|
unknown block type |
|
stops execution regularly (must be the last block) |
|
does not have successors (tail is a noret function) |
|
passes execution to one block (regular or goto block) |
|
passes execution to two blocks (conditional jump) |
|
passes execution to many blocks (switch idiom) |
|
external block (out of function address) |
|
private block - no instructions except the specified are accepted (used in patterns) |
|
regular block |
|
fake block |
|
this block is a goto target |
|
aritifical call block for tail calls |
|
needs "convert push/pop instructions" |
|
needs "demote 64bits" |
|
needs "combine" pass |
|
needs 'propagation' pass |
|
needs "eliminate deads" pass |
|
use/def lists are ready (not dirty) |
|
inconsistent lists: we are building them |
|
call information has been built |
|
performed backprop_cc |
|
dead end block: doesn't return execution control |
|
block for delay slot |
|
should optimize using value ranges |
|
do not remove even if unreachable |
|
block was inlined, not originally part of mbr |
|
an inlined block with an external frame |
|
search direction |
|
search direction |
|
look for use |
|
look for definition |
|
ignore possible implicit definitions by function calls and indirect memory access |
|
get value ranges before the instruction or at the block start (if M is nullptr) |
|
get value ranges after the instruction or at the block end, just after the last instruction (if M is nullptr) |
|
find exact match. if not set, the returned valrng size will be >= vivl.size |
|
0 cannot handle register arguments in vararg function, discarded them |
|
1 odd caller purged bytes d, correcting |
|
2 invalid function type 's' has been ignored |
|
3 cannot handle tail call to vararg |
|
4 call vararg without local stack |
|
5 too many varargs, some ignored |
|
6 cannot handle address arithmetics in outgoing argument area of stack frame - unused |
|
7 found interdependent unknown calls |
|
8 erroneously detected ellipsis type has been ignored |
|
9 using guessed type s; |
|
10 failed to expand a linear variable |
|
11 failed to widen chains |
|
12 inconsistent function type and number of purged bytes |
|
13 too many cbuild loops |
|
14 could not find valid save-restore pair for s |
|
15 odd input register s |
|
16 odd use of a variable address |
|
17 function return type is incorrect (must be floating point) |
|
18 inconsistent fpu stack |
|
19 self-referencing variable has been detected |
|
20 variables would overlap: s |
|
21 array has been used for an input argument |
|
22 too many input arguments, some ignored |
|
23 incorrect structure member type for s::s, ignored |
|
24 write access to const memory at a has been detected |
|
25 wrong return variable |
|
26 fragmented variable at s may be wrong |
|
27 exceedingly huge offset into the stack frame |
|
28 reference to an uninitialized register has been removed: s |
|
29 fixed broken insn |
|
30 wrong offset of va_list variable |
|
31 CONTAINING_RECORD: no field 's' in struct 's' at d |
|
32 CONTAINING_RECORD: too small offset d for struct 's' |
|
33 user specified stroff has not been processed: s |
|
34 inconsistent variable size for 's' |
|
35 unsupported processor register 's' |
|
36 unaligned function argument 's' |
|
37 corrupted or unexisting local type 's' |
|
38 bad sp value at call |
|
39 wrong markup of switch jump, skipped it |
|
40 positive sp value a has been found |
|
41 wrong sp change point |
|
42 variable 's' is possibly undefined |
|
43 control flows out of bounds |
|
44 values range analysis failed |
|
45 ignored the value written to the shadow area of the succeeding call |
|
46 conditional instruction was optimized away because s |
|
47 returning address of temporary local variable 's' |
|
48 too short map destination 's' for variable 's' |
|
49 bad instruction |
|
50 encountered odd instruction for the current ABI |
|
51 unbalanced stack, ignored a potential tail call |
|
52 mask 0xX is shortened because s <= 0xX" |
|
53 masking with 0XX was optimized away because s <= 0xX |
|
54 simplified comparisons for 's': s became s |
|
55 call arguments overflow the function chunk frame |
|
56 the cases s were optimized away because s |
|
57 illegal frame access |
|
58 inconsistent exception info |
|
59 incompatible types for 's': expected s but encountered s |
|
60 could not fully analyze enum <clinit>; constant order or bodies may be incomplete |
|
may be used in notes as a placeholder when the warning id is not available |
|
microcode does not exist |
|
generated microcode |
|
preoptimized pass is complete |
|
local optimization of each basic block is complete. control flow graph is ready too. |
|
detected call arguments. see also hxe_calls_done |
|
performed the first pass of global optimization |
|
most global optimization passes are done |
|
completed all global optimization. microcode is fixed now. |
|
allocated local variables |
|
delete the instruction |
|
insert the instruction before the current |
|
insert the instruction after the current |
|
global memory: low part |
|
stack: local variables |
|
stack: return address |
|
stack: shadow arguments |
|
stack: regular stack arguments |
|
global memory: high part |
|
use precise defeas for chain-allocated lvars |
|
function is not present, addresses might be wrong |
|
microcode pattern, callinfo is present |
|
loaded gdl, no instructions (debugging) |
|
function returns floating point value |
|
(final_type ? idb_spoiled : spoiled_regs) is valid |
|
has mcallinfo_t::pass_regs |
|
thunk function |
|
stkvars+stkargs should be considered as one area |
|
preoptimization stage complete |
|
request to combine blocks |
|
assertions have been generated |
|
callinfo has been built |
|
assertion have been propagated |
|
save-restore analysis has been performed |
|
return type has been refined |
|
microcode has been optimized globally |
|
lvar pre-allocation has been performed |
|
lvar real allocation has been performed |
|
pairs have been deleted once |
|
can verify chain varnums |
|
use short display |
|
display graph after each reduction |
|
display instruction in graphs |
|
apply transformations to c code |
|
may refine return value size |
|
use wingraph32 (deprecated, see hexrays_config_t::use_external_graph) |
|
display definition addresses for numbers |
|
display value numbers |
|
display EA in line prefix |
|
may verify lvar_names? |
|
accept empty names now? |
|
has overlapped chains? |
|
calculated valranges? |
|
is constructor? |
|
is destructor? |
|
may verify input argument list? |
|
forbid multiple calls with the same ea |
|
forbid multiple lvars with the same ea |
|
return value is undefined |
|
args finally sorted according to ABI (e.g. reverse stkarg order in Borland) |
|
the code16 bit got removed |
|
the return value (or its part) is on the stack |
|
calls to outlined code have been inlined |
|
do not use function frame info (only snippet mode) |
|
allow propagation of more complex variable definitions |
|
Do not verify microcode. This flag is recomended to be set only when debugging decompiler plugins |
|
this index is not used by ida |
|
redo optimization for all blocks. if this bit is not set, only dirty blocks will be optimized |
|
refine return type, ok to fail |
|
refine return type, try harder |
|
perform local propagation (requires ACFL_BLKOPT) |
|
perform interblock transformations |
|
perform global propagation |
|
perform dead code eliminition |
|
may guess calling conventions |
|
do not update minbstkref and minbargref |
|
update minbstkref and minbargref |
|
del the jump insn at the end of the block if it becomes useless |
|
Inlined function has its own (external) frame. |
|
Do not reuse old inlined copy even if it exists. |
|
The inlining call does not push/consume a return address (e.g. an exception funclet spliced into the CFG). Do not reserve a return slot in the external subframe. |
|
registers and stkvars (restricted memory only) |
|
all the above and assertions |
|
only registers calculated with FULL_XDSU |
|
number of chain types |
|
bitmask to represent all chains |
|
reuse existing window |
|
open new window |
|
reuse existing window, only if the currently active widget is a pseudocode view |
|
do not display waitbox if decompilation happens |
|
Create a new file or overwrite existing file. |
|
Create a new file or append to existing file. |
|
Fail if output file already exists. |
|
Silent decompilation. |
|
Send problematic databases to hex-rays.com. |
|
The user can cancel decompilation. |
|
Called from ida's command line. |
|
Print statistics into vd_stats.txt. |
|
Use lumina server. |
|
Print performance stats to ida.log. |
|
a stack variable |
|
is register? otherwise a stack variable |
|
is source operand? |
|
is destination operand? |
|
x, y |
|
x = y |
|
x |= y |
|
x ^= y |
|
x &= y |
|
x += y |
|
x -= y |
|
x *= y |
|
x >>= y signed |
|
x >>= y unsigned |
|
x <<= y |
|
x /= y signed |
|
x /= y unsigned |
|
x %= y signed |
|
x %= y unsigned |
|
x ? y : z |
|
x || y |
|
x && y |
|
x | y |
|
x ^ y |
|
x & y |
|
x == y int or fpu (see EXFL_FPOP) |
|
x != y int or fpu (see EXFL_FPOP) |
|
x >= y signed or fpu (see EXFL_FPOP) |
|
x >= y unsigned |
|
x <= y signed or fpu (see EXFL_FPOP) |
|
x <= y unsigned |
|
x > y signed or fpu (see EXFL_FPOP) |
|
x > y unsigned |
|
x < y signed or fpu (see EXFL_FPOP) |
|
x < y unsigned |
|
x >> y signed |
|
x >> y unsigned |
|
x << y |
|
x + y |
|
x - y |
|
x * y |
|
x / y signed |
|
x / y unsigned |
|
x % y signed |
|
x % y unsigned |
|
x + y fp |
|
x - y fp |
|
x * y fp |
|
x / y fp |
|
-x fp |
|
-x |
|
(type)x |
|
!x |
|
~x |
|
*x, access size in 'ptrsize' |
|
&x |
|
x++ |
|
x- |
|
++x |
|
-x |
|
x(...) |
|
x[y] |
|
x.m |
|
x->m, access size in 'ptrsize' |
|
n |
|
fpc |
|
string constant (user representation) |
|
obj_ea |
|
v |
|
instruction in expression, internal representation only |
|
sizeof(x) |
|
arbitrary name |
|
arbitrary type |
|
instruction types start here |
|
block-statement: { ... } |
|
expression-statement: expr; |
|
if-statement |
|
for-statement |
|
while-statement |
|
do-statement |
|
switch-statement |
|
break-statement |
|
continue-statement |
|
return-statement |
|
goto-statement |
|
asm-statement |
|
C++ try-statement. |
|
C++ throw-statement. |
|
does not exist |
|
just generated |
|
applied first wave of transformations |
|
nicefied expressions |
|
applied second wave of transformations |
|
corrected pointer arithmetic |
|
applied third wave of transformations |
|
added necessary casts |
|
ready-to-use |
|
nothing |
|
, (64 entries are reserved for 64 call arguments) |
|
__asm-line |
|
else-line |
|
do-line |
|
semicolon |
|
: (label) |
|
opening block comment. this comment is printed before the item (other comments are indented and printed after the item) |
|
closing block comment. |
|
C++ try statement. |
|
bit for switch cases |
|
if this bit is set too, then we have a negative case value |
|
Retrieve comment if it has not been used yet. |
|
Retrieve comment even if it has been used. |
|
pointer arithmetic correction done |
|
expression is lvalue even if it doesn't look like it |
|
floating point operation |
|
standalone helper |
|
string literal |
|
type of the expression is considered partial |
|
expression uses undefined value |
|
jump out-of-function |
|
is ptr to vftable (used for cot_memptr, cot_memref) |
|
user-defined cast, not to be removed by CPA |
|
all currently defined bits |
|
print curly braces if necessary |
|
don't print curly braces |
|
print curly braces without any checks |
|
call type is final, should not be changed |
|
created from a decompiler helper function |
|
call does not return |
|
do not maintain parent information |
|
this bit is set by visit...() to prune the walk |
|
maintain parent information |
|
call the leave...() functions |
|
restart enumeration at the top expr (apply_to_exprs) |
|
visit only statements, prune all expressions do not use before the final ctree maturity because expressions may contain statements at intermediate stages (see cot_insn). Otherwise you risk missing statements embedded into expressions. |
|
c-tree item |
|
declaration of local variable |
|
item type preciser |
|
block comment (for ctree items) |
|
undefined |
|
c-tree item |
|
declaration of local variable |
|
the function itself (the very first line with the function prototype) |
|
cursor is at (beyond) the line end (commentable line) |
|
get label of the current item |
|
get goto target |
|
get both |
|
Unused labels cause interr. |
|
Unused labels are permitted. |
|
display ctree item in collapsed form |
|
if-statement condition is inverted (then/else swapped) |
|
display then-branch in collapsed form |
|
display else-branch in collapsed form |
|
'eamap' and 'boundaries' are ready |
|
'sv' is ready (and hdrlines) |
|
local variable definitions are collapsed |
|
cfunc is temporarily locked |
|
do not display waitbox |
|
do not use decompilation cache (snippets are never cached) |
|
do not use function frame info (only snippet mode) |
|
display warnings in the output window |
|
generate microcode for unreachable blocks |
|
do not close display waitbox. see close_hexrays_waitbox() |
|
the default behavior: do not update the global xrefs cache upon decompile() call, but when the pseudocode text is generated (e.g., through cfunc_t.get_pseudocode()) |
|
do not update the global xrefs cache |
|
update the global xrefs cache immediately |
|
return empty mba object (to be used with gen_microcode) |
|
generate code for an outline |
|
Flowchart has been generated. |
|
SP change points have been calculated. |
|
Prolog analysis has been finished. |
|
Microcode has been generated. |
|
Microcode has been preoptimized. |
|
Basic block level optimization has been finished. |
|
Local variables: preallocation step begins. |
|
Global optimization has been finished. If microcode is modified, MERR_LOOP must be returned. It will cause a complete restart of the optimization. |
|
Structure analysis is starting. |
|
Structural analysis has been finished. |
|
Ctree maturity level is being changed. |
|
Internal error has occurred. |
|
Trying to combine instructions of basic block. |
|
Printing ctree and generating text. |
|
Function text has been generated. Plugins may modify the text in cfunc_t::sv. However, it is too late to modify the ctree or microcode. The text uses regular color codes (see lines.hpp) COLOR_ADDR is used to store pointers to ctree items. |
|
The optimizer is about to resolve stack addresses. |
|
Analyzing a call instruction. |
|
A call instruction has been anallyzed. |
|
All calls have been analyzed. |
|
Starting to inline outlined functions. |
|
A set of ranges is going to be inlined. |
|
A set of ranges got inlined. |
|
Collect warning messages from plugins. These warnings will be displayed at the function header, after the user-defined comments. |
|
Flowchart has been generated (ea-based variant). Replaces the deprecated hxe_flowchart which passes a qflow_chart_t* with a raw func_t* inside. |
|
Prolog analysis has been finished (ea-based variant). Replaces the deprecated hxe_prolog which passes a qflow_chart_t* with a raw func_t* inside. |
|
A set of ranges is going to be inlined (ea-based variant). Replaces the deprecated hxe_inlining_func which passes an mba_ranges_t* with a raw func_t* inside. |
|
A set of ranges got inlined (ea-based variant). Replaces the deprecated hxe_inlined_func which passes an mba_ranges_t* with a raw func_t* inside. |
|
New pseudocode view has been opened. |
|
Existing pseudocode view has been reloaded with a new function. Its text has not been refreshed yet, only cfunc and mba pointers are ready. |
|
Existing pseudocode text has been refreshed. Adding/removing pseudocode lines is forbidden in this event. |
|
Pseudocode view is being closed. |
|
Keyboard has been hit. |
|
Mouse right click. Use hxe_populating_popup instead, in case you want to add items in the popup menu. |
|
Mouse double click. |
|
Current cursor position has been changed. (for example, by left-clicking or using keyboard) |
|
Create a hint for the current item. |
|
Decompiled text is ready. |
|
Populating popup menu. We can add menu items now. |
|
Local variable got renamed. |
|
Local variable type got changed. |
|
Local variable comment got changed. |
|
Local variable mapping got changed. |
|
Comment got changed. |
|
Maturity level of an MBA was changed. |
|
Keyboard. |
|
Mouse. |
|
No comment is possible. |
|
Indented comment. |
|
Anterioir block comment. |
|
Posterior block comment. |
|
Local variable comment. |
|
Function comment. |
|
All comments. |
|
is visible? |
|
is valid? |
|
Exceptions
Common base class for all non-exit exceptions. |
Classes
Functions
|
Get the vdui_t instance associated to the TWidget |
|
Check that your plugin is compatible with hex-rays decompiler. This function must be called before calling any other decompiler function. |
|
Find the specified key in boundaries_t. |
|
Insert new (cinsn_t *, rangeset_t) pair into boundaries_t. |
|
Stop working with hex-rays decompiler. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Get textual description of an error code |
|
Must an instruction with the given opcode be the last one in a block? Such opcodes are called closing opcodes. |
|
May opcode be propagated? Such opcodes can be used in sub-instructions (nested instructions) There is a handful of non-propagatable opcodes, like jumps, ret, nop, etc All other regular opcodes are propagatable and may appear in a nested instruction. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Print the specified type info. This function can be used from a debugger by typing "tif->dstr()" |
|
Verify a type string. |
|
Is a small structure or union? |
|
Is definitely a non-boolean type? |
|
Is a boolean type? |
|
Is a pointer or array type? |
|
Is a pointer, array, or function type? |
|
Is struct/union/enum definition (not declaration)? |
|
Calculate number of partial subtypes. |
|
Get a type of a floating point value with the specified width |
|
Create a type info by width and sign. Returns a simple type (examples: int, short) with the given width and sign. |
|
Create a partial type info by width. Returns a partially defined type (examples: _DWORD, _BYTE) with the given width. |
|
Generate a dummy pointer type |
|
Create a pointer type. This function performs the following conversion: "type" -> "type*" |
|
This function has the following signatures: |
|
Get a global type. Global types are types of addressable objects and struct/union/enum types |
|
Set a global type. |
|
Print vdloc. Since vdloc does not always carry the size info, we pass it as NBYTES.. |
|
Do two arglocs overlap? |
|
Restore user defined local variable settings in the database. |
|
Save user defined local variable settings into the database. |
|
Modify saved local variable settings. |
|
Modify saved local variable settings of one variable. |
|
Find a variable by name. |
|
Rename a local variable. |
|
Restore user defined function calls from the database. |
|
Save user defined local function calls into the database. |
|
Convert function type declaration into internal structure |
|
try to generate user-defined call for an instruction |
|
register/unregister non-standard microcode generator |
|
Get list of temporary registers. Tempregs are temporary registers that are used during code generation. They do not map to regular processor registers. They are used only to store temporary values during execution of one instruction. Tempregs may not be used to pass a value from one block to another. In other words, at the end of a block all tempregs must be dead. |
|
Is a kernel register? Kernel registers are temporary registers that can be used freely. They may be used to store values that cross instruction or basic block boundaries. Kernel registers do not map to regular processor registers. See also mba_t::alloc_kreg() |
|
Map a processor register to a microregister. |
|
Map a microregister to a processor register. |
|
Get the microregister name. |
|
|
|
Is this an EH exception handling role? |
|
Skip assertions forward. |
|
Skip assertions backward. |
|
Add a user-defined microinstruction action. This is a standalone version that loads user minsns from the database, adds the action, and saves back. Use it when an mba_t is not available. |
|
Delete a user-defined microinstruction action. This is a standalone version that loads user minsns from the database, deletes the action, and saves back. Use it when an mba_t is not available. |
|
Parse DIRECTIVE and update the current configuration variables. For the syntax see hexrays.cfg |
|
Get decompiler version. The returned string is of the form <major>.<minor>.<revision>.<build-date> |
|
Open pseudocode window. The specified function is decompiled and the pseudocode window is opened. |
|
Close pseudocode window. |
|
Batch decompilation. Decompile all or the specified functions |
|
Send the database to Hex-Rays. This function sends the current database to the Hex-Rays server. The database is sent in the compressed form over an encrypted (SSL) connection. |
|
Get the instruction operand under the cursor. This function determines the operand that is under the cursor in the active disassembly listing. If the operand refers to a register or stack variable, it returns true. |
|
|
|
Negate a comparison operator. For example, cot_sge becomes cot_slt. |
|
Swap a comparison operator. For example, cot_sge becomes cot_sle. |
|
Get operator sign. Meaningful for sign-dependent operators, like cot_sdiv. |
|
Convert plain operator into assignment operator. For example, cot_add returns cot_asgadd. |
|
Convert assignment operator into plain operator. For example, cot_asgadd returns cot_add |
|
Does operator use the 'x' field of cexpr_t? |
|
Does operator use the 'y' field of cexpr_t? |
|
Does operator use the 'z' field of cexpr_t? |
|
Is binary operator? |
|
Is unary operator? |
|
Is comparison operator? |
|
Is assignment operator? |
|
|
|
Is pre/post increment/decrement operator? |
|
Is commutative operator? |
|
Is additive operator? |
|
Is multiplicative operator? |
|
Is bit related operator? |
|
Is logical operator? |
|
Is loop statement code? |
|
Does a break statement influence the specified statement code? |
|
Is Lvalue operator? |
|
Is the operator allowed on small structure or union? |
|
Save user defined labels into the database. |
|
Save user defined comments into the database. |
|
Save user defined number formats into the database. |
|
Save user defined citem iflags into the database. |
|
Save user defined union field selections into the database. |
|
Save user defined casts into the database. |
|
Restore user defined casts from the database. |
|
Restore user defined labels from the database. |
|
Restore user defined comments from the database. |
|
Restore user defined number formats from the database. |
|
Restore user defined citem iflags from the database. |
|
Restore user defined union field selections from the database. |
|
Close the waitbox displayed by the decompiler. Useful if DECOMP_NO_HIDE was used during decompilation. |
|
Decompile a snippet or a function. |
|
Decompile a function (ea-based variant). Multiple decompilations of the same function return the same object. Replaces the deprecated decompile_func(func_t *). |
|
Create a new cfunc_t object. |
|
Flush the cached decompilation results. Erases a cache entry for the specified function. |
|
Flush all cached decompilation results. |
|
Do we have a cached decompilation result for 'ea'? |
|
Return the start EAs of all cached cfunc_t objects. |
|
|
|
|
|
Select UDT |
|
Get reference to the current map key. |
|
Get reference to the current map value. |
|
Find the specified key in user_numforms_t. |
|
Insert new (operand_locator_t, number_format_t) pair into user_numforms_t. |
|
Get iterator pointing to the beginning of user_numforms_t. |
|
Get iterator pointing to the end of user_numforms_t. |
|
Move to the next element. |
|
Move to the previous element. |
|
Erase current element from user_numforms_t. |
|
Clear user_numforms_t. |
|
Get size of user_numforms_t. |
|
Delete user_numforms_t instance. |
|
Create a new user_numforms_t instance. |
|
Get reference to the current map key. |
|
Get reference to the current map value. |
|
Find the specified key in lvar_mapping_t. |
|
Insert new (lvar_locator_t, lvar_locator_t) pair into lvar_mapping_t. |
|
Get iterator pointing to the beginning of lvar_mapping_t. |
|
Get iterator pointing to the end of lvar_mapping_t. |
|
Move to the next element. |
|
Move to the previous element. |
|
Erase current element from lvar_mapping_t. |
|
Clear lvar_mapping_t. |
|
Get size of lvar_mapping_t. |
|
Delete lvar_mapping_t instance. |
|
Create a new lvar_mapping_t instance. |
|
Get reference to the current map key. |
|
Get reference to the current map value. |
|
Find the specified key in udcall_map_t. |
|
Insert new (ea_t, udcall_t) pair into udcall_map_t. |
|
Get iterator pointing to the beginning of udcall_map_t. |
|
Get iterator pointing to the end of udcall_map_t. |
|
Move to the next element. |
|
Move to the previous element. |
|
Erase current element from udcall_map_t. |
|
Clear udcall_map_t. |
|
Get size of udcall_map_t. |
|
Delete udcall_map_t instance. |
|
Create a new udcall_map_t instance. |
|
Get reference to the current map key. |
|
Get reference to the current map value. |
|
Find the specified key in user_cmts_t. |
|
Insert new (treeloc_t, citem_cmt_t) pair into user_cmts_t. |
|
Get iterator pointing to the beginning of user_cmts_t. |
|
Get iterator pointing to the end of user_cmts_t. |
|
Move to the next element. |
|
Move to the previous element. |
|
Erase current element from user_cmts_t. |
|
Clear user_cmts_t. |
|
Get size of user_cmts_t. |
|
Delete user_cmts_t instance. |
|
Create a new user_cmts_t instance. |
|
Get reference to the current map key. |
|
Get reference to the current map value. |
|
Find the specified key in user_iflags_t. |
|
Insert new (citem_locator_t, int32) pair into user_iflags_t. |
|
Get iterator pointing to the beginning of user_iflags_t. |
|
Get iterator pointing to the end of user_iflags_t. |
|
Move to the next element. |
|
Move to the previous element. |
|
Erase current element from user_iflags_t. |
|
Clear user_iflags_t. |
|
Get size of user_iflags_t. |
|
Delete user_iflags_t instance. |
|
Create a new user_iflags_t instance. |
|
Get reference to the current map key. |
|
Get reference to the current map value. |
|
Find the specified key in user_casts_t. |
|
Insert new (citem_locator_t, tinfo_t) pair into user_casts_t. |
|
Get iterator pointing to the beginning of user_casts_t. |
|
Get iterator pointing to the end of user_casts_t. |
|
Move to the next element. |
|
Move to the previous element. |
|
Erase current element from user_casts_t. |
|
Clear user_casts_t. |
|
Get size of user_casts_t. |
|
Delete user_casts_t instance. |
|
Create a new user_casts_t instance. |
|
Get reference to the current map key. |
|
Get reference to the current map value. |
|
Find the specified key in user_unions_t. |
|
Insert new (ea_t, intvec_t) pair into user_unions_t. |
|
Get iterator pointing to the beginning of user_unions_t. |
|
Get iterator pointing to the end of user_unions_t. |
|
Move to the next element. |
|
Move to the previous element. |
|
Erase current element from user_unions_t. |
|
Clear user_unions_t. |
|
Get size of user_unions_t. |
|
Delete user_unions_t instance. |
|
Create a new user_unions_t instance. |
|
Get reference to the current map key. |
|
Get reference to the current map value. |
|
Find the specified key in user_labels_t. |
|
Insert new (int, qstring) pair into user_labels_t. |
|
Get iterator pointing to the beginning of user_labels_t. |
|
Get iterator pointing to the end of user_labels_t. |
|
Move to the next element. |
|
Move to the previous element. |
|
Erase current element from user_labels_t. |
|
Clear user_labels_t. |
|
Get size of user_labels_t. |
|
Delete user_labels_t instance. |
|
Create a new user_labels_t instance. |
|
Get reference to the current map key. |
|
Get reference to the current map value. |
|
Find the specified key in eamap_t. |
|
Insert new (ea_t, cinsnptrvec_t) pair into eamap_t. |
|
Get iterator pointing to the beginning of eamap_t. |
|
Get iterator pointing to the end of eamap_t. |
|
Move to the next element. |
|
Move to the previous element. |
|
Erase current element from eamap_t. |
|
Clear eamap_t. |
|
Get size of eamap_t. |
|
Delete eamap_t instance. |
|
Create a new eamap_t instance. |
|
Get reference to the current map key. |
|
Get reference to the current map value. |
|
Get iterator pointing to the beginning of boundaries_t. |
|
Get iterator pointing to the end of boundaries_t. |
|
Move to the next element. |
|
Move to the previous element. |
|
Erase current element from boundaries_t. |
|
Clear boundaries_t. |
|
Get size of boundaries_t. |
|
Delete boundaries_t instance. |
|
Create a new boundaries_t instance. |
|
Get reference to the current set value. |
|
Find the specified key in set block_chains_t. |
|
Insert new (chain_t) into set block_chains_t. |
|
Get iterator pointing to the beginning of block_chains_t. |
|
Get iterator pointing to the end of block_chains_t. |
|
Move to the next element. |
|
Move to the previous element. |
|
Erase current element from block_chains_t. |
|
Clear block_chains_t. |
|
Get size of block_chains_t. |
|
Delete block_chains_t instance. |
|
Create a new block_chains_t instance. |
|
Decompile a snippet or a function. |
|
cast the citem_t object to its more specific type, either cexpr_t or cinsn_t. |
|
|
|
return a dictionary with the operands of a cexpr_t. |
|
return the details pointer for the cinsn_t object depending on the value of its op member. this is one of the cblock_t, cif_t, etc. objects. |
|
Get the function's return type tinfo_t object. |
|
Logically negate the specified expression. The specified expression will be logically negated. For example, "x == y" is converted into "x != y" by this function. |
|
Create a reference. This function performs the following conversion: "obj" => "&obj". It can handle casts, annihilate "&*", and process other special cases. |
|
Dereference a pointer. This function dereferences a pointer expression. It performs the following conversion: "ptr" => "*ptr" It can handle discrepancies in the pointer type and the access size. |
|
Create a helper call. |
Create a new block-statement. |
|
|
Create a number expression |
|
Create a helper object.. |
|
Install handler for decompiler events. |
|
Uninstall handler for decompiler events. |
Module Contents
- ida_hexrays.get_widget_vdui(f: TWidget *) vdui_t *
Get the vdui_t instance associated to the TWidget
- Parameters:
f – pointer to window
- Returns:
a vdui_t *, or nullptr
- ida_hexrays.init_hexrays_plugin(flags: int = 0) bool
Check that your plugin is compatible with hex-rays decompiler. This function must be called before calling any other decompiler function.
- Parameters:
flags – reserved, must be 0
- Returns:
true if the decompiler exists and is compatible with your plugin
- ida_hexrays.boundaries_find(map: boundaries_t, key: cinsn_t) boundaries_iterator_t
Find the specified key in boundaries_t.
- ida_hexrays.boundaries_insert(map: boundaries_t, key: cinsn_t, val: rangeset_t) boundaries_iterator_t
Insert new (cinsn_t *, rangeset_t) pair into boundaries_t.
- class ida_hexrays.hexwarns_t(*args)
Bases:
object- thisown
- push_back(*args) hexwarn_t &
- swap(r: hexwarns_t) None
- extract() hexwarn_t *
- begin(*args) qvector< hexwarn_t >::const_iterator
- end(*args) qvector< hexwarn_t >::const_iterator
- erase(*args) qvector< hexwarn_t >::iterator
- find(*args) qvector< hexwarn_t >::const_iterator
- extend(x: hexwarns_t) None
- front
- back
- class ida_hexrays.user_numforms_t
Bases:
object- thisown
- at(_Keyval: operand_locator_t) number_format_t &
- class ida_hexrays.ctree_items_t(*args)
Bases:
object- thisown
- push_back(*args) citem_t *&
- swap(r: ctree_items_t) None
- extract() citem_t **
- begin(*args) qvector< citem_t * >::const_iterator
- end(*args) qvector< citem_t * >::const_iterator
- insert(it: qvector< citem_t * >::iterator, x: citem_t) qvector< citem_t * >::iterator
- erase(*args) qvector< citem_t * >::iterator
- find(*args) qvector< citem_t * >::const_iterator
- extend(x: ctree_items_t) None
- front
- back
- class ida_hexrays.user_labels_t
Bases:
object- thisown
- at(_Keyval: int const &) _qstring< char > &
- class ida_hexrays.user_unions_t
Bases:
object- thisown
- at(_Keyval: unsigned long long const &) qvector< int > &
- class ida_hexrays.user_iflags_t
Bases:
object- thisown
- at(_Keyval: citem_locator_t) int &
- class ida_hexrays.cinsnptrvec_t(*args)
Bases:
object- thisown
- push_back(*args) cinsn_t *&
- swap(r: cinsnptrvec_t) None
- extract() cinsn_t **
- begin(*args) qvector< cinsn_t * >::const_iterator
- end(*args) qvector< cinsn_t * >::const_iterator
- insert(it: qvector< cinsn_t * >::iterator, x: cinsn_t) qvector< cinsn_t * >::iterator
- erase(*args) qvector< cinsn_t * >::iterator
- find(*args) qvector< cinsn_t * >::const_iterator
- extend(x: cinsnptrvec_t) None
- front
- back
- class ida_hexrays.eamap_t
Bases:
object- thisown
- at(_Keyval: unsigned long long const &) cinsnptrvec_t &
- class ida_hexrays.cfuncptr_t(*args)
Bases:
object- thisown
- entry_ea: ida_idaapi.ea_t
- mba: mba_t *
- argidx: intvec_t &
- maturity: ctree_maturity_t
- user_labels: user_labels_t *
- user_cmts: user_cmts_t *
- numforms: user_numforms_t *
- user_iflags: user_iflags_t *
- user_unions: user_unions_t *
- treeitems: citem_pointers_t
- user_casts: user_casts_t *
- print_func(vp: vc_printer_t) None
- get_lvars() lvars_t *
- get_user_iflags(loc: citem_locator_t) int
- set_user_iflags(loc: citem_locator_t, iflags: int) None
- get_user_union_selection(ea: ida_idaapi.ea_t, path: intvec_t) bool
- set_user_union_selection(ea: ida_idaapi.ea_t, path: intvec_t) None
- get_user_cast(loc: citem_locator_t) tinfo_t
- set_user_cast(loc: citem_locator_t, type: tinfo_t) None
- get_line_item(line: str, x: int, is_ctree_line: bool, phead: ctree_item_t, pitem: ctree_item_t, ptail: ctree_item_t) bool
- get_warnings() hexwarns_t &
- get_eamap() eamap_t &
- get_boundaries() boundaries_t &
- get_pseudocode() strvec_t const &
- gather_derefs(ci: ctree_item_t, udm: udt_type_data_t = None) bool
- find_item_coords(*args)
This method has the following signatures:
find_item_coords(item: citem_t) -> Tuple[int, int]
find_item_coords(item: citem_t, x: int_pointer, y: int_pointer) -> bool
NOTE: The second form is retained for backward-compatibility, but we strongly recommend using the first.
- Parameters:
item – The item to find coordinates for in the pseudocode listing
- deserialize(mba: mba_t, bytes: uchar const *) cfunc_t *
- class ida_hexrays.qvector_history_t(*args)
Bases:
object- thisown
- push_back(*args) history_item_t &
- swap(r: qvector_history_t) None
- extract() history_item_t *
- inject(s: history_item_t, len: int) None
- begin(*args) qvector< history_item_t >::const_iterator
- end(*args) qvector< history_item_t >::const_iterator
- insert(it: history_item_t, x: history_item_t) qvector< history_item_t >::iterator
- erase(*args) qvector< history_item_t >::iterator
- find(*args) qvector< history_item_t >::const_iterator
- has(x: history_item_t) bool
- add_unique(x: history_item_t) bool
- append(x: history_item_t) None
- extend(x: qvector_history_t) None
- front
- back
- class ida_hexrays.history_t
Bases:
qvector_history_t- thisown
- pop() history_item_t
- top(*args) history_item_t &
- push(v: history_item_t) None
- class ida_hexrays.cinsn_list_t(*args)
Bases:
object- thisown
- swap(x: cinsn_list_t) None
- front(*args) cinsn_t const &
- back(*args) cinsn_t const &
- rbegin(*args) qlist< cinsn_t >::const_reverse_iterator
- rend(*args) qlist< cinsn_t >::const_reverse_iterator
- push_back(*args) cinsn_t &
- splice(pos: qlist< cinsn_t >::iterator, other: cinsn_list_t, first: qlist< cinsn_t >::iterator, last: qlist< cinsn_t >::iterator) None
- find(item)
- index(item)
- at(index)
- begin() cinsn_list_t_iterator
- end() cinsn_list_t_iterator
- insert(*args) cinsn_list_t_iterator
- erase(p: cinsn_list_t_iterator) None
- class ida_hexrays.qvector_carg_t(*args)
Bases:
object- thisown
- push_back(*args) carg_t &
- swap(r: qvector_carg_t) None
- extract() carg_t *
- begin(*args) qvector< carg_t >::const_iterator
- end(*args) qvector< carg_t >::const_iterator
- erase(*args) qvector< carg_t >::iterator
- find(*args) qvector< carg_t >::const_iterator
- extend(x: qvector_carg_t) None
- front
- back
- class ida_hexrays.qvector_ccase_t(*args)
Bases:
object- thisown
- push_back(*args) ccase_t &
- swap(r: qvector_ccase_t) None
- extract() ccase_t *
- begin(*args) qvector< ccase_t >::const_iterator
- end(*args) qvector< ccase_t >::const_iterator
- erase(*args) qvector< ccase_t >::iterator
- find(*args) qvector< ccase_t >::const_iterator
- extend(x: qvector_ccase_t) None
- front
- back
- class ida_hexrays.qvector_catchexprs_t(*args)
Bases:
object- thisown
- push_back(*args) catchexpr_t &
- swap(r: qvector_catchexprs_t) None
- extract() catchexpr_t *
- inject(s: catchexpr_t, len: int) None
- begin(*args) qvector< catchexpr_t >::const_iterator
- end(*args) qvector< catchexpr_t >::const_iterator
- insert(it: catchexpr_t, x: catchexpr_t) qvector< catchexpr_t >::iterator
- erase(*args) qvector< catchexpr_t >::iterator
- find(*args) qvector< catchexpr_t >::const_iterator
- has(x: catchexpr_t) bool
- add_unique(x: catchexpr_t) bool
- append(x: catchexpr_t) None
- extend(x: qvector_catchexprs_t) None
- front
- back
- class ida_hexrays.qvector_ccatchvec_t(*args)
Bases:
object- thisown
- push_back(*args) ccatch_t &
- swap(r: qvector_ccatchvec_t) None
- extract() ccatch_t *
- begin(*args) qvector< ccatch_t >::const_iterator
- end(*args) qvector< ccatch_t >::const_iterator
- erase(*args) qvector< ccatch_t >::iterator
- find(*args) qvector< ccatch_t >::const_iterator
- extend(x: qvector_ccatchvec_t) None
- front
- back
- class ida_hexrays.cblock_posvec_t(*args)
Bases:
object- thisown
- push_back(*args) cblock_pos_t &
- swap(r: cblock_posvec_t) None
- extract() cblock_pos_t *
- inject(s: cblock_pos_t, len: int) None
- begin(*args) qvector< cblock_pos_t >::const_iterator
- end(*args) qvector< cblock_pos_t >::const_iterator
- insert(it: cblock_pos_t, x: cblock_pos_t) qvector< cblock_pos_t >::iterator
- erase(*args) qvector< cblock_pos_t >::iterator
- append(x: cblock_pos_t) None
- extend(x: cblock_posvec_t) None
- front
- back
- class ida_hexrays.ui_stroff_ops_t(*args)
Bases:
object- thisown
- push_back(*args) ui_stroff_op_t &
- swap(r: ui_stroff_ops_t) None
- extract() ui_stroff_op_t *
- inject(s: ui_stroff_op_t, len: int) None
- begin(*args) qvector< ui_stroff_op_t >::const_iterator
- end(*args) qvector< ui_stroff_op_t >::const_iterator
- insert(it: ui_stroff_op_t, x: ui_stroff_op_t) qvector< ui_stroff_op_t >::iterator
- erase(*args) qvector< ui_stroff_op_t >::iterator
- find(*args) qvector< ui_stroff_op_t >::const_iterator
- has(x: ui_stroff_op_t) bool
- add_unique(x: ui_stroff_op_t) bool
- append(x: ui_stroff_op_t) None
- extend(x: ui_stroff_ops_t) None
- front
- back
- class ida_hexrays.array_of_bitsets(*args)
Bases:
object- thisown
- push_back(*args) bitset_t &
- swap(r: array_of_bitsets) None
- extract() bitset_t *
- begin(*args) qvector< bitset_t >::const_iterator
- end(*args) qvector< bitset_t >::const_iterator
- erase(*args) qvector< bitset_t >::iterator
- find(*args) qvector< bitset_t >::const_iterator
- extend(x: array_of_bitsets) None
- front
- back
- class ida_hexrays.mopvec_t(*args)
Bases:
object- thisown
- push_back(*args) mop_t &
- extract() mop_t *
- begin(*args) qvector< mop_t >::const_iterator
- end(*args) qvector< mop_t >::const_iterator
- erase(*args) qvector< mop_t >::iterator
- find(*args) qvector< mop_t >::const_iterator
- front
- back
- class ida_hexrays.mcallargs_t(*args)
Bases:
object- thisown
- push_back(*args) mcallarg_t &
- swap(r: mcallargs_t) None
- extract() mcallarg_t *
- inject(s: mcallarg_t, len: int) None
- begin(*args) qvector< mcallarg_t >::const_iterator
- end(*args) qvector< mcallarg_t >::const_iterator
- insert(it: mcallarg_t, x: mcallarg_t) qvector< mcallarg_t >::iterator
- erase(*args) qvector< mcallarg_t >::iterator
- find(*args) qvector< mcallarg_t >::const_iterator
- has(x: mcallarg_t) bool
- add_unique(x: mcallarg_t) bool
- append(x: mcallarg_t) None
- extend(x: mcallargs_t) None
- front
- back
- class ida_hexrays.block_chains_vec_t(*args)
Bases:
object- thisown
- push_back(*args) block_chains_t &
- swap(r: block_chains_vec_t) None
- extract() block_chains_t *
- inject(s: block_chains_t, len: int) None
- begin(*args) qvector< block_chains_t >::const_iterator
- end(*args) qvector< block_chains_t >::const_iterator
- insert(it: block_chains_t, x: block_chains_t) qvector< block_chains_t >::iterator
- erase(*args) qvector< block_chains_t >::iterator
- append(x: block_chains_t) None
- extend(x: block_chains_vec_t) None
- front
- back
- class ida_hexrays.lvar_mapping_t
Bases:
object- thisown
- at(_Keyval: lvar_locator_t) lvar_locator_t &
- class ida_hexrays.qvector_lvar_t(*args)
Bases:
object- thisown
- push_back(*args) lvar_t &
- swap(r: qvector_lvar_t) None
- extract() lvar_t *
- begin(*args) qvector< lvar_t >::const_iterator
- end(*args) qvector< lvar_t >::const_iterator
- erase(*args) qvector< lvar_t >::iterator
- find(*args) qvector< lvar_t >::const_iterator
- extend(x: qvector_lvar_t) None
- front
- back
- class ida_hexrays.lvar_saved_infos_t(*args)
Bases:
object- thisown
- push_back(*args) lvar_saved_info_t &
- swap(r: lvar_saved_infos_t) None
- extract() lvar_saved_info_t *
- inject(s: lvar_saved_info_t, len: int) None
- begin(*args) qvector< lvar_saved_info_t >::const_iterator
- end(*args) qvector< lvar_saved_info_t >::const_iterator
- insert(it: lvar_saved_info_t, x: lvar_saved_info_t) qvector< lvar_saved_info_t >::iterator
- erase(*args) qvector< lvar_saved_info_t >::iterator
- find(*args) qvector< lvar_saved_info_t >::const_iterator
- has(x: lvar_saved_info_t) bool
- add_unique(x: lvar_saved_info_t) bool
- append(x: lvar_saved_info_t) None
- extend(x: lvar_saved_infos_t) None
- front
- back
- class ida_hexrays.Hexrays_Hooks(_flags: int = 0, _hkcb_flags: int = 1)
Bases:
object- thisown
- flowchart(fc: qflow_chart_t, mba: mba_t, reachable_blocks: bitset_t, decomp_flags: int) int
Flowchart has been generated.
- stkpnts(mba: mba_t, _sps: stkpnts_t *) int
SP change points have been calculated.
- Parameters:
mba – (mba_t *)
- Returns:
Microcode error code This event is generated for each inlined range as well.
- prolog(mba: mba_t, fc: qflow_chart_t, reachable_blocks: bitset_t, decomp_flags: int) int
Prolog analysis has been finished.
- microcode(mba: mba_t) int
Microcode has been generated.
- Parameters:
mba – (mba_t *)
- Returns:
Microcode error code
- preoptimized(mba: mba_t) int
Microcode has been preoptimized.
- Parameters:
mba – (mba_t *)
- Returns:
Microcode error code
- locopt(mba: mba_t) int
Basic block level optimization has been finished.
- Parameters:
mba – (mba_t *)
- Returns:
Microcode error code
- prealloc(mba: mba_t) int
Local variables: preallocation step begins.
- Parameters:
mba – (mba_t *) This event may occur several times. Should return: 1 if modified microcode Negative values are Microcode error code
- glbopt(mba: mba_t) int
Global optimization has been finished. If microcode is modified, MERR_LOOP must be returned. It will cause a complete restart of the optimization.
- Parameters:
mba – (mba_t *)
- Returns:
Microcode error code
- pre_structural(ct: control_graph_t *, cfunc: cfunc_t, g: simple_graph_t) int
Structure analysis is starting.
- structural(ct: control_graph_t *) int
Structural analysis has been finished.
- Parameters:
ct – (control_graph_t *)
- maturity(cfunc: cfunc_t, new_maturity: ctree_maturity_t) int
Ctree maturity level is being changed.
- Parameters:
cfunc – (cfunc_t *)
new_maturity – (ctree_maturity_t)
- print_func(cfunc: cfunc_t, vp: vc_printer_t) int
Printing ctree and generating text.
- func_printed(cfunc: cfunc_t) int
Function text has been generated. Plugins may modify the text in cfunc_t::sv. However, it is too late to modify the ctree or microcode. The text uses regular color codes (see lines.hpp) COLOR_ADDR is used to store pointers to ctree items.
- Parameters:
cfunc – (cfunc_t *)
- resolve_stkaddrs(mba: mba_t) int
The optimizer is about to resolve stack addresses.
- Parameters:
mba – (mba_t *)
- callinfo_built(blk: mblock_t) int
A call instruction has been anallyzed.
- Parameters:
blk – (mblock_t *) blk->tail is the call.
- calls_done(mba: mba_t) int
All calls have been analyzed.
- Parameters:
mba – (mba_t *) This event is generated immediately after analyzing all calls, before any optimizitions, call unmerging and block merging.
- begin_inlining(cdg: codegen_t, decomp_flags: int) int
Starting to inline outlined functions.
- Parameters:
cdg – (codegen_t *)
decomp_flags – (int)
- Returns:
Microcode error code This is an opportunity to inline other ranges.
- inlining_func(cdg: codegen_t, blk: int, mbr: mba_ranges_t) int
A set of ranges is going to be inlined.
- inlined_func(cdg: codegen_t, blk: int, mbr: mba_ranges_t, i1: int, i2: int) int
A set of ranges got inlined.
- collect_warnings(cfunc: cfunc_t) int
Collect warning messages from plugins. These warnings will be displayed at the function header, after the user-defined comments.
- flowchart_ea(fc: qflow_chart_ea_t, mba: mba_t, reachable_blocks: bitset_t, decomp_flags: int) int
Flowchart has been generated (ea-based variant). Replaces the deprecated hxe_flowchart which passes a qflow_chart_t* with a raw func_t* inside.
- prolog_ea(mba: mba_t, fc: qflow_chart_ea_t, reachable_blocks: bitset_t, decomp_flags: int) int
Prolog analysis has been finished (ea-based variant). Replaces the deprecated hxe_prolog which passes a qflow_chart_t* with a raw func_t* inside.
- inlining_function(cdg: codegen_t, blk: int, dcr: decomp_ranges_t) int
A set of ranges is going to be inlined (ea-based variant). Replaces the deprecated hxe_inlining_func which passes an mba_ranges_t* with a raw func_t* inside.
- inlined_function(cdg: codegen_t, blk: int, dcr: decomp_ranges_t, i1: int, i2: int) int
A set of ranges got inlined (ea-based variant). Replaces the deprecated hxe_inlined_func which passes an mba_ranges_t* with a raw func_t* inside.
- switch_pseudocode(vu: vdui_t) int
Existing pseudocode view has been reloaded with a new function. Its text has not been refreshed yet, only cfunc and mba pointers are ready.
- Parameters:
vu – (vdui_t *)
- refresh_pseudocode(vu: vdui_t) int
Existing pseudocode text has been refreshed. Adding/removing pseudocode lines is forbidden in this event.
- Parameters:
vu – (vdui_t *) See also hxe_text_ready, which happens earlier
- right_click(vu: vdui_t) int
Mouse right click. Use hxe_populating_popup instead, in case you want to add items in the popup menu.
- Parameters:
vu – (vdui_t *)
- double_click(vu: vdui_t, shift_state: int) int
Mouse double click.
- Parameters:
vu – (vdui_t *)
shift_state – (int) Should return: 1 if the event has been handled
- curpos(vu: vdui_t) int
Current cursor position has been changed. (for example, by left-clicking or using keyboard)
- Parameters:
vu – (vdui_t *)
- text_ready(vu: vdui_t) int
Decompiled text is ready.
- Parameters:
vu – (vdui_t *) This event can be used to modify the output text (sv). Obsolete. Please use hxe_func_printed instead.
- populating_popup(widget: TWidget *, popup_handle: TPopupMenu *, vu: vdui_t) int
Populating popup menu. We can add menu items now.
- lvar_name_changed(vu: vdui_t, v: lvar_t, name: str, is_user_name: bool) int
Local variable got renamed.
- ida_hexrays.MAX_SUPPORTED_STACK_SIZE
- ida_hexrays.MAX_VLR_SIZE
- ida_hexrays.CMP_NZ
- ida_hexrays.CMP_Z
- ida_hexrays.CMP_AE
- ida_hexrays.CMP_B
- ida_hexrays.CMP_A
- ida_hexrays.CMP_BE
- ida_hexrays.CMP_GT
- ida_hexrays.CMP_GE
- ida_hexrays.CMP_LT
- ida_hexrays.CMP_LE
- class ida_hexrays.valrng_t(*args)
Bases:
object- thisown
- max_value() uvlr_t
- min_svalue() uvlr_t
- max_svalue() uvlr_t
- ida_hexrays.cvar
- ida_hexrays.MAX_VLR_VALUE
- ida_hexrays.MAX_VLR_SVALUE
- ida_hexrays.MIN_VLR_SVALUE
- ida_hexrays.MERR_OK
ok
- ida_hexrays.MERR_BLOCK
no error, switch to new block
- ida_hexrays.MERR_INTERR
internal error
- ida_hexrays.MERR_INSN
cannot convert to microcode
- ida_hexrays.MERR_MEM
not enough memory
- ida_hexrays.MERR_BADBLK
bad block found
- ida_hexrays.MERR_BADSP
positive sp value has been found
- ida_hexrays.MERR_PROLOG
prolog analysis failed
- ida_hexrays.MERR_SWITCH
wrong switch idiom
- ida_hexrays.MERR_EXCEPTION
exception analysis failed
- ida_hexrays.MERR_HUGESTACK
stack frame is too big
- ida_hexrays.MERR_LVARS
local variable allocation failed
- ida_hexrays.MERR_BITNESS
16-bit functions cannot be decompiled
- ida_hexrays.MERR_BADCALL
could not determine call arguments
- ida_hexrays.MERR_BADFRAME
function frame is wrong
- ida_hexrays.MERR_UNKTYPE
undefined type s (currently unused error code)
- ida_hexrays.MERR_BADIDB
inconsistent database information
- ida_hexrays.MERR_SIZEOF
wrong basic type sizes in compiler settings
- ida_hexrays.MERR_REDO
redecompilation has been requested
- ida_hexrays.MERR_CANCELED
decompilation has been cancelled
- ida_hexrays.MERR_RECDEPTH
max recursion depth reached during lvar allocation
- ida_hexrays.MERR_OVERLAP
variables would overlap: s
- ida_hexrays.MERR_PARTINIT
partially initialized variable s
- ida_hexrays.MERR_COMPLEX
too complex function
- ida_hexrays.MERR_LICENSE
no license available
- ida_hexrays.MERR_ONLY32
only 32-bit functions can be decompiled for the current database
- ida_hexrays.MERR_ONLY64
only 64-bit functions can be decompiled for the current database
- ida_hexrays.MERR_BUSY
already decompiling a function
- ida_hexrays.MERR_FARPTR
far memory model is supported only for pc
- ida_hexrays.MERR_EXTERN
special segments cannot be decompiled
- ida_hexrays.MERR_FUNCSIZE
too big function
- ida_hexrays.MERR_BADRANGES
bad input ranges
- ida_hexrays.MERR_BADARCH
current architecture is not supported
- ida_hexrays.MERR_DSLOT
bad instruction in the delay slot
- ida_hexrays.MERR_STOP
no error, stop the analysis
- ida_hexrays.MERR_CLOUD
cloud: s
- ida_hexrays.MERR_EMULATOR
emulator: s
- ida_hexrays.MERR_MAX_ERR
- ida_hexrays.MERR_LOOP
internal code: redo last loop (never reported)
- ida_hexrays.get_merror_desc(code: merror_t, mba: mba_t) str | None
Get textual description of an error code
- Parameters:
code – Microcode error code
mba – the microcode array
- Returns:
the error address
- class ida_hexrays.hexrays_failure_t(*args)
Bases:
object- thisown
- code: merror_t
Microcode error code
- errea: ida_idaapi.ea_t
associated address
- str: hexrays_failure_t.str
string information
- ida_hexrays.MUST_ACCESS
- ida_hexrays.MAY_ACCESS
- ida_hexrays.MAYMUST_ACCESS_MASK
- ida_hexrays.ONE_ACCESS_TYPE
- ida_hexrays.INCLUDE_SPOILED_REGS
- ida_hexrays.EXCLUDE_PASS_REGS
- ida_hexrays.FULL_XDSU
- ida_hexrays.WITH_ASSERTS
- ida_hexrays.EXCLUDE_VOLATILE
- ida_hexrays.INCLUDE_UNUSED_SRC
- ida_hexrays.INCLUDE_DEAD_RETREGS
- ida_hexrays.INCLUDE_RESTRICTED
- ida_hexrays.CALL_SPOILS_ONLY_ARGS
- class ida_hexrays.vd_interr_t(ea: ida_idaapi.ea_t, buf: str)
Bases:
vd_failure_t- thisown
- ida_hexrays.m_nop
- ida_hexrays.m_stx
- ida_hexrays.m_ldx
- ida_hexrays.m_ldc
- ida_hexrays.m_mov
- ida_hexrays.m_neg
- ida_hexrays.m_lnot
- ida_hexrays.m_bnot
- ida_hexrays.m_xds
- ida_hexrays.m_xdu
- ida_hexrays.m_low
- ida_hexrays.m_high
- ida_hexrays.m_add
- ida_hexrays.m_sub
- ida_hexrays.m_mul
- ida_hexrays.m_udiv
- ida_hexrays.m_sdiv
- ida_hexrays.m_umod
- ida_hexrays.m_smod
- ida_hexrays.m_or
- ida_hexrays.m_and
- ida_hexrays.m_xor
- ida_hexrays.m_shl
- ida_hexrays.m_shr
- ida_hexrays.m_sar
- ida_hexrays.m_cfadd
- ida_hexrays.m_ofadd
- ida_hexrays.m_cfshl
- ida_hexrays.m_cfshr
- ida_hexrays.m_sets
- ida_hexrays.m_seto
- ida_hexrays.m_setp
- ida_hexrays.m_setnz
- ida_hexrays.m_setz
- ida_hexrays.m_setae
- ida_hexrays.m_setb
- ida_hexrays.m_seta
- ida_hexrays.m_setbe
- ida_hexrays.m_setg
- ida_hexrays.m_setge
- ida_hexrays.m_setl
- ida_hexrays.m_setle
- ida_hexrays.m_jcnd
- ida_hexrays.m_jnz
- ida_hexrays.m_jz
- ida_hexrays.m_jae
- ida_hexrays.m_jb
- ida_hexrays.m_ja
- ida_hexrays.m_jbe
- ida_hexrays.m_jg
- ida_hexrays.m_jge
- ida_hexrays.m_jl
- ida_hexrays.m_jle
- ida_hexrays.m_jtbl
- ida_hexrays.m_ijmp
- ida_hexrays.m_goto
- ida_hexrays.m_call
- ida_hexrays.m_icall
- ida_hexrays.m_ret
- ida_hexrays.m_push
- ida_hexrays.m_pop
- ida_hexrays.m_und
- ida_hexrays.m_ext
- ida_hexrays.m_f2i
- ida_hexrays.m_f2u
- ida_hexrays.m_i2f
- ida_hexrays.m_u2f
- ida_hexrays.m_f2f
- ida_hexrays.m_fneg
- ida_hexrays.m_fadd
- ida_hexrays.m_fsub
- ida_hexrays.m_fmul
- ida_hexrays.m_fdiv
- ida_hexrays.must_mcode_close_block(mcode: mcode_t, including_calls: bool) bool
Must an instruction with the given opcode be the last one in a block? Such opcodes are called closing opcodes.
- Parameters:
mcode – instruction opcode
including_calls – should m_call/m_icall be considered as the closing opcodes? If this function returns true, the opcode cannot appear in the middle of a block. Calls are a special case: unknown calls (is_unknown_call) are considered as closing opcodes.
- ida_hexrays.is_mcode_propagatable(mcode: mcode_t) bool
May opcode be propagated? Such opcodes can be used in sub-instructions (nested instructions) There is a handful of non-propagatable opcodes, like jumps, ret, nop, etc All other regular opcodes are propagatable and may appear in a nested instruction.
- ida_hexrays.set2jcnd(code: mcode_t) mcode_t
- ida_hexrays.jcnd2set(code: mcode_t) mcode_t
- ida_hexrays.negate_mcode_relation(code: mcode_t) mcode_t
- ida_hexrays.swap_mcode_relation(code: mcode_t) mcode_t
- ida_hexrays.get_signed_mcode(code: mcode_t) mcode_t
- ida_hexrays.get_unsigned_mcode(code: mcode_t) mcode_t
- class ida_hexrays.operand_locator_t(_ea: ida_idaapi.ea_t, _opnum: int)
Bases:
object- thisown
- ea: ida_idaapi.ea_t
address of the original processor instruction
- compare(r: operand_locator_t) int
- ida_hexrays.mr_none
- ida_hexrays.mr_cf
- ida_hexrays.mr_zf
- ida_hexrays.mr_sf
- ida_hexrays.mr_of
- ida_hexrays.mr_pf
- ida_hexrays.cc_count
- ida_hexrays.mr_cc
- ida_hexrays.mr_first
- class ida_hexrays.number_format_t(_opnum: int = 0)
Bases:
object- thisown
- flags32: flags_t
low 32-bit of flags (for compatibility)
- opnum: char
operand number: 0..UA_MAXOP
- serial: uchar
for enums: constant serial number
- org_nbytes: char
original number size in bytes
- flags: flags64_t
ida flags, which describe number radix, enum, etc
- is_fixed() bool
Is number representation fixed? Fixed representation cannot be modified by the decompiler
- ida_hexrays.NF_FIXED
number format has been defined by the user
- ida_hexrays.NF_NEGDONE
temporary internal bit: negation has been performed
- ida_hexrays.NF_BINVDONE
temporary internal bit: inverting bits is done
- ida_hexrays.NF_NEGATE
The user asked to negate the constant.
- ida_hexrays.NF_BITNOT
The user asked to invert bits of the constant.
- ida_hexrays.NF_VALID
internal bit: stroff or enum is valid for enums: this bit is set immediately for stroffs: this bit is set at the end of decompilation
- class ida_hexrays.vc_printer_t(f: cfunc_t)
Bases:
vd_printer_t- thisown
- func: cfunc_t const *
cfunc_t to generate text for
- lastchar: char
internal: last printed character
- class ida_hexrays.qstring_printer_t(f: cfunc_t, tags: bool)
Bases:
vc_printer_t- thisown
- ida_hexrays.dstr(tif: tinfo_t) str
Print the specified type info. This function can be used from a debugger by typing “tif->dstr()”
- ida_hexrays.is_type_correct(ptr: type_t const *) bool
Verify a type string.
- Returns:
true if type string is correct
- ida_hexrays.is_small_udt(tif: tinfo_t) bool
Is a small structure or union?
- Returns:
true if the type is a small UDT (user defined type). Small UDTs fit into a register (or pair or registers) as a rule.
- ida_hexrays.is_nonbool_type(type: tinfo_t) bool
Is definitely a non-boolean type?
- Returns:
true if the type is a non-boolean type (non bool and well defined)
- ida_hexrays.is_bool_type(type: tinfo_t) bool
Is a boolean type?
- Returns:
true if the type is a boolean type
- ida_hexrays.partial_type_num(type: tinfo_t) int
Calculate number of partial subtypes.
- Returns:
number of partial subtypes. The bigger is this number, the uglier is the type.
- ida_hexrays.get_float_type(width: int) tinfo_t
Get a type of a floating point value with the specified width
- Parameters:
width – width of the desired type
- Returns:
type info object
- ida_hexrays.get_int_type_by_width_and_sign(srcwidth: int, sign: type_sign_t) tinfo_t
Create a type info by width and sign. Returns a simple type (examples: int, short) with the given width and sign.
- Parameters:
srcwidth – size of the type in bytes
sign – sign of the type
- ida_hexrays.get_unk_type(size: int) tinfo_t
Create a partial type info by width. Returns a partially defined type (examples: _DWORD, _BYTE) with the given width.
- Parameters:
size – size of the type in bytes. Must be a power of 2 (1, 2, 4, 8, 16). For non-power-of-2 sizes, returns an empty tinfo_t. Use make_valid_size() to round up arbitrary sizes before calling.
- ida_hexrays.dummy_ptrtype(ptrsize: int, isfp: bool) tinfo_t
Generate a dummy pointer type
- Parameters:
ptrsize – size of pointed object
isfp – is floating point object?
- ida_hexrays.make_pointer(type: tinfo_t) tinfo_t
Create a pointer type. This function performs the following conversion: “type” -> “type*”
- Parameters:
type – object type.
- Returns:
“type*”. for example, if ‘char’ is passed as the argument,
- ida_hexrays.create_typedef(*args) tinfo_t
This function has the following signatures:
create_typedef(name: str) -> tinfo_t
create_typedef(n: int) -> tinfo_t
# 0: create_typedef(name: str) -> tinfo_t
Create a reference to a named type.
- Returns:
type which refers to the specified name. For example, if name is “DWORD”, the type info which refers to “DWORD” is created.
# 1: create_typedef(n: int) -> tinfo_t
Create a reference to an ordinal type.
- Returns:
type which refers to the specified ordinal. For example, if n is 1, the type info which refers to ordinal type 1 is created.
- ida_hexrays.GUESSED_NONE
- ida_hexrays.GUESSED_WEAK
- ida_hexrays.GUESSED_FUNC
- ida_hexrays.GUESSED_DATA
- ida_hexrays.TS_NOELL
- ida_hexrays.TS_SHRINK
- ida_hexrays.TS_DONTREF
- ida_hexrays.TS_MASK
- ida_hexrays.get_type(id: int, tif: tinfo_t, guess: type_source_t) bool
Get a global type. Global types are types of addressable objects and struct/union/enum types
- Parameters:
id – address or id of the object
tif – buffer for the answer
guess – what kind of types to consider
- Returns:
success
- ida_hexrays.set_type(id: int, tif: tinfo_t, source: type_source_t, force: bool = False) bool
Set a global type.
- Parameters:
id – address or id of the object
tif – new type info
source – where the type comes from
force – true means to set the type as is, false means to merge the new type with the possibly existing old type info.
- Returns:
success
- class ida_hexrays.vdloc_t
Bases:
ida_typeinf.argloc_t- thisown
- ida_hexrays.print_vdloc(loc: vdloc_t, nbytes: int) str
Print vdloc. Since vdloc does not always carry the size info, we pass it as NBYTES..
- ida_hexrays.arglocs_overlap(loc1: vdloc_t, w1: int, loc2: vdloc_t, w2: int) bool
Do two arglocs overlap?
- class ida_hexrays.lvar_locator_t(*args)
Bases:
object- thisown
- defea: ida_idaapi.ea_t
Definition address. Usually, this is the address of the instruction that initializes the variable. In some cases it can be a fictional address.
- get_stkoff() int
Get offset of the varialbe in the stack frame.
- Returns:
a non-negative value for stack variables. The value is an offset from the bottom of the stack frame in terms of vd-offsets. negative values mean error (not a stack variable)
- get_reg1() mreg_t
Get the register number of the variable.
- get_reg2() mreg_t
Get the number of the second register (works only for ALOC_REG2 lvars).
- get_scattered() scattered_aloc_t &
Get information about scattered variable.
- compare(r: lvar_locator_t) int
- class ida_hexrays.lvar_t(*args, **kwargs)
Bases:
lvar_locator_t- thisown
- name: str
variable name. use mba_t::set_nice_lvar_name() and mba_t::set_user_lvar_name() to modify it
- divisor: uint64
max known divisor of the variable
Is lvar mapped to several chains.
- has_common_bit(loc: vdloc_t, width2: asize_t) bool
Does the variable overlap with the specified location?
- type() tinfo_t &
Get variable type.
- accepts_type(t: tinfo_t, may_change_thisarg: bool = False) bool
Check if the variable accept the specified type. Some types are forbidden (void, function types, wrong arrays, etc)
- set_lvar_type(t: tinfo_t, may_fail: bool = False) bool
Set variable type Note: this function does not modify the idb, only the lvar instance in the memory. For permanent changes see modify_user_lvars() Also, the variable type is not considered as final by the decompiler and may be modified later by the type derivation. In some cases set_final_var_type() may work better, but it does not do persistent changes to the database neither.
- Parameters:
t – new type
may_fail – if false and type is bad, interr
- Returns:
success
- set_width(w: int, svw_flags: int = 0) bool
Change the variable width. We call the variable size ‘width’, it is represents the number of bytes. This function may change the variable type using set_lvar_type().
- Parameters:
w – new width
svw_flags – combination of SVW_… bits
- Returns:
success
- ida_hexrays.SVW_INT
- ida_hexrays.SVW_FLOAT
- ida_hexrays.SVW_SOFT
- class ida_hexrays.lvars_t
Bases:
qvector_lvar_t- thisown
- find_input_lvar(argloc: vdloc_t, _size: int) int
Find an input variable at the specified location.
- Parameters:
argloc – variable location
_size – variable size in bytes
- Returns:
-1 if failed, otherwise an index into ‘vars’
- find_input_reg(reg: int, _size: int = 1) int
Find an input register variable.
- Parameters:
reg – register to find
_size – variable size in bytes
- Returns:
-1 if failed, otherwise an index into ‘vars’
- find_stkvar(spoff: int, width: int) int
Find a stack variable at the specified location.
- Parameters:
spoff – offset from the minimal sp
width – variable size in bytes
- Returns:
-1 if failed, otherwise an index into ‘vars’
- find(ll: lvar_locator_t) lvar_t *
Find a variable at the specified location.
- Parameters:
ll – variable location
- Returns:
pointer to variable or nullptr
- class ida_hexrays.lvar_saved_info_t
Bases:
object- thisown
- ll: lvar_locator_t
Variable locator.
- size: ssize_t
Type size (if not initialized then -1).
- ida_hexrays.LVINF_KEEP
preserve saved user settings regardless of vars for example, if a var loses all its user-defined attributes or even gets destroyed, keep its lvar_saved_info_t. this is used for ephemeral variables that get destroyed by macro recognition.
- ida_hexrays.LVINF_SPLIT
split allocation of a new variable. forces the decompiler to create a new variable at ll.defea
- ida_hexrays.LVINF_NOPTR
variable type should not be a pointer
- ida_hexrays.LVINF_NOMAP
forbid automatic mapping of the variable
- ida_hexrays.LVINF_UNUSED
unused argument, corresponds to CVAR_UNUSED
- ida_hexrays.LVINF_NOPROP
don’t propagate assignments to this lvar (CVAR_NOPROP)
- class ida_hexrays.lvar_uservec_t
Bases:
object- thisown
- lvvec: lvar_saved_infos_t
User-specified names, types, comments for lvars. Variables without user-specified info are not present in this vector.
- lmaps: lvar_mapping_t
Local variable mapping (used for merging variables).
- stkoff_delta: int
Delta to add to IDA stack offset to calculate Hex-Rays stack offsets. Should be set by the caller before calling save_user_lvar_settings();
- swap(r: lvar_uservec_t) None
- find_info(vloc: lvar_locator_t) lvar_saved_info_t *
find saved user settings for given var
- ida_hexrays.ULV_PRECISE_DEFEA
Use precise defea’s for lvar locations.
- ida_hexrays.restore_user_lvar_settings(lvinf: lvar_uservec_t, func_ea: ida_idaapi.ea_t) bool
Restore user defined local variable settings in the database.
- Parameters:
lvinf – ptr to output buffer
func_ea – entry address of the function
- Returns:
success
- ida_hexrays.save_user_lvar_settings(func_ea: ida_idaapi.ea_t, lvinf: lvar_uservec_t) None
Save user defined local variable settings into the database.
- Parameters:
func_ea – entry address of the function
lvinf – user-specified info about local variables
- class ida_hexrays.user_lvar_modifier_t
Bases:
object- thisown
- modify_lvars(lvinf: lvar_uservec_t) bool
Modify lvar settings. Returns: true-modified
- ida_hexrays.modify_user_lvars(entry_ea: ida_idaapi.ea_t, mlv: user_lvar_modifier_t) bool
Modify saved local variable settings.
- Parameters:
entry_ea – function start address
mlv – local variable modifier
- Returns:
true if modified variables
- ida_hexrays.modify_user_lvar_info(func_ea: ida_idaapi.ea_t, mli_flags: uint, info: lvar_saved_info_t) bool
Modify saved local variable settings of one variable.
- Parameters:
func_ea – function start address
mli_flags – bits that specify which attrs defined by INFO are to be set
info – local variable info attrs
- Returns:
true if modified, false if invalid MLI_FLAGS passed
- ida_hexrays.MLI_NAME
apply lvar name
- ida_hexrays.MLI_TYPE
apply lvar type
- ida_hexrays.MLI_CMT
apply lvar comment
- ida_hexrays.locate_lvar(out: lvar_locator_t, func_ea: ida_idaapi.ea_t, varname: str) bool
Find a variable by name.
- Parameters:
out – output buffer for the variable locator
func_ea – function start address
varname – variable name
- Returns:
success Since VARNAME is not always enough to find the variable, it may decompile the function.
- ida_hexrays.rename_lvar(func_ea: ida_idaapi.ea_t, oldname: str, newname: str) bool
Rename a local variable.
- Parameters:
func_ea – function start address
oldname – old name of the variable
newname – new name of the variable
- Returns:
success This is a convenience function. For bulk renaming consider using modify_user_lvars.
- ida_hexrays.restore_user_defined_calls(udcalls: udcall_map_t *, func_ea: ida_idaapi.ea_t) bool
Restore user defined function calls from the database.
- Parameters:
udcalls – ptr to output buffer
func_ea – entry address of the function
- Returns:
success
- ida_hexrays.save_user_defined_calls(func_ea: ida_idaapi.ea_t, udcalls: udcall_map_t const &) None
Save user defined local function calls into the database.
- Parameters:
func_ea – entry address of the function
udcalls – user-specified info about user defined function calls
- ida_hexrays.parse_user_call(udc: udcall_t, decl: str, silent: bool) bool
Convert function type declaration into internal structure
- Parameters:
udc –
pointer to output structure
decl –
function type declaration
silent –
if TRUE: do not show warning in case of incorrect type
- Returns:
success
- ida_hexrays.convert_to_user_call(udc: udcall_t, cdg: codegen_t) merror_t
try to generate user-defined call for an instruction
- Returns:
Microcode error code code: MERR_OK - user-defined call generated else - error (MERR_INSN == inacceptable udc.tif)
- ida_hexrays.install_microcode_filter(filter: microcode_filter_t, install: bool = True) bool
register/unregister non-standard microcode generator
- Parameters:
filter –
microcode generator object
install –
TRUE - register the object, FALSE - unregister
- Returns:
success
- class ida_hexrays.udc_filter_t
Bases:
microcode_filter_t- thisown
- cleanup() None
Cleanup the filter This function properly clears type information associated to this filter.
- class ida_hexrays.bitset_t(*args)
Bases:
object- thisown
- add(*args) bool
This function has the following signatures:
add(bit: int) -> bool
add(bit: int, width: int) -> bool
add(ml: const bitset_t &) -> bool
# 0: add(bit: int) -> bool
# 1: add(bit: int, width: int) -> bool
# 2: add(ml: const bitset_t &) -> bool
- sub(*args) bool
This function has the following signatures:
sub(bit: int) -> bool
sub(bit: int, width: int) -> bool
sub(ml: const bitset_t &) -> bool
# 0: sub(bit: int) -> bool
# 1: sub(bit: int, width: int) -> bool
# 2: sub(ml: const bitset_t &) -> bool
- count(*args) int
This function has the following signatures:
count() -> int
count(bit: int) -> int
# 0: count() -> int
# 1: count(bit: int) -> int
- begin() bitset_t::iterator
- end() bitset_t::iterator
- ida_hexrays.bitset_width
- ida_hexrays.bitset_align
- ida_hexrays.bitset_shift
- class ida_hexrays.ivl_t(_off: uint64 = 0, _size: uint64 = 0)
Bases:
object- thisown
- off: uint64
- size: uint64
- end() uint64
- last() uint64
- class ida_hexrays.ivlset_t(*args)
Bases:
object- thisown
- lastivl() ivl_t const &
- single_value(*args) bool
This function has the following signatures:
single_value() -> bool
single_value(v: uint64) -> bool
# 0: single_value() -> bool
# 1: single_value(v: uint64) -> bool
- add(*args) bool
This function has the following signatures:
add(ivl: const ivl_t &) -> bool
add(ea: ida_idaapi.ea_t, size: asize_t) -> bool
add(ivs: const ivlset_t &) -> bool
# 0: add(ivl: const ivl_t &) -> bool
# 1: add(ea: ida_idaapi.ea_t, size: asize_t) -> bool
# 2: add(ivs: const ivlset_t &) -> bool
- sub(*args) bool
This function has the following signatures:
sub(ivl: const ivl_t &) -> bool
sub(ea: ida_idaapi.ea_t, size: asize_t) -> bool
sub(ivs: const ivlset_t &) -> bool
# 0: sub(ivl: const ivl_t &) -> bool
# 1: sub(ea: ida_idaapi.ea_t, size: asize_t) -> bool
# 2: sub(ivs: const ivlset_t &) -> bool
- count() asize_t
- has_common(*args) bool
This function has the following signatures:
has_common(ivs: const ivlset_t &) -> bool
has_common(ivl: const ivl_t &, strict: bool=false) -> bool
# 0: has_common(ivs: const ivlset_t &) -> bool
# 1: has_common(ivl: const ivl_t &, strict: bool=false) -> bool
- begin(*args) ivlset_t::iterator
This function has the following signatures:
begin() -> const_iterator
begin() -> iterator
# 0: begin() -> const_iterator
# 1: begin() -> iterator
- end(*args) ivlset_t::iterator
This function has the following signatures:
end() -> const_iterator
end() -> iterator
# 0: end() -> const_iterator
# 1: end() -> iterator
- class ida_hexrays.mlist_t(*args)
Bases:
object- thisown
- addmem(ea: ida_idaapi.ea_t, size: asize_t) bool
- add(*args) bool
This function has the following signatures:
add(r: mreg_t, size: int) -> bool
add(r: const rlist_t &) -> bool
add(ivl: const ivl_t &) -> bool
add(lst: const mlist_t &) -> bool
# 0: add(r: mreg_t, size: int) -> bool
# 1: add(r: const rlist_t &) -> bool
# 2: add(ivl: const ivl_t &) -> bool
# 3: add(lst: const mlist_t &) -> bool
- sub(*args) bool
This function has the following signatures:
sub(r: mreg_t, size: int) -> bool
sub(ivl: const ivl_t &) -> bool
sub(lst: const mlist_t &) -> bool
# 0: sub(r: mreg_t, size: int) -> bool
# 1: sub(ivl: const ivl_t &) -> bool
# 2: sub(lst: const mlist_t &) -> bool
- count() asize_t
- ida_hexrays.get_temp_regs() mlist_t const &
Get list of temporary registers. Tempregs are temporary registers that are used during code generation. They do not map to regular processor registers. They are used only to store temporary values during execution of one instruction. Tempregs may not be used to pass a value from one block to another. In other words, at the end of a block all tempregs must be dead.
- ida_hexrays.is_kreg(r: mreg_t) bool
Is a kernel register? Kernel registers are temporary registers that can be used freely. They may be used to store values that cross instruction or basic block boundaries. Kernel registers do not map to regular processor registers. See also mba_t::alloc_kreg()
- ida_hexrays.reg2mreg(reg: int) mreg_t
Map a processor register to a microregister.
- Parameters:
reg – processor register number
- Returns:
microregister register id or mr_none
- ida_hexrays.mreg2reg(reg: mreg_t, width: int) int
Map a microregister to a processor register.
- Parameters:
reg – microregister number
width – size of microregister in bytes
- Returns:
processor register id or -1
- ida_hexrays.get_mreg_name(reg: mreg_t, width: int, ud: void * = None) str
Get the microregister name.
- Parameters:
reg – microregister number
width – size of microregister in bytes. may be bigger than the real register size.
ud – reserved, must be nullptr
- Returns:
width of the printed register. this value may be less than the WIDTH argument.
- class ida_hexrays.optinsn_t
Bases:
object- thisown
- func(blk: mblock_t, ins: minsn_t, optflags: int) int
Optimize an instruction.
- Parameters:
blk – current basic block. maybe nullptr, which means that the instruction must be optimized without context
ins – instruction to optimize; it is always a top-level instruction. the callback may not delete the instruction but may convert it into nop (see mblock_t::make_nop). to optimize sub-instructions, visit them using minsn_visitor_t. sub-instructions may not be converted into nop but can be converted to “mov x,x”. for example: add x,0,x => mov x,x this callback may change other instructions in the block, but should do this with care, e.g. to no break the propagation algorithm if called with OPTI_NO_LDXOPT.
optflags – combination of optimization flags bits
- Returns:
number of changes made to the instruction. if after this call the instruction’s use/def lists have changed, you must mark the block level lists as dirty (see mark_lists_dirty)
- class ida_hexrays.optblock_t
Bases:
object- thisown
- func(blk: mblock_t) int
Optimize a block. This function usually performs the optimizations that require analyzing the entire block and/or its neighbors. For example it can recognize patterns and perform conversions like: b0: b0: … … jnz x, 0, @b2 => jnz x, 0, @b2 b1: b1: add x, 0, y mov x, y … …
- Parameters:
blk – Basic block to optimize as a whole.
- Returns:
number of changes made to the block. See also mark_lists_dirty.
- class ida_hexrays.simple_graph_t(*args, **kwargs)
Bases:
ida_gdl.gdl_graph_t- thisown
- compute_dominators(domin: array_of_node_bitset_t, post: bool = False) None
- compute_immediate_dominators(domin: array_of_node_bitset_t, idomin: intvec_t, post: bool = False) None
- depth_first_preorder(pre: node_ordering_t) int
- depth_first_postorder(post: node_ordering_t) int
- begin() simple_graph_t::iterator
- end() simple_graph_t::iterator
- class ida_hexrays.op_parent_info_t(_mba: mba_t = None, _blk: mblock_t = None, _topins: minsn_t = None)
Bases:
object- thisown
- mba: mba_t *
- blk: mblock_t *
- topins: minsn_t *
- curins: minsn_t *
- class ida_hexrays.minsn_visitor_t(_mba: mba_t = None, _blk: mblock_t = None, _topins: minsn_t = None)
Bases:
op_parent_info_t- thisown
- class ida_hexrays.mop_visitor_t(_mba: mba_t = None, _blk: mblock_t = None, _topins: minsn_t = None)
Bases:
op_parent_info_t- thisown
- class ida_hexrays.mlist_mop_visitor_t
Bases:
object- thisown
- topins: minsn_t *
- curins: minsn_t *
- list: mlist_t *
- class ida_hexrays.lvar_ref_t(*args)
Bases:
object- thisown
- mba: mba_t *const
Pointer to the parent mba_t object. Since we need to access the ‘mba->vars’ array in order to retrieve the referenced variable, we keep a pointer to mba_t here. Note: this means this class and consequently mop_t, minsn_t, mblock_t are specific to a mba_t object and cannot migrate between them. fortunately this is not something we need to do. second, lvar_ref_t’s appear only after MMAT_LVARS.
- compare(r: lvar_ref_t) int
- swap(r: lvar_ref_t) None
- var() lvar_t &
Retrieve the referenced variable.
- ida_hexrays.mop_z
none
- ida_hexrays.mop_r
register (they exist until MMAT_LVARS)
- ida_hexrays.mop_n
immediate number constant
- ida_hexrays.mop_str
immediate string constant (user representation)
- ida_hexrays.mop_d
result of another instruction
- ida_hexrays.mop_S
local stack variable (they exist until MMAT_LVARS)
- ida_hexrays.mop_v
global variable
- ida_hexrays.mop_b
micro basic block (mblock_t)
- ida_hexrays.mop_f
list of arguments
- ida_hexrays.mop_l
local variable
- ida_hexrays.mop_a
mop_addr_t: address of operand (mop_l, mop_v, mop_S, mop_r)
- ida_hexrays.mop_h
helper function
- ida_hexrays.mop_c
mcases
- ida_hexrays.mop_fn
floating point constant
- ida_hexrays.mop_p
operand pair
- ida_hexrays.mop_sc
scattered
- ida_hexrays.NOSIZE
wrong or unexisting operand size
- class ida_hexrays.stkvar_ref_t(m: mba_t, o: int)
Bases:
object- thisown
- mba: mba_t *const
Pointer to the parent mba_t object. We need it in order to retrieve the referenced stack variable. See notes for lvar_ref_t::mba.
- off: int
Offset to the stack variable from the bottom of the stack frame. It is called ‘decompiler stkoff’ and it is different from IDA stkoff. See a note and a picture about ‘decompiler stkoff’ below.
- compare(r: stkvar_ref_t) int
- swap(r: stkvar_ref_t) None
- get_stkvar(udm: udm_t = None, p_idaoff: uval_t * = None) ssize_t
Retrieve the referenced stack variable.
- Parameters:
udm – stkvar, may be nullptr
p_idaoff – if specified, will hold IDA stkoff after the call.
- Returns:
index of stkvar in the frame or -1
- class ida_hexrays.scif_t(*args)
Bases:
vdloc_t- thisown
- mba: mba_t *
Pointer to the parent mba_t object. Some operations may convert a scattered operand into something simpler, (a stack operand, for example). We will need to create stkvar_ref_t at that moment, this is why we need this pointer. See notes for lvar_ref_t::mba.
- class ida_hexrays.mnumber_t(*args)
Bases:
operand_locator_t- thisown
- value: uint64
- org_value: uint64
- class ida_hexrays.fnumber_t
Bases:
object- thisown
- dereference_uint16() uint16 *
- dereference_const_uint16() uint16 const *
- ida_hexrays.SHINS_NUMADDR
display definition addresses for numbers
- ida_hexrays.SHINS_VALNUM
display value numbers
- ida_hexrays.SHINS_SHORT
do not display use-def chains and other attrs
- ida_hexrays.SHINS_LDXEA
display address of ldx expressions (not used)
- ida_hexrays.SHINS_NOEA
do not display the ea
- ida_hexrays.NO_SIDEFF
change operand size but ignore side effects if you decide to keep the changed operand, handle_new_size() must be called
- ida_hexrays.WITH_SIDEFF
change operand size and handle side effects
- ida_hexrays.ONLY_SIDEFF
only handle side effects
- ida_hexrays.ANY_REGSIZE
any register size is permitted
- ida_hexrays.ANY_FPSIZE
any size of floating operand is permitted
- class ida_hexrays.mop_t(*args)
Bases:
object- thisown
- t: mopt_t
Operand type.
- oprops: uint8
Operand properties.
- valnum: uint16
Value number. Zero means unknown. Operands with the same value number are equal.
- create_from_mlist(mba: mba_t, lst: mlist_t, fullsize: int) bool
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)
- Parameters:
mba – pointer to microcode
lst – list of locations
fullsize – mba->fullsize
- Returns:
success
- create_from_ivlset(mba: mba_t, ivs: ivlset_t, fullsize: int) bool
Create operand from ivlset_t. Example: if IVS contains [glbvar..glbvar+4), our operand will be (t=mop_v, g=&glbvar, size=4)
- Parameters:
mba – pointer to microcode
ivs – set of memory intervals
fullsize – mba->fullsize
- Returns:
success
- create_from_vdloc(mba: mba_t, loc: vdloc_t, _size: int) None
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)
- Parameters:
mba – pointer to microcode
loc – location
_size – operand size Note: this function cannot handle scattered locations.
- Returns:
success
- create_from_scattered_vdloc(mba: mba_t, name: str, type: tinfo_t, loc: vdloc_t) None
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})
- Parameters:
mba – pointer to microcode
name – name of the operand, if available
type – type of the operand, must be present
loc – a scattered location
- Returns:
success
- create_from_insn(m: minsn_t) None
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.
- Parameters:
m – instruction to embed into operand. may not be nullptr.
- make_number(*args) None
Create an integer constant operand.
- Parameters:
_value – value to store in the operand
_size – size of the value in bytes (1,2,4,8)
_ea – address of the processor instruction that made the value
opnum – operand number of the processor instruction
- make_fpnum(bytes: void const *) bool
Create a floating point constant operand.
- Parameters:
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
- make_reg(*args) None
This function has the following signatures:
make_reg(reg: mreg_t) -> None
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
- make_gvar(ea: ida_idaapi.ea_t) None
Create a global variable operand.
- make_reg_pair(loreg: int, hireg: int, halfsize: int) None
Create pair of registers.
- Parameters:
loreg – register holding the low part of the value
hireg – register holding the high part of the value
halfsize – the size of each of loreg/hireg
- make_helper(name: str) None
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.
- is_reg(*args) bool
This function has the following signatures:
is_reg() -> bool
is_reg(_r: mreg_t) -> bool
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?
- is_bit_reg(*args) bool
This function has the following signatures:
is_bit_reg() -> bool
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
- is_mblock(*args) bool
This function has the following signatures:
is_mblock() -> bool
is_mblock(serial: int) -> bool
# 0: is_mblock() -> bool
Is a block reference?
# 1: is_mblock(serial: int) -> bool
Is a block reference to the specified block?
- is_glbaddr(*args) bool
This function has the following signatures:
is_glbaddr() -> bool
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?
- is_insn(*args) bool
This function has the following signatures:
is_insn() -> bool
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?
- has_side_effects(include_ldx_and_divs: bool = False) bool
Has any side effects?
- Parameters:
include_ldx_and_divs – consider ldx/div/mod as having side effects?
- is01() bool
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.
- get_bitwidth(blk: mblock_t, top: minsn_t) int
Get the effective bitwidth of the operand. Returns the number of significant bits needed to represent the value (0 for zero, size*8 for unknown operands). For example, for a constant 7 returns 3, for xdu(x.1) returns 8. If BLK and TOP are specified, the method also looks up the defining instruction in this block.
- is_sign_extended_from(nbytes: int) bool
Does the high part of the operand consist of the sign bytes?
- Parameters:
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
- is_zero_extended_from(nbytes: int) bool
Does the high part of the operand consist of zero bytes?
- Parameters:
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
- is_extended_from(nbytes: int, is_signed: bool) bool
Does the high part of the operand consist of zero or sign bytes?
- equal_mops(rop: mop_t, eqflags: int) bool
Compare operands. This is the main comparison function for operands.
- Parameters:
rop – operand to compare with
eqflags – combination of comparison bits bits
- for_all_ops(mv: mop_visitor_t, type: tinfo_t = None, is_target: bool = False) int
Visit the operand and all its sub-operands. This function visits the current operand as well.
- Parameters:
mv – visitor object
type – operand type
is_target – is a destination operand?
- for_all_scattered_submops(sv: scif_visitor_t) int
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.
- Parameters:
sv – visitor object
- value(is_signed: bool) uint64
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.
- signed_value() int64
- unsigned_value() uint64
- is_constant(is_signed: bool = True) bool
Retrieve value of a constant integer operand.
- Parameters:
is_signed – should treat the value as signed
- Returns:
true if the operand is mop_n
- get_stkvar(udm: udm_t = None, p_idaoff: uval_t * = None) ssize_t
Retrieve the referenced stack variable.
- Parameters:
udm – stkvar, may be nullptr
p_idaoff – if specified, will hold IDA stkoff after the call.
- Returns:
index of stkvar in the frame or -1
- get_stkoff(p_vdoff: sval_t *) bool
Get the referenced stack offset. This function can also handle mop_sc if it is entirely mapped into a continuous stack region.
- Parameters:
p_vdoff – the output buffer
- Returns:
success
- get_insn(code: mcode_t) minsn_t *
Get subinstruction of the operand. If the operand has a subinstruction with the specified opcode, return it.
- Parameters:
code – desired opcode
- Returns:
pointer to the instruction or nullptr
- make_low_half(width: int) bool
Make the low part of the operand. This function takes into account the memory endianness (byte sex)
- Parameters:
width – the desired size of the operand part in bytes
- Returns:
success
- make_high_half(width: int) bool
Make the high part of the operand. This function takes into account the memory endianness (byte sex)
- Parameters:
width – the desired size of the operand part in bytes
- Returns:
success
- make_first_half(width: int) bool
Make the first part of the operand. This function does not care about the memory endianness
- Parameters:
width – the desired size of the operand part in bytes
- Returns:
success
- make_second_half(width: int) bool
Make the second part of the operand. This function does not care about the memory endianness
- Parameters:
width – the desired size of the operand part in bytes
- Returns:
success
- shift_mop(offset: int) bool
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
- Parameters:
offset – shift count (the number of bytes to shift)
- Returns:
success
- change_size(nsize: int, sideff: side_effect_t = WITH_SIDEFF) bool
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
- Parameters:
nsize – new operand size
sideff – may modify the database because of the size change?
- Returns:
success
- preserve_side_effects(blk: mblock_t, top: minsn_t, moved_calls: bool * = None) bool
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.
- Parameters:
blk – current block
top – top level instruction that contains our operand
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
- apply_ld_mcode(mcode: mcode_t, ea: ida_idaapi.ea_t, newsize: int) None
Apply a unary opcode to the operand.
- Parameters:
mcode – opcode to apply. it must accept ‘l’ and ‘d’ operands but not ‘r’. examples: m_low/m_high/m_xds/m_xdu
ea – value of minsn_t::ea for the newly created insruction
newsize – new operand size Example: apply_ld_mcode(m_low) will convert op => low(op)
- apply_xdu(ea: ida_idaapi.ea_t, newsize: int) None
- apply_xds(ea: ida_idaapi.ea_t, newsize: int) None
- obj_id
- replace_by(o)
- meminfo
- property nnn
- property d
- property s
- property f
- property l
- property a
- property c
- property fpc
- property pair
- property scif
- property r
- property g
- property b
- property cstr
- property helper
- ida_hexrays.OPROP_IMPDONE
imported operand (a pointer) has been dereferenced
- ida_hexrays.OPROP_UDT
a struct or union
- ida_hexrays.OPROP_FLOAT
possibly floating value
- ida_hexrays.OPROP_CCFLAGS
mop_n: a pc-relative value mop_a: an address obtained from a relocation else: value of a condition code register (like mr_cc)
- ida_hexrays.OPROP_UDEFVAL
uses undefined value
- ida_hexrays.OPROP_LOWADDR
a low address offset
- ida_hexrays.OPROP_ABI
is used to organize arg/retval of a call such operands should be combined more carefully than others at least on BE platforms
- class ida_hexrays.mcallarg_t(*args)
Bases:
mop_t- thisown
- ea: ida_idaapi.ea_t
address where the argument was initialized. BADADDR means unknown.
- set_regarg(*args) None
This function has the following signatures:
set_regarg(mr: mreg_t, sz: int, tif: const tinfo_t &) -> None
set_regarg(mr: mreg_t, tif: const tinfo_t &) -> None
set_regarg(mr: mreg_t, dt: char, sign: type_sign_t=type_unsigned) -> None
# 0: set_regarg(mr: mreg_t, sz: int, tif: const tinfo_t &) -> None
# 1: set_regarg(mr: mreg_t, tif: const tinfo_t &) -> None
# 2: set_regarg(mr: mreg_t, dt: char, sign: type_sign_t=type_unsigned) -> None
- make_int(val: int, val_ea: ida_idaapi.ea_t, opno: int = 0) None
- make_uint(val: int, val_ea: ida_idaapi.ea_t, opno: int = 0) None
- ida_hexrays.ROLE_UNK
unknown function role
- ida_hexrays.ROLE_EMPTY
empty, does not do anything (maybe spoils regs)
- ida_hexrays.ROLE_BUG
BUG() helper macro: never returns, causes exception.
- ida_hexrays.ROLE_ALLOCA
alloca() function
- ida_hexrays.ROLE_BSWAP
bswap() function (any size)
- ida_hexrays.ROLE_PRESENT
present() function (used in patterns)
- ida_hexrays.ROLE_CONTAINING_RECORD
CONTAINING_RECORD() macro.
- ida_hexrays.ROLE_FASTFAIL
__fastfail()
- ida_hexrays.ROLE_READFLAGS
__readeflags, __readcallersflags
- ida_hexrays.ROLE_IS_MUL_OK
is_mul_ok
- ida_hexrays.ROLE_SATURATED_MUL
saturated_mul
- ida_hexrays.ROLE_BITTEST
[lock] bt
- ida_hexrays.ROLE_BITTESTANDSET
[lock] bts
- ida_hexrays.ROLE_BITTESTANDRESET
[lock] btr
- ida_hexrays.ROLE_BITTESTANDCOMPLEMENT
[lock] btc
- ida_hexrays.ROLE_VA_ARG
va_arg() macro
- ida_hexrays.ROLE_VA_COPY
va_copy() function
- ida_hexrays.ROLE_VA_START
va_start() function
- ida_hexrays.ROLE_VA_END
va_end() function
- ida_hexrays.ROLE_ROL
rotate left
- ida_hexrays.ROLE_ROR
rotate right
- ida_hexrays.ROLE_CFSUB3
carry flag after subtract with carry
- ida_hexrays.ROLE_OFSUB3
overflow flag after subtract with carry
- ida_hexrays.ROLE_ABS
integer absolute value
- ida_hexrays.ROLE_3WAYCMP0
3-way compare helper, returns -1/0/1
- ida_hexrays.ROLE_3WAYCMP1
3-way compare helper, returns 0/1/2
- ida_hexrays.ROLE_SSE_CMP4
e.g. _mm_cmpgt_ss
- ida_hexrays.ROLE_SSE_CMP8
e.g. _mm_cmpgt_sd
- ida_hexrays.ROLE_EH_TRY
__eh_try() try block start
- ida_hexrays.ROLE_EH_WIND
__eh_wind() wind state (C++ destructors)
- ida_hexrays.ROLE_EH_CATCH
__eh_catch() catch block start
- ida_hexrays.ROLE_EH_CATCH_TYPE
__eh_catch_type() typed catch clause
- ida_hexrays.ROLE_EH_CATCH_ELLIPSIS
__eh_catch_ellipsis() catch-all
- ida_hexrays.ROLE_EH_UNWIND
__eh_unwind() destructor handler
- ida_hexrays.ROLE_EH_THROW
__eh_throw() throw statement
- ida_hexrays.ROLE_EH_TRY_CONTINUATION
__eh_try_continuation() internal
- ida_hexrays.ROLE_EH_SCOPE_STRUT
__eh_scope_strut() internal
- ida_hexrays.ROLE_EH_DEAD_END_TRY
__eh_dead_end_try() internal
- ida_hexrays.ROLE_EH_DEAD_END_WIND
__eh_dead_end_wind() internal
- ida_hexrays.ROLE_EH_PROPAGATE
__eh_propagate_exception_into_caller()
- ida_hexrays.ROLE_EH_CONTINUE_UNWINDING
__eh_continue_unwinding()
- ida_hexrays.ROLE_EH_ENTER_WIND_STATE
__eh_enter_wind_state() internal
- ida_hexrays.ROLE_EH_ENTER_TRY_STATE
__eh_enter_try_state() internal
- ida_hexrays.ROLE_EH_EXIT_WIND_STATE
__eh_exit_wind_state() internal
- ida_hexrays.ROLE_EH_EXIT_TRY_STATE
__eh_exit_try_state() internal
- ida_hexrays.ROLE_EH_NO_UNWIND_HANDLER
__eh_no_unwind_handler() internal
- ida_hexrays.ROLE_EH_CAUGHT_TYPE
__eh_caught_type() paired with catch_type
- ida_hexrays.ROLE_EH_CAUGHT_ELLIPSIS
__eh_caught_ellipsis() paired with catch_ellipsis
- ida_hexrays.ROLE_EH_CAUGHT
__eh_caught() internal
- ida_hexrays.ROLE_EH_RETHROW
__eh_rethrow_uncaught_exception() internal
- ida_hexrays.ROLE_EH_UNWIND_ABSENT
__eh_unwind_handler_absent() internal
- ida_hexrays.ROLE_EH_CATCH_ABSENT
__eh_catch_handler_absent() internal
- ida_hexrays.ROLE_NEW_OBJ
allocate new object instance
- ida_hexrays.ROLE_NEW_ARRAY
allocate new array
- ida_hexrays.ROLE_FILL_ARRAY
allocate and fill new array
- ida_hexrays.ROLE_ARRLEN
get array length
- ida_hexrays.ROLE_CHKCAST
check and cast object type
- ida_hexrays.ROLE_INSTANCEOF
test object type (returns 0/1)
- ida_hexrays.ROLE_LOCK
acquire lock (monitor enter)
- ida_hexrays.ROLE_UNLOCK
release lock (monitor exit)
- ida_hexrays.ROLE_IGET
get instance field
- ida_hexrays.ROLE_IPUT
set instance field
- ida_hexrays.ROLE_SGET
get static field
- ida_hexrays.ROLE_SPUT
set static field
- ida_hexrays.ROLE_AGET
get array element
- ida_hexrays.ROLE_APUT
set array element
- ida_hexrays.ROLE_FMOD
floating-point remainder (fmod)
- ida_hexrays.ROLE_INVOKE_VIRTUAL
instance method call (obj.method)
- ida_hexrays.ROLE_INVOKE_SUPER
parent class method call (super.method)
- ida_hexrays.ROLE_INVOKE_INIT
constructor call on new object (merged with new)
- ida_hexrays.ROLE_INVOKE_INIT_SUPER
constructor chain to parent (super(args))
- ida_hexrays.ROLE_INVOKE_INIT_THIS
constructor chain to self (this(args))
- ida_hexrays.ROLE_CATCH_EXCEPTION
get caught exception object (Dalvik MOVE_EXCEPTION)
- ida_hexrays.ROLE_CONST_CLASS
get class reference (Dalvik CONST_CLASS)
- ida_hexrays.ROLE_FILL_ARRAY_DATA
fill existing array with constant data (Dalvik FILL_ARRAY_DATA, no allocation)
- ida_hexrays.FUNC_NAME_MEMCPY
- ida_hexrays.FUNC_NAME_WMEMCPY
- ida_hexrays.FUNC_NAME_MEMSET
- ida_hexrays.FUNC_NAME_WMEMSET
- ida_hexrays.FUNC_NAME_MEMSET32
- ida_hexrays.FUNC_NAME_MEMSET64
- ida_hexrays.FUNC_NAME_STRCPY
- ida_hexrays.FUNC_NAME_WCSCPY
- ida_hexrays.FUNC_NAME_STRLEN
- ida_hexrays.FUNC_NAME_WCSLEN
- ida_hexrays.FUNC_NAME_STRCAT
- ida_hexrays.FUNC_NAME_WCSCAT
- ida_hexrays.FUNC_NAME_TAIL
- ida_hexrays.FUNC_NAME_VA_ARG
- ida_hexrays.FUNC_NAME_EMPTY
- ida_hexrays.FUNC_NAME_PRESENT
- ida_hexrays.FUNC_NAME_CONTAINING_RECORD
- ida_hexrays.FUNC_NAME_MORESTACK
- class ida_hexrays.mcallinfo_t(*args)
Bases:
object- thisown
- callee: ida_idaapi.ea_t
address of the called function, if known
- cc: callcnv_t
calling convention
- args: mcallargs_t
call arguments
- pass_regs: mlist_t
passthrough registers (subset of SPOILED) The called function only partially updates the register, preserving the previous values in other parts. For example, the bit set operation like PC’s _bittestandset().
- dead_regs: mlist_t
registers defined by the function but never used. upon propagation we do the following: * dead_regs += return_regs * retregs.clear() since the call is propagated
- role: funcrole_t
function role
- fti_attrs: type_attrs_t
extended function attributes
- lexcompare(f: mcallinfo_t) int
- ida_hexrays.FCI_PROP
call has been propagated
- ida_hexrays.FCI_DEAD
some return registers were determined dead
- ida_hexrays.FCI_FINAL
call type is final, should not be changed
- ida_hexrays.FCI_NORET
call does not return
- ida_hexrays.FCI_PURE
pure function
- ida_hexrays.FCI_NOSIDE
call does not have side effects
- ida_hexrays.FCI_SPLOK
spoiled/visible_memory lists have been optimized. for some functions we can reduce them as soon as information about the arguments becomes available. in order not to try optimize them again we use this bit.
- ida_hexrays.FCI_HASCALL
A function is an synthetic helper combined from several instructions and at least one of them was a call to a real functions
- ida_hexrays.FCI_HASFMT
A variadic function with recognized printf- or scanf-style format string
- ida_hexrays.FCI_EXPLOCS
all arglocs are specified explicitly
- class ida_hexrays.voff_t(*args)
Bases:
object- thisown
- type: mopt_t
mop_r - register, mop_S - stack, mop_z - undefined
- get_reg() mreg_t
- class ida_hexrays.vivl_t(*args)
Bases:
voff_t- thisown
- set(*args) None
This function has the following signatures:
set(_type: mopt_t, _off: int, _size: int=0) -> None
set(voff: const voff_t &, _size: int) -> None
# 0: set(_type: mopt_t, _off: int, _size: int=0) -> None
# 1: set(voff: const voff_t &, _size: int) -> None
- extend_to_cover(r: vivl_t) bool
Extend a value interval using another value interval of the same type
- Returns:
success
- class ida_hexrays.chain_t(*args)
Bases:
ida_pro.intvec_t- thisown
- flags: uchar
combination Chain properties bits
- key() voff_t const &
- get_reg() mreg_t
- endoff() voff_t const
- ida_hexrays.CHF_INITED
is chain initialized? (valid only after lvar allocation)
- ida_hexrays.CHF_REPLACED
chain operands have been replaced?
- ida_hexrays.CHF_OVER
overlapped chain
- ida_hexrays.CHF_FAKE
fake chain created by widen_chains()
- ida_hexrays.CHF_PASSTHRU
pass-thru chain, must use the input variable to the block
- ida_hexrays.CHF_TERM
terminating chain; the variable does not survive across the block
- class ida_hexrays.block_chains_t
Bases:
object- thisown
- get_reg_chain(reg: mreg_t, width: int = 1) chain_t *
Get chain for the specified register
- Parameters:
reg – register number
width – size of register in bytes
- get_stk_chain(off: int, width: int = 1) chain_t *
Get chain for the specified stack offset
- Parameters:
off – stack offset
width – size of stack value in bytes
- get_chain(*args) chain_t *
This function has the following signatures:
get_chain(k: const voff_t &, width: int=1) -> const chain_t *
get_chain(k: const voff_t &, width: int=1) -> chain_t *
get_chain(ch: const chain_t &) -> const chain_t *
get_chain(ch: const chain_t &) -> chain_t *
# 0: get_chain(k: const voff_t &, width: int=1) -> const chain_t *
Get chain for the specified value offset.
# 1: get_chain(k: const voff_t &, width: int=1) -> chain_t *
# 2: get_chain(ch: const chain_t &) -> const chain_t *
Get chain similar to the specified chain
# 3: get_chain(ch: const chain_t &) -> chain_t *
- class ida_hexrays.chain_visitor_t
Bases:
object- thisown
- parent: block_chains_t *
parent of the current chain
- class ida_hexrays.graph_chains_t
Bases:
block_chains_vec_t- thisown
- for_all_chains(cv: chain_visitor_t, gca_flags: int) int
Visit all chains
- Parameters:
cv – chain visitor
gca_flags – combination of GCA_ bits
- is_locked() bool
Are the chains locked? It is a good idea to lock the chains before using them. This ensures that they won’t be recalculated and reallocated during the use. See the chain_keeper_t class for that.
- swap(r: graph_chains_t) None
- ida_hexrays.GCA_EMPTY
include empty chains
- ida_hexrays.GCA_SPEC
include chains for special registers
- ida_hexrays.GCA_ALLOC
enumerate only allocated chains
- ida_hexrays.GCA_NALLOC
enumerate only non-allocated chains
- ida_hexrays.GCA_OFIRST
consider only chains of the first block
- ida_hexrays.GCA_OLAST
consider only chains of the last block
- class ida_hexrays.minsn_t(*args)
Bases:
object- thisown
- opcode: mcode_t
instruction opcode
- next: minsn_t *
next insn in doubly linked list. check also nexti()
- prev: minsn_t *
prev insn in doubly linked list. check also previ()
- ea: ida_idaapi.ea_t
instruction address
- swap(m: minsn_t) None
Swap two instructions. The prev/next fields are not modified by this function because it would corrupt the doubly linked list.
- setaddr(new_ea: ida_idaapi.ea_t) None
Change the instruction address. This function modifies subinstructions as well.
- optimize_solo(optflags: int = 0) int
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.
- Parameters:
optflags – combination of optimization flags bits
- Returns:
number of changes, 0-unchanged See also mblock_t::optimize_insn()
- optimize_subtree(blk: mblock_t, top: minsn_t, parent: minsn_t, converted_call: ea_t *, optflags: int = 2) int
Optimize instruction in its context. Do not use this function, use mblock_t::optimize()
- for_all_ops(mv: mop_visitor_t) int
Visit all instruction operands. This function visits subinstruction operands as well.
- Parameters:
mv – operand visitor
- Returns:
non-zero value returned by mv.visit_mop() or zero
- for_all_insns(mv: minsn_visitor_t) int
Visit all instructions. This function visits the instruction itself and all its subinstructions.
- Parameters:
mv – instruction visitor
- Returns:
non-zero value returned by mv.visit_mop() or zero
- equal_insns(m: minsn_t, eqflags: int) bool
Compare instructions. This is the main comparison function for instructions.
- Parameters:
m – instruction to compare with
eqflags – combination of comparison bits bits
- is_noret_call(flags: int = 0) bool
Is a non-returing call?
- Parameters:
flags – combination of NORET_… bits
- is_unknown_call() bool
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_helper(name: str) bool
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_call(with_helpers: bool = False) minsn_t *
Find a call instruction. Check for the current instruction and its subinstructions.
- Parameters:
with_helpers – consider helper calls as well?
- has_side_effects(include_ldx_and_divs: bool = False) bool
Does the instruction have a side effect?
- Parameters:
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.
- get_role() funcrole_t
Get the function role of a call.
- contains_opcode(mcode: mcode_t) bool
Does the instruction have the specified opcode? This function searches subinstructions as well.
- Parameters:
mcode – opcode to search for.
- find_opcode(mcode: mcode_t) minsn_t *
Find a (sub)insruction with the specified opcode.
- Parameters:
mcode – opcode to search for.
- find_ins_op(op: mcode_t = m_nop) minsn_t *
- Find an operand that is a subinstruction with the specified opcode. This function checks only the ‘l’ and ‘r’ operands of the current insn. It replaces the common pattern:
( side = 0; side < 2; side++ )
- Parameters:
op – opcode to search for (m_nop matches any subinstruction)
- Returns:
pointer to the found subinstruction (l.d or r.d), or nullptr
- find_num_op() mop_t *
- Find a numeric operand of the current instruction (operand with t == mop_n). This function checks only the ‘l’ and ‘r’ operands of the current insn. It replaces the common pattern:
( side = 0; side < 2; side++ )
- Returns:
&l or &r, or nullptr if neither operand is numeric
- modifies_d() bool
Does the instruction modify its ‘d’ operand? Some instructions (e.g. m_stx) do not modify the ‘d’ operand.
- is_between(m1: minsn_t, m2: minsn_t) bool
Is the instruction in the specified range of instructions?
- Parameters:
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_after(m: minsn_t) bool
Is the instruction after the specified one?
- Parameters:
m – the instruction to compare against in the list
- deserialize(bytes: uchar const *, format_version: int) bool
Deserialize an instruction
- Parameters:
bytes – pointer to serialized data
format_version – serialization format version. this value is returned by minsn_t::serialize()
- Returns:
success
- serialize() Tuple[int, bytes]
Serialize an instruction
- Returns:
tuple(serialization format, serialized bytes)
- obj_id
- replace_by(o)
- meminfo
- ida_hexrays.IPROP_OPTIONAL
optional instruction
- ida_hexrays.IPROP_PERSIST
persistent insn; they are not destroyed
- ida_hexrays.IPROP_WILDMATCH
match multiple insns
- ida_hexrays.IPROP_CLNPOP
the purpose of the instruction is to clean stack (e.g. “pop ecx” is often used for that)
- ida_hexrays.IPROP_FPINSN
floating point insn
- ida_hexrays.IPROP_FARCALL
call of a far function using push cs/call sequence
- ida_hexrays.IPROP_TAILCALL
tail call
- ida_hexrays.IPROP_ASSERT
assertion: usually mov #val, op. assertions are used to help the optimizer. assertions are ignored when generating ctree
- ida_hexrays.IPROP_SPLIT
the instruction has been split:
- ida_hexrays.IPROP_SPLIT1
into 1 byte
- ida_hexrays.IPROP_SPLIT2
into 2 bytes
- ida_hexrays.IPROP_SPLIT4
into 4 bytes
- ida_hexrays.IPROP_SPLIT8
into 8 bytes
- ida_hexrays.IPROP_COMBINED
insn has been modified because of a partial reference
- ida_hexrays.IPROP_EXTSTX
this is m_ext propagated into m_stx
- ida_hexrays.IPROP_IGNLOWSRC
low part of the instruction source operand has been created artificially (this bit is used only for ‘and x, 80…’)
- ida_hexrays.IPROP_INV_JX
inverted conditional jump
- ida_hexrays.IPROP_WAS_NORET
was noret icall
- ida_hexrays.IPROP_MULTI_MOV
bits that can be set by plugins:
the minsn was generated as part of insn that moves multiple registers (example: STM on ARM may transfer multiple registers)
- ida_hexrays.IPROP_DONT_PROP
may not propagate
- ida_hexrays.IPROP_DONT_COMB
may not combine this instruction with others
- ida_hexrays.IPROP_MBARRIER
this instruction acts as a memory barrier (instructions accessing memory may not be reordered past it)
- ida_hexrays.IPROP_UNMERGED
‘goto’ instruction was transformed info ‘call’
- ida_hexrays.IPROP_UNPAIRED
instruction is a result of del_dest_pairs() transformation
- ida_hexrays.IPROP_WAS_FUNC
mov-instruction was initially a memcpy call
- ida_hexrays.OPTI_ADDREXPRS
optimize all address expressions (&x+N; &x-&y)
- ida_hexrays.OPTI_MINSTKREF
may update minstkref
- ida_hexrays.OPTI_COMBINSNS
may combine insns (only for optimize_insn)
- ida_hexrays.OPTI_NO_LDXOPT
the function is called after the propagation attempt, we do not optimize low/high(ldx) in this case
- ida_hexrays.OPTI_NO_VALRNG
forbid using valranges
- ida_hexrays.EQ_IGNSIZE
ignore source operand sizes
- ida_hexrays.EQ_IGNCODE
ignore instruction opcodes
- ida_hexrays.EQ_CMPDEST
compare instruction destinations
- ida_hexrays.EQ_OPTINSN
optimize mop_d operands
- ida_hexrays.NORET_IGNORE_WAS_NORET_ICALL
- ida_hexrays.NORET_FORBID_ANALYSIS
- class ida_hexrays.intval64_t(v: uint64 = 0, _s: int = 1)
Bases:
object- thisown
- val: uint64
- sval() int64
- uval() uint64
- sext(target_sz: int) intval64_t
- zext(target_sz: int) intval64_t
- low(target_sz: int) intval64_t
- high(target_sz: int) intval64_t
- sdiv(o: intval64_t) intval64_t
- smod(o: intval64_t) intval64_t
- sar(o: intval64_t) intval64_t
- class ida_hexrays.int64_emulator_t
Bases:
object- thisown
- get_mop_value(mop: mop_t) intval64_t
- read_glbmem(arg0: ida_idaapi.ea_t, arg1: int) intval64_t
- write_glbmem(arg0: ida_idaapi.ea_t, arg1: int, arg2: intval64_t) None
- mop_value(mop: mop_t) intval64_t
- minsn_value(insn: minsn_t) intval64_t
- ida_hexrays.BLT_NONE
unknown block type
- ida_hexrays.BLT_STOP
stops execution regularly (must be the last block)
- ida_hexrays.BLT_0WAY
does not have successors (tail is a noret function)
- ida_hexrays.BLT_1WAY
passes execution to one block (regular or goto block)
- ida_hexrays.BLT_2WAY
passes execution to two blocks (conditional jump)
- ida_hexrays.BLT_NWAY
passes execution to many blocks (switch idiom)
- ida_hexrays.BLT_XTRN
external block (out of function address)
- class ida_hexrays.mblock_t(*args, **kwargs)
Bases:
object- thisown
- nextb: mblock_t *
next block in the doubly linked list
- prevb: mblock_t *
previous block in the doubly linked list
- start: ida_idaapi.ea_t
start address
- end: ida_idaapi.ea_t
end address note: we cannot rely on start/end addresses very much because instructions are propagated between blocks
- head: minsn_t *
pointer to the first instruction of the block
- tail: minsn_t *
pointer to the last instruction of the block
- mba: mba_t *
the parent micro block array
- type: mblock_type_t
block type (BLT_NONE - not computed yet)
- minbstkref: int
lowest stack location accessible with indirect addressing (offset from the stack bottom) initially it is 0 (not computed)
- verify_insn(m: minsn_t) None
Verify an instruction. This function will generate an internal error if something is wrong with the instruction.
- insert_into_block(nm: minsn_t, om: minsn_t) minsn_t *
Insert instruction into the doubly linked list
- Parameters:
nm – new instruction
om – existing instruction, part of the doubly linked list if nullptr, then the instruction will be inserted at the beginning of the list NM will be inserted immediately after OM
- Returns:
pointer to NM
- remove_from_block(m: minsn_t) minsn_t *
Remove instruction from the doubly linked list
- Parameters:
m – instruction to remove The removed instruction is not deleted, the caller gets its ownership
- Returns:
pointer to the next instruction
- for_all_insns(mv: minsn_visitor_t) int
Visit all instructions. This function visits subinstructions too.
- Parameters:
mv – instruction visitor
- Returns:
zero or the value returned by mv.visit_insn() See also mba_t::for_all_topinsns()
- for_all_ops(mv: mop_visitor_t) int
Visit all operands. This function visit subinstruction operands too.
- Parameters:
mv – operand visitor
- Returns:
zero or the value returned by mv.visit_mop()
- for_all_uses(list: mlist_t, i1: minsn_t, i2: minsn_t, mmv: mlist_mop_visitor_t) int
Visit all operands that use LIST.
- Parameters:
list – ptr to the list of locations. it may be modified: parts that get redefined by the instructions in [i1,i2) will be deleted.
i1 – starting instruction. must be a top level insn.
i2 – ending instruction (excluded). must be a top level insn.
mmv – operand visitor
- Returns:
zero or the value returned by mmv.visit_mop()
- optimize_insn(*args) int
Optimize one instruction in the context of the block.
- Parameters:
m – pointer to a top level instruction
optflags – combination of optimization flags bits
- Returns:
number of changes made to the block This function may change other instructions in the block too. However, it will not destroy top level instructions (it may convert them to nop’s). This function performs only intrablock modifications. See also minsn_t::optimize_solo()
- optimize_block() int
Optimize a basic block. Usually there is no need to call this function explicitly because the decompiler will call it itself if optinsn_t::func or optblock_t::func return non-zero.
- Returns:
number of changes made to the block
- build_lists(kill_deads: bool) int
Build def-use lists and eliminate deads.
- Parameters:
kill_deads – do delete dead instructions?
- Returns:
the number of eliminated instructions Better mblock_t::call make_lists_ready() rather than this function.
- optimize_useless_jump() int
Remove a jump at the end of the block if it is useless. This function preserves any side effects when removing a useless jump. Both conditional and unconditional jumps are handled (and jtbl too). This function deletes useless jumps, not only replaces them with a nop. (please note that optimize_insn does not handle useless jumps).
- Returns:
number of changes made to the block
- append_use_list(*args) None
Append use-list of an operand. This function calculates list of locations that may or must be used by the operand and appends it to LIST.
- Parameters:
list – ptr to the output buffer. we will append to it.
op – operand to calculate the use list of
maymust – should we calculate ‘may-use’ or ‘must-use’ list? see maymust_t for more details.
mask – if only part of the operand should be considered, a bitmask can be used to specify which part. example: op=AX,mask=0xFF means that we will consider only AL.
- append_def_list(list: mlist_t, op: mop_t, maymust: maymust_t) None
Append def-list of an operand. This function calculates list of locations that may or must be modified by the operand and appends it to LIST.
- Parameters:
list – ptr to the output buffer. we will append to it.
op – operand to calculate the def list of
maymust – should we calculate ‘may-def’ or ‘must-def’ list? see maymust_t for more details.
- build_use_list(ins: minsn_t, maymust: maymust_t) mlist_t
Build use-list of an instruction. This function calculates list of locations that may or must be used by the instruction. Examples: “ldx ds.2, eax.4, ebx.4”, may-list: all aliasable memory “ldx ds.2, eax.4, ebx.4”, must-list: empty Since LDX uses EAX for indirect access, it may access any aliasable memory. On the other hand, we cannot tell for sure which memory cells will be accessed, this is why the must-list is empty.
- Parameters:
ins – instruction to calculate the use list of
maymust – should we calculate ‘may-use’ or ‘must-use’ list? see maymust_t for more details.
- Returns:
the calculated use-list
- build_def_list(ins: minsn_t, maymust: maymust_t) mlist_t
Build def-list of an instruction. This function calculates list of locations that may or must be modified by the instruction. Examples: “stx ebx.4, ds.2, eax.4”, may-list: all aliasable memory “stx ebx.4, ds.2, eax.4”, must-list: empty Since STX uses EAX for indirect access, it may modify any aliasable memory. On the other hand, we cannot tell for sure which memory cells will be modified, this is why the must-list is empty.
- Parameters:
ins – instruction to calculate the def list of
maymust – should we calculate ‘may-def’ or ‘must-def’ list? see maymust_t for more details.
- Returns:
the calculated def-list
- is_used(*args) bool
Is the list used by the specified instruction range?
- Parameters:
list – list of locations. LIST may be modified by the function: redefined locations will be removed from it.
i1 – starting instruction of the range (must be a top level insn)
i2 – end instruction of the range (must be a top level insn) i2 is excluded from the range. it can be specified as nullptr. i1 and i2 must belong to the same block.
maymust – should we search in ‘may-access’ or ‘must-access’ mode?
- find_first_use(*args) minsn_t *
This function has the following signatures:
# 0: find_first_use(list: mlist_t *, i1: const minsn_t *, i2: const minsn_t *, maymust: maymust_t=MAY_ACCESS) -> const minsn_t *
Find the first insn that uses the specified list in the insn range.
- Returns:
pointer to such instruction or nullptr. Upon return LIST will contain only locations not redefined by insns [i1..result]
# 1: find_first_use(list: mlist_t *, i1: minsn_t *, i2: const minsn_t *, maymust: maymust_t=MAY_ACCESS) -> minsn_t *
- is_redefined(*args) bool
Is the list redefined by the specified instructions?
- Parameters:
list – list of locations to check.
i1 – starting instruction of the range (must be a top level insn)
i2 – end instruction of the range (must be a top level insn) i2 is excluded from the range. it can be specified as nullptr. i1 and i2 must belong to the same block.
maymust – should we search in ‘may-access’ or ‘must-access’ mode?
- find_redefinition(*args) minsn_t *
This function has the following signatures:
# 0: find_redefinition(list: const mlist_t &, i1: const minsn_t *, i2: const minsn_t *, maymust: maymust_t=MAY_ACCESS) -> const minsn_t *
Find the first insn that redefines any part of the list in the insn range.
- Returns:
pointer to such instruction or nullptr.
# 1: find_redefinition(list: const mlist_t &, i1: minsn_t *, i2: const minsn_t *, maymust: maymust_t=MAY_ACCESS) -> minsn_t *
- is_rhs_redefined(ins: minsn_t, i1: minsn_t, i2: minsn_t) bool
Is the right hand side of the instruction redefined the insn range? “right hand side” corresponds to the source operands of the instruction.
- Parameters:
ins – instruction to consider
i1 – starting instruction of the range (must be a top level insn)
i2 – end instruction of the range (must be a top level insn) i2 is excluded from the range. it can be specified as nullptr. i1 and i2 must belong to the same block.
- find_access(op: mop_t, parent: minsn_t, mend: minsn_t, fdflags: int) Tuple[minsn_t, minsn_t]
Find the instruction that accesses the specified operand. This function searches inside one block.
- Parameters:
op – operand to search for
parent – top-level instruction denoting the beginning of the search range (must not be None). parent and mend must belong to the same block.
mend – end instruction of the range (must be a top level insn). mend is excluded from the range. None means search to the block boundary.
fdflags – combination of FD_ bits
- Returns:
(found, parent) tuple. found: the instruction that accesses the operand. This instruction may be a sub-instruction. None means ‘not found’. parent: the top-level instruction containing ‘found’.
- find_def(op: mop_t, p_i1: minsn_t, i2: minsn_t, fdflags: int) Tuple[minsn_t, minsn_t]
Find the instruction that defines the specified operand. Convenience wrapper around find_access() with FD_DEF.
- Parameters:
op – operand to search for
p_i1 – top-level instruction denoting the beginning of the search range (must not be None). p_i1 and i2 must belong to the same block.
i2 – end instruction of the range (excluded). None means search to the block boundary.
fdflags – combination of FD_ bits (see find_access)
- Returns:
(found, parent) tuple. See find_access().
- find_use(op: mop_t, p_i1: minsn_t, i2: minsn_t, fdflags: int) Tuple[minsn_t, minsn_t]
Find the instruction that uses the specified operand. Convenience wrapper around find_access() with FD_USE.
- Parameters:
op – operand to search for
p_i1 – top-level instruction denoting the beginning of the search range (must not be None). p_i1 and i2 must belong to the same block.
i2 – end instruction of the range (excluded). None means search to the block boundary.
fdflags – combination of FD_ bits (see find_access)
- Returns:
(found, parent) tuple. See find_access().
- get_valranges(*args) bool
This function has the following signatures:
# 0: get_valranges(res: valrng_t *, vivl: const vivl_t &, vrflags: int) -> bool
Find possible values for a block.
# 1: get_valranges(res: valrng_t *, vivl: const vivl_t &, m: const minsn_t *, vrflags: int) -> bool
Find possible values for an instruction.
- make_nop(m: minsn_t) None
Erase the instruction (convert it to nop) and mark the lists dirty. This is the recommended function to use because it also marks the block use-def lists dirty.
- get_reginsn_qty() int
Calculate number of regular instructions in the block. Assertions are skipped by this function.
- Returns:
Number of non-assertion instructions in the block.
- undef_spoiled_regs(m: minsn_t) None
Undefine registers spoiled by the instruction m (insert new ‘und’ instruction for them, after ‘m’). This is useful after replacing a call instruction with a different instruction.
- preds()
- succs()
- ida_hexrays.MBL_PRIV
private block - no instructions except the specified are accepted (used in patterns)
- ida_hexrays.MBL_NONFAKE
regular block
- ida_hexrays.MBL_FAKE
fake block
- ida_hexrays.MBL_GOTO
this block is a goto target
- ida_hexrays.MBL_TCAL
aritifical call block for tail calls
- ida_hexrays.MBL_PUSH
needs “convert push/pop instructions”
- ida_hexrays.MBL_DMT64
needs “demote 64bits”
- ida_hexrays.MBL_COMB
needs “combine” pass
- ida_hexrays.MBL_PROP
needs ‘propagation’ pass
- ida_hexrays.MBL_DEAD
needs “eliminate deads” pass
- ida_hexrays.MBL_LIST
use/def lists are ready (not dirty)
- ida_hexrays.MBL_INCONST
inconsistent lists: we are building them
- ida_hexrays.MBL_CALL
call information has been built
- ida_hexrays.MBL_BACKPROP
performed backprop_cc
- ida_hexrays.MBL_NORET
dead end block: doesn’t return execution control
- ida_hexrays.MBL_DSLOT
block for delay slot
- ida_hexrays.MBL_VALRANGES
should optimize using value ranges
- ida_hexrays.MBL_KEEP
do not remove even if unreachable
- ida_hexrays.MBL_INLINED
block was inlined, not originally part of mbr
- ida_hexrays.MBL_EXTFRAME
an inlined block with an external frame
- ida_hexrays.FD_BACKWARD
search direction
- ida_hexrays.FD_FORWARD
search direction
- ida_hexrays.FD_USE
look for use
- ida_hexrays.FD_DEF
look for definition
- ida_hexrays.FD_DIRTY
ignore possible implicit definitions by function calls and indirect memory access
- ida_hexrays.VR_AT_START
get value ranges before the instruction or at the block start (if M is nullptr)
- ida_hexrays.VR_AT_END
get value ranges after the instruction or at the block end, just after the last instruction (if M is nullptr)
- ida_hexrays.VR_EXACT
find exact match. if not set, the returned valrng size will be >= vivl.size
- ida_hexrays.WARN_VARARG_REGS
0 cannot handle register arguments in vararg function, discarded them
- ida_hexrays.WARN_ILL_PURGED
1 odd caller purged bytes d, correcting
- ida_hexrays.WARN_ILL_FUNCTYPE
2 invalid function type ‘s’ has been ignored
- ida_hexrays.WARN_VARARG_TCAL
3 cannot handle tail call to vararg
- ida_hexrays.WARN_VARARG_NOSTK
4 call vararg without local stack
- ida_hexrays.WARN_VARARG_MANY
5 too many varargs, some ignored
- ida_hexrays.WARN_ADDR_OUTARGS
6 cannot handle address arithmetics in outgoing argument area of stack frame - unused
- ida_hexrays.WARN_DEP_UNK_CALLS
7 found interdependent unknown calls
- ida_hexrays.WARN_ILL_ELLIPSIS
8 erroneously detected ellipsis type has been ignored
- ida_hexrays.WARN_GUESSED_TYPE
9 using guessed type s;
- ida_hexrays.WARN_EXP_LINVAR
10 failed to expand a linear variable
- ida_hexrays.WARN_WIDEN_CHAINS
11 failed to widen chains
- ida_hexrays.WARN_BAD_PURGED
12 inconsistent function type and number of purged bytes
- ida_hexrays.WARN_CBUILD_LOOPS
13 too many cbuild loops
- ida_hexrays.WARN_NO_SAVE_REST
14 could not find valid save-restore pair for s
- ida_hexrays.WARN_ODD_INPUT_REG
15 odd input register s
- ida_hexrays.WARN_ODD_ADDR_USE
16 odd use of a variable address
- ida_hexrays.WARN_MUST_RET_FP
17 function return type is incorrect (must be floating point)
- ida_hexrays.WARN_ILL_FPU_STACK
18 inconsistent fpu stack
- ida_hexrays.WARN_SELFREF_PROP
19 self-referencing variable has been detected
- ida_hexrays.WARN_WOULD_OVERLAP
20 variables would overlap: s
- ida_hexrays.WARN_ARRAY_INARG
21 array has been used for an input argument
- ida_hexrays.WARN_MAX_ARGS
22 too many input arguments, some ignored
- ida_hexrays.WARN_BAD_FIELD_TYPE
23 incorrect structure member type for s::s, ignored
- ida_hexrays.WARN_WRITE_CONST
24 write access to const memory at a has been detected
- ida_hexrays.WARN_BAD_RETVAR
25 wrong return variable
- ida_hexrays.WARN_FRAG_LVAR
26 fragmented variable at s may be wrong
- ida_hexrays.WARN_HUGE_STKOFF
27 exceedingly huge offset into the stack frame
- ida_hexrays.WARN_UNINITED_REG
28 reference to an uninitialized register has been removed: s
- ida_hexrays.WARN_FIXED_INSN
29 fixed broken insn
- ida_hexrays.WARN_WRONG_VA_OFF
30 wrong offset of va_list variable
- ida_hexrays.WARN_CR_NOFIELD
31 CONTAINING_RECORD: no field ‘s’ in struct ‘s’ at d
- ida_hexrays.WARN_CR_BADOFF
32 CONTAINING_RECORD: too small offset d for struct ‘s’
- ida_hexrays.WARN_BAD_STROFF
33 user specified stroff has not been processed: s
- ida_hexrays.WARN_BAD_VARSIZE
34 inconsistent variable size for ‘s’
- ida_hexrays.WARN_UNSUPP_REG
35 unsupported processor register ‘s’
- ida_hexrays.WARN_UNALIGNED_ARG
36 unaligned function argument ‘s’
- ida_hexrays.WARN_BAD_STD_TYPE
37 corrupted or unexisting local type ‘s’
- ida_hexrays.WARN_BAD_CALL_SP
38 bad sp value at call
- ida_hexrays.WARN_MISSED_SWITCH
39 wrong markup of switch jump, skipped it
- ida_hexrays.WARN_BAD_SP
40 positive sp value a has been found
- ida_hexrays.WARN_BAD_STKPNT
41 wrong sp change point
- ida_hexrays.WARN_UNDEF_LVAR
42 variable ‘s’ is possibly undefined
- ida_hexrays.WARN_JUMPOUT
43 control flows out of bounds
- ida_hexrays.WARN_BAD_VALRNG
44 values range analysis failed
- ida_hexrays.WARN_BAD_SHADOW
45 ignored the value written to the shadow area of the succeeding call
- ida_hexrays.WARN_OPT_VALRNG
46 conditional instruction was optimized away because s
- ida_hexrays.WARN_RET_LOCREF
47 returning address of temporary local variable ‘s’
- ida_hexrays.WARN_BAD_MAPDST
48 too short map destination ‘s’ for variable ‘s’
- ida_hexrays.WARN_BAD_INSN
49 bad instruction
- ida_hexrays.WARN_ODD_ABI
50 encountered odd instruction for the current ABI
- ida_hexrays.WARN_UNBALANCED_STACK
51 unbalanced stack, ignored a potential tail call
- ida_hexrays.WARN_OPT_VALRNG2
52 mask 0xX is shortened because s <= 0xX”
- ida_hexrays.WARN_OPT_VALRNG3
53 masking with 0XX was optimized away because s <= 0xX
- ida_hexrays.WARN_OPT_USELESS_JCND
54 simplified comparisons for ‘s’: s became s
- ida_hexrays.WARN_SUBFRAME_OVERFLOW
55 call arguments overflow the function chunk frame
- ida_hexrays.WARN_OPT_VALRNG4
56 the cases s were optimized away because s
- ida_hexrays.WARN_FRAME_ACCESS
57 illegal frame access
- ida_hexrays.WARN_BAD_EHINFO
58 inconsistent exception info
- ida_hexrays.WARN_INCOMPAT_TYPE
59 incompatible types for ‘s’: expected s but encountered s
- ida_hexrays.WARN_DALVIK_ENUM
60 could not fully analyze enum <clinit>; constant order or bodies may be incomplete
- ida_hexrays.WARN_MAX
may be used in notes as a placeholder when the warning id is not available
- class ida_hexrays.hexwarn_t
Bases:
object- thisown
- ea: ida_idaapi.ea_t
Address where the warning occurred.
- id: warnid_t
Warning id.
- ida_hexrays.MMAT_ZERO
microcode does not exist
- ida_hexrays.MMAT_GENERATED
generated microcode
- ida_hexrays.MMAT_PREOPTIMIZED
preoptimized pass is complete
- ida_hexrays.MMAT_LOCOPT
local optimization of each basic block is complete. control flow graph is ready too.
- ida_hexrays.MMAT_CALLS
detected call arguments. see also hxe_calls_done
- ida_hexrays.MMAT_GLBOPT1
performed the first pass of global optimization
- ida_hexrays.MMAT_GLBOPT2
most global optimization passes are done
- ida_hexrays.MMAT_GLBOPT3
completed all global optimization. microcode is fixed now.
- ida_hexrays.MMAT_LVARS
allocated local variables
- class ida_hexrays.minsn_locator_t(*args)
Bases:
object- thisown
- ea: ida_idaapi.ea_t
address of the minsn
- mcode: mcode_t
opcode of the minsn
- compare(r: minsn_locator_t) int
- ida_hexrays.UMA_DEL
delete the instruction
- ida_hexrays.UMA_INS
insert the instruction before the current
- ida_hexrays.UMA_APP
insert the instruction after the current
- ida_hexrays.UMA_MAX
- class ida_hexrays.user_minsn_t
Bases:
object- thisown
- loc: minsn_locator_t
location of the target microinstruction
- action: user_minsn_action_t
action type
- compare(r: user_minsn_t) int
- ida_hexrays.add_user_minsn(entry_ea: ida_idaapi.ea_t, uins: user_minsn_t, mmat: mba_maturity_t) None
Add a user-defined microinstruction action. This is a standalone version that loads user minsns from the database, adds the action, and saves back. Use it when an mba_t is not available.
- Parameters:
entry_ea – entry address of the function
uins – user minsn to add (includes location, action, and instruction)
mmat – maturity level to add the action to
- ida_hexrays.del_user_minsn(entry_ea: ida_idaapi.ea_t, loc: minsn_locator_t, action: user_minsn_action_t, mmat: mba_maturity_t) bool
Delete a user-defined microinstruction action. This is a standalone version that loads user minsns from the database, deletes the action, and saves back. Use it when an mba_t is not available.
- Parameters:
entry_ea – entry address of the function
loc – location of the target microinstruction
action – action type to delete (UMA_DEL, UMA_INS, or UMA_APP)
mmat – maturity level to delete the action from
- Returns:
true if the action was found and deleted
- ida_hexrays.MMIDX_GLBLOW
global memory: low part
- ida_hexrays.MMIDX_LVARS
stack: local variables
- ida_hexrays.MMIDX_RETADDR
stack: return address
- ida_hexrays.MMIDX_SHADOW
stack: shadow arguments
- ida_hexrays.MMIDX_ARGS
stack: regular stack arguments
- ida_hexrays.MMIDX_GLBHIGH
global memory: high part
- class ida_hexrays.mba_ranges_t(*args)
Bases:
object- thisown
- pfn: func_t *
function to decompile. if not null, then function mode.
- ranges: rangevec_t
snippet mode: ranges to decompile. function mode: list of outlined ranges
- start() ida_idaapi.ea_t
- class ida_hexrays.decomp_ranges_t(*args)
Bases:
object- thisown
- func_ea: ida_idaapi.ea_t
function to decompile. if not BADADDR, then function mode.
- ranges: rangevec_t
snippet mode: ranges to decompile. function mode: list of outlined ranges
- start() ida_idaapi.ea_t
- class ida_hexrays.mba_range_iterator_t
Bases:
object- thisown
- rii: range_chunk_iterator_t
- fii: func_tail_iterator_t
- set(mbr: mba_ranges_t) bool
- chunk() range_t const &