angr.codenode

angr.codenode.repr_addr(addr)
Return type:

str

Parameters:

addr (K)

class angr.codenode.CodeNode

Bases: Generic

The base class of nodes in a function graph.

__init__(addr, size, thumb=False)
Parameters:
  • addr (K)

  • size (int)

addr
size: int
thumb
set_owner(func)
Return type:

None

property owner: Function | None

The Function this node belongs to, or None if it was never registered with one or that Function is gone.

successors()
Return type:

list[CodeNode]

predecessors()
Return type:

list[CodeNode]

is_hook = None
class angr.codenode.BlockNode

Bases: CodeNode, Generic

Represents a block of code in a function graph.

is_hook = False
__init__(addr, size, bytestr=None, thumb=False, delta=None)
Parameters:
  • bytestr (bytes | None) – The bytes of the block, given only when the bytes are from user-specified binary code.

  • delta (int | None) – The block’s bytes are at addr + delta. Defaults to -1 for ARM Thumb nodes. Note that delta is not part of the identity of a BlockNode.

  • addr (K)

  • size (int)

  • thumb (bool)

delta
property manual_bytes: bool

True if the node has user-supplied bytes rather than reading bytes from the loader.

property raw_bytestr: bytes | None

The bytes of the block if they were supplied by the user. None otherwise.

bytestr(project, original=True)

Get the bytes of the block.

Parameters:
  • project (Project) – The angr Project to use to read the bytes if they are not user-supplied.

  • original (bool) – Whether to read the original bytes from the loader (True) or the potentially patched bytes (False).

Return type:

bytes | None

class angr.codenode.SootBlockNode

Bases: BlockNode[SootMethodDescriptor]

Represents a Soot block of code in a function graph.

stmts
class angr.codenode.FuncNode

Bases: CodeNode, Generic

Represents a function callee in a function graph.

__init__(addr, func_name=None, **kwargs)
Parameters:
  • addr (K)

  • func_name (str | None)

func_name
property is_addr_known: bool
class angr.codenode.HookNode

Bases: CodeNode, Generic

Represents a hook in a function graph.

is_hook = True
__init__(addr, size, sim_procedure, **kwargs)
Parameters:

sim_procedure (SimProcedure | None) – the the sim_procedure class

sim_procedure
class angr.codenode.SyscallNode

Bases: HookNode, Generic

Represents a syscall in a function graph.

is_hook = False
sim_procedure