IDAPython 8.4
|
Proxy of C++ mblock_t class.
Public Member Functions | |
__init__ (self, *args, **kwargs) | |
"void" | mark_lists_dirty (self, *args) |
mark_lists_dirty(self) | |
"void" | request_propagation (self, *args) |
request_propagation(self) | |
"bool" | needs_propagation (self, *args) |
needs_propagation(self) -> bool | |
"void" | request_demote64 (self, *args) |
request_demote64(self) | |
"bool" | lists_dirty (self, *args) |
lists_dirty(self) -> bool | |
"bool" | lists_ready (self, *args) |
lists_ready(self) -> bool | |
"int" | make_lists_ready (self, *args) |
make_lists_ready(self) -> int | |
"int" | npred (self, *args) |
npred(self) -> int Get number of block predecessors. | |
"int" | nsucc (self, *args) |
nsucc(self) -> int Get number of block successors. | |
"int" | pred (self, *args) |
pred(self, n) -> int | |
"int" | succ (self, *args) |
succ(self, n) -> int | |
"bool" | empty (self, *args) |
empty(self) -> bool | |
"void" | dump (self, *args) |
dump(self) Dump block info. | |
"void" | dump_block (self, *args) |
dump_block(self, title) | |
"minsn_t *" | insert_into_block (self, *args) |
insert_into_block(self, nm, om) -> minsn_t Insert instruction into the doubly linked list | |
"minsn_t *" | remove_from_block (self, *args) |
remove_from_block(self, m) -> minsn_t Remove instruction from the doubly linked list | |
"int" | for_all_insns (self, *args) |
for_all_insns(self, mv) -> int Visit all instructions. | |
"int" | for_all_ops (self, *args) |
for_all_ops(self, mv) -> int Visit all operands. | |
"int" | for_all_uses (self, *args) |
for_all_uses(self, list, i1, i2, mmv) -> int Visit all operands that use LIST. | |
"int" | optimize_insn (self, *args) |
optimize_insn(self, m, optflags=0x0002|0x0004) -> int Optimize one instruction in the context of the block. | |
"int" | optimize_block (self, *args) |
optimize_block(self) -> int Optimize a basic block. | |
"int" | build_lists (self, *args) |
build_lists(self, kill_deads) -> int Build def-use lists and eliminate deads. | |
"int" | optimize_useless_jump (self, *args) |
optimize_useless_jump(self) -> int Remove a jump at the end of the block if it is useless. | |
"void" | append_use_list (self, *args) |
append_use_list(self, list, op, maymust, mask=bitrange_t(0, USHRT_MAX)) Append use-list of an operand. | |
"void" | append_def_list (self, *args) |
append_def_list(self, list, op, maymust) Append def-list of an operand. | |
"mlist_t" | build_use_list (self, *args) |
build_use_list(self, ins, maymust) -> mlist_t Build use-list of an instruction. | |
"mlist_t" | build_def_list (self, *args) |
build_def_list(self, ins, maymust) -> mlist_t Build def-list of an instruction. | |
"bool" | is_used (self, *args) |
is_used(self, list, i1, i2, maymust=MAY_ACCESS) -> bool Is the list used by the specified instruction range? | |
"minsn_t *" | find_first_use (self, *args) |
find_first_use(self, list, i1, i2, maymust=MAY_ACCESS) -> minsn_t | |
"bool" | is_redefined (self, *args) |
is_redefined(self, list, i1, i2, maymust=MAY_ACCESS) -> bool Is the list redefined by the specified instructions? | |
"minsn_t *" | find_redefinition (self, *args) |
find_redefinition(self, list, i1, i2, maymust=MAY_ACCESS) -> minsn_t | |
"bool" | is_rhs_redefined (self, *args) |
is_rhs_redefined(self, ins, i1, i2) -> bool Is the right hand side of the instruction redefined the insn range? "right hand
side" corresponds to the source operands of the instruction. | |
"minsn_t *" | find_access (self, *args) |
find_access(self, op, parent, mend, fdflags) -> minsn_t Find the instruction that accesses the specified operand. | |
"minsn_t *" | find_def (self, *args) |
find_def(self, op, p_i1, i2, fdflags) -> minsn_t | |
"minsn_t *" | find_use (self, *args) |
find_use(self, op, p_i1, i2, fdflags) -> minsn_t | |
"bool" | get_valranges (self, *args) |
get_valranges(self, res, vivl, vrflags) -> bool Find possible values for an instruction. | |
"void" | make_nop (self, *args) |
make_nop(self, m) Erase the instruction (convert it to nop) and mark the lists dirty. | |
"size_t" | get_reginsn_qty (self, *args) |
get_reginsn_qty(self) -> size_t Calculate number of regular instructions in the block. | |
"bool" | is_call_block (self, *args) |
is_call_block(self) -> bool | |
"bool" | is_unknown_call (self, *args) |
is_unknown_call(self) -> bool | |
"bool" | is_nway (self, *args) |
is_nway(self) -> bool | |
"bool" | is_branch (self, *args) |
is_branch(self) -> bool | |
"bool" | is_simple_goto_block (self, *args) |
is_simple_goto_block(self) -> bool | |
"bool" | is_simple_jcnd_block (self, *args) |
is_simple_jcnd_block(self) -> bool | |
preds (self) | |
Iterates the list of predecessor blocks. | |
succs (self) | |
Iterates the list of successor blocks. | |
Protected Member Functions | |
"void" | _print (self, *args) |
_print(self, vp) | |
Properties | |
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") | |
nextb = property(_ida_hexrays.mblock_t_nextb_get, _ida_hexrays.mblock_t_nextb_set, doc=) | |
prevb = property(_ida_hexrays.mblock_t_prevb_get, _ida_hexrays.mblock_t_prevb_set, doc=) | |
flags = property(_ida_hexrays.mblock_t_flags_get, _ida_hexrays.mblock_t_flags_set, doc=) | |
start = property(_ida_hexrays.mblock_t_start_get, _ida_hexrays.mblock_t_start_set, doc=) | |
end = property(_ida_hexrays.mblock_t_end_get, _ida_hexrays.mblock_t_end_set, doc=) | |
head = property(_ida_hexrays.mblock_t_head_get, _ida_hexrays.mblock_t_head_set, doc=) | |
tail = property(_ida_hexrays.mblock_t_tail_get, _ida_hexrays.mblock_t_tail_set, doc=) | |
mba = property(_ida_hexrays.mblock_t_mba_get, _ida_hexrays.mblock_t_mba_set, doc=) | |
serial = property(_ida_hexrays.mblock_t_serial_get, _ida_hexrays.mblock_t_serial_set, doc=) | |
type = property(_ida_hexrays.mblock_t_type_get, _ida_hexrays.mblock_t_type_set, doc=) | |
dead_at_start = property(_ida_hexrays.mblock_t_dead_at_start_get, _ida_hexrays.mblock_t_dead_at_start_set, doc=) | |
mustbuse = property(_ida_hexrays.mblock_t_mustbuse_get, _ida_hexrays.mblock_t_mustbuse_set, doc=) | |
maybuse = property(_ida_hexrays.mblock_t_maybuse_get, _ida_hexrays.mblock_t_maybuse_set, doc=) | |
mustbdef = property(_ida_hexrays.mblock_t_mustbdef_get, _ida_hexrays.mblock_t_mustbdef_set, doc=) | |
maybdef = property(_ida_hexrays.mblock_t_maybdef_get, _ida_hexrays.mblock_t_maybdef_set, doc=) | |
dnu = property(_ida_hexrays.mblock_t_dnu_get, _ida_hexrays.mblock_t_dnu_set, doc=) | |
maxbsp = property(_ida_hexrays.mblock_t_maxbsp_get, _ida_hexrays.mblock_t_maxbsp_set, doc=) | |
minbstkref = property(_ida_hexrays.mblock_t_minbstkref_get, _ida_hexrays.mblock_t_minbstkref_set, doc=) | |
minbargref = property(_ida_hexrays.mblock_t_minbargref_get, _ida_hexrays.mblock_t_minbargref_set, doc=) | |
predset = property(_ida_hexrays.mblock_t_predset_get, _ida_hexrays.mblock_t_predset_set, doc=) | |
succset = property(_ida_hexrays.mblock_t_succset_get, _ida_hexrays.mblock_t_succset_set, doc=) | |
__init__ | ( | self, | |
* | args, | ||
** | kwargs ) |
|
protected |
vp: vd_printer_t &
"void" append_def_list | ( | self, | |
* | args ) |
This function calculates list of locations that may or must be modified by the operand and appends it to LIST.
"void" append_use_list | ( | self, | |
* | args ) |
This function calculates list of locations that may or must be used by the operand and appends it to LIST.
list | (C++: mlist_t *) ptr to the output buffer. we will append to it. |
op | (C++: const mop_t &) operand to calculate the use list of |
maymust | (C++: maymust_t) should we calculate 'may-use' or 'must-use' list? see maymust_t for more details. |
mask | (C++: bitrange_t) 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. |
"mlist_t" build_def_list | ( | self, | |
* | args ) |
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.
ins | (C++: const minsn_t &) instruction to calculate the def list of |
maymust | (C++: maymust_t) should we calculate 'may-def' or 'must-def' list? see maymust_t for more details. |
"int" build_lists | ( | self, | |
* | args ) |
kill_deads | (C++: bool) do delete dead instructions? |
"mlist_t" build_use_list | ( | self, | |
* | args ) |
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.
ins | (C++: const minsn_t &) instruction to calculate the use list of |
maymust | (C++: maymust_t) should we calculate 'may-use' or 'must-use' list? see maymust_t for more details. |
"void" dump | ( | self, | |
* | args ) |
This function is useful for debugging, see mba_t.dump for info
"void" dump_block | ( | self, | |
* | args ) |
title | char const * |
"bool" empty | ( | self, | |
* | args ) |
"minsn_t *" find_access | ( | self, | |
* | args ) |
This function search inside one block.
op | (C++: const mop_t &) operand to search for |
parent | (C++: minsn_t **) ptr to ptr to a top level instruction. denotes the beginning of the search range. |
mend | (C++: const minsn_t *) end instruction of the range (must be a top level insn) mend is excluded from the range. it can be specified as nullptr. parent and mend must belong to the same block. |
fdflags | (C++: int) combination of bits for mblock_t.find_access bits |
"minsn_t *" find_def | ( | self, | |
* | args ) |
"minsn_t *" find_first_use | ( | self, | |
* | args ) |
"minsn_t *" find_redefinition | ( | self, | |
* | args ) |
"minsn_t *" find_use | ( | self, | |
* | args ) |
"int" for_all_insns | ( | self, | |
* | args ) |
This function visits subinstructions too.
mv | (C++: minsn_visitor_t &) instruction visitor |
"int" for_all_ops | ( | self, | |
* | args ) |
This function visit subinstruction operands too.
mv | (C++: mop_visitor_t &) operand visitor |
"int" for_all_uses | ( | self, | |
* | args ) |
list | (C++: mlist_t *) ptr to the list of locations. it may be modified: parts that get redefined by the instructions in [i1,i2) will be deleted. |
i1 | (C++: minsn_t *) starting instruction. must be a top level insn. |
i2 | (C++: minsn_t *) ending instruction (excluded). must be a top level insn. |
mmv | (C++: mlist_mop_visitor_t &) operand visitor |
"size_t" get_reginsn_qty | ( | self, | |
* | args ) |
Assertions are skipped by this function.
"bool" get_valranges | ( | self, | |
* | args ) |
"minsn_t *" insert_into_block | ( | self, | |
* | args ) |
"bool" is_branch | ( | self, | |
* | args ) |
"bool" is_call_block | ( | self, | |
* | args ) |
"bool" is_nway | ( | self, | |
* | args ) |
"bool" is_redefined | ( | self, | |
* | args ) |
list | (C++: const mlist_t &) list of locations to check. |
i1 | (C++: const minsn_t *) starting instruction of the range (must be a top level insn) |
i2 | (C++: const minsn_t *) 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 | (C++: maymust_t) should we search in 'may-access' or 'must-access' mode? |
"bool" is_rhs_redefined | ( | self, | |
* | args ) |
ins | (C++: const minsn_t *) instruction to consider |
i1 | (C++: const minsn_t *) starting instruction of the range (must be a top level insn) |
i2 | (C++: const minsn_t *) 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. |
"bool" is_simple_goto_block | ( | self, | |
* | args ) |
"bool" is_simple_jcnd_block | ( | self, | |
* | args ) |
"bool" is_unknown_call | ( | self, | |
* | args ) |
"bool" is_used | ( | self, | |
* | args ) |
list | (C++: mlist_t *) list of locations. LIST may be modified by the function: redefined locations will be removed from it. |
i1 | (C++: const minsn_t *) starting instruction of the range (must be a top level insn) |
i2 | (C++: const minsn_t *) 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 | (C++: maymust_t) should we search in 'may-access' or 'must-access' mode? |
"bool" lists_dirty | ( | self, | |
* | args ) |
"bool" lists_ready | ( | self, | |
* | args ) |
"int" make_lists_ready | ( | self, | |
* | args ) |
"void" make_nop | ( | self, | |
* | args ) |
This is the recommended function to use because it also marks the block use-def lists dirty.
m | (C++: minsn_t *) |
"void" mark_lists_dirty | ( | self, | |
* | args ) |
"bool" needs_propagation | ( | self, | |
* | args ) |
"int" npred | ( | self, | |
* | args ) |
"int" nsucc | ( | self, | |
* | args ) |
"int" optimize_block | ( | self, | |
* | args ) |
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.
"int" optimize_insn | ( | self, | |
* | args ) |
m | (C++: minsn_t *) pointer to a top level instruction |
optflags | (C++: int) combination of optimization flags bits |
"int" optimize_useless_jump | ( | self, | |
* | args ) |
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).
"int" pred | ( | self, | |
* | args ) |
n | int |
preds | ( | self | ) |
"minsn_t *" remove_from_block | ( | self, | |
* | args ) |
m | (C++: minsn_t *) instruction to remove The removed instruction is not deleted, the caller gets its ownership |
"void" request_demote64 | ( | self, | |
* | args ) |
"void" request_propagation | ( | self, | |
* | args ) |
"int" succ | ( | self, | |
* | args ) |
n | int |
succs | ( | self | ) |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |