Block class represents a basic block in a binary program, providing access to disassembly, VEX IR translation, and instruction information.
Class Signature
Parameters
The address of the start of the block.
The angr project this block belongs to.
The architecture of the block. Either
project or arch must be specified.The size of the block in bytes.
The maximum size of the block in bytes.
The bytes to lift instead of reading from project memory.
Whether this is ARM Thumb mode.
A state to read bytes from instead of using project memory.
Additional addresses where the block should stop.
The VEX optimization level (0-2).
The maximum number of instructions to lift.
Traceflags to pass to VEX.
Whether to strictly adhere to block end conditions.
Whether to collect data references during lifting.
Whether to perform cross-instruction optimization.
Whether to load from read-only memory regions.
Whether to perform constant propagation during lifting.
Whether to skip generating VEX statements (faster for metadata only).
Attributes
The address of the block.
The architecture of the block.
The size of the block in bytes.
Whether this block is in ARM Thumb mode.
Class constant for maximum block size.
Properties
vex
vex
Type:
IRSB | PcodeIRSBThe VEX or Pcode intermediate representation of this block.vex_nostmt
vex_nostmt
Type:
IRSB | PcodeIRSBThe VEX IR without statements (faster, for metadata only).capstone
capstone
Type:
CapstoneBlockThe Capstone disassembly of this block.pcode
pcode
Type:
PCodeBlockThe P-Code disassembly of this block (for P-Code architectures).disassembly
disassembly
Type:
DisassemblerBlockA disassembly using whatever disassembler is available (Capstone or P-Code).bytes
bytes
Type:
bytes | NoneThe raw bytes of the block.instructions
instructions
Type:
intThe number of instructions in the block.instruction_addrs
instruction_addrs
Type:
list[int]List of addresses for each instruction in the block.codenode
codenode
Type:
BlockNodeA CodeNode representation of this block for use in CFG.Methods
pp()
pp()
Signature:Pretty-print a disassembly of the block.
set_initial_regs()
set_initial_regs()
Signature:Set up initial registers for data reference collection.
reset_initial_regs()
reset_initial_regs()
Signature:Reset the initial register values.
DisassemblerBlock Classes
These helper classes represent disassembled blocks:DisassemblerBlock
pp()
pp()
Print the block to stdout.
DisassemblerInsn
CapstoneBlock
A Capstone-specific implementation ofDisassemblerBlock.
CapstoneInsn
A Capstone-specific implementation ofDisassemblerInsn.
SootBlock
For Java/Soot analysis, there’s a separateSootBlock class:
The Soot address descriptor.
The architecture (ArchSoot).
The Soot IR representation.
The number of Soot statements.