angr.utils.vex

angr.utils.vex.get_tmp_def_stmt(vex_block, tmp_idx)
Return type:

int | None

Parameters:
angr.utils.vex.block_branch_ins_addr(ins_addrs, block_addr, block_size, arch)

Determine the address of the control-transfer instruction that ends a block.

On architectures without delay slots, this is the last instruction of the block. On delay-slot architectures (MIPS), the block ends with the delay slot and the branch precedes it; depending on the lifter, the branch and its delay slot are recorded either as two IMarks (libVEX forks before Valgrind 3.27.1, pcode) or as a single IMark spanning both instructions (Valgrind 3.27.1+), in which case the last recorded instruction address is the branch itself.

Parameters:
  • ins_addrs (InsAddrSeq) – Instruction addresses of the block (IMark start addresses).

  • block_addr (int) – Address of the block.

  • block_size (int | None) – Size of the block in bytes, or None when it is unknown.

  • arch (Arch) – The architecture.

Return type:

int | None

Returns:

The branch instruction address, or None if ins_addrs is empty.

angr.utils.vex.block_is_single_instruction(ins_addrs, block_addr, block_size, arch)

Determine whether a block holds at most one instruction, i.e. it is too short to carry a branch together with its delay slot. Only libVEX (Valgrind 3.27.1+) merges a branch and its delay slot into one IMark; such an IMark spans two fixed-width instructions, so on libVEX architectures a lone IMark counts as a single instruction only if it is no longer than one instruction.

Parameters:
  • ins_addrs (InsAddrSeq) – Instruction addresses of the block (IMark start addresses).

  • block_addr (int) – Address of the block.

  • block_size (int) – Size of the block in bytes.

  • arch (Arch) – The architecture.

Return type:

bool

Returns:

True if the block holds at most one instruction.