angr.engines.pcode.behavior

angr.engines.pcode.behavior.make_bv_sizes_equal(bv1, bv2, zero_ext=False)

Makes two BVs equal in length through sign extension.

Return type:

tuple[BV, BV]

Parameters:
class angr.engines.pcode.behavior.OpBehavior

Bases: object

Base class for all operation behaviors.

__init__(opcode, is_unary, is_special=False)
Parameters:
Return type:

None

opcode: OpCode
is_unary: bool
is_special: bool
evaluate_unary(size_out, size_in, in1)
Return type:

BV

Parameters:
evaluate_binary(size_out, size_in, in1, in2)
Return type:

BV

Parameters:
static generic_compare(args, comparison)
Return type:

BV

Parameters:
classmethod booleanize(in1)

Reduce input BV to a single bit of truth: out <- 1 if (in1 != 0) else 0.

Return type:

BV

Parameters:

in1 (BV)

class angr.engines.pcode.behavior.OpBehaviorCopy

Bases: OpBehavior

Behavior for the COPY operation.

__init__()
evaluate_unary(size_out, size_in, in1)
Return type:

BV

Parameters:
is_special: bool
is_unary: bool
opcode: OpCode
class angr.engines.pcode.behavior.OpBehaviorEqual

Bases: OpBehavior

Behavior for the INT_EQUAL operation.

__init__()
evaluate_binary(size_out, size_in, in1, in2)
Return type:

BV

Parameters:
is_special: bool
is_unary: bool
opcode: OpCode
class angr.engines.pcode.behavior.OpBehaviorNotEqual

Bases: OpBehavior

Behavior for the INT_NOTEQUAL operation.

__init__()
evaluate_binary(size_out, size_in, in1, in2)
Return type:

BV

Parameters:
is_special: bool
is_unary: bool
opcode: OpCode
class angr.engines.pcode.behavior.OpBehaviorIntSless

Bases: OpBehavior

Behavior for the INT_SLESS operation.

__init__()
evaluate_binary(size_out, size_in, in1, in2)
Return type:

BV

Parameters:
is_special: bool
is_unary: bool
opcode: OpCode
class angr.engines.pcode.behavior.OpBehaviorIntSlessEqual

Bases: OpBehavior

Behavior for the INT_SLESSEQUAL operation.

__init__()
evaluate_binary(size_out, size_in, in1, in2)
Return type:

BV

Parameters:
is_special: bool
is_unary: bool
opcode: OpCode
class angr.engines.pcode.behavior.OpBehaviorIntLess

Bases: OpBehavior

Behavior for the INT_LESS operation.

__init__()
evaluate_binary(size_out, size_in, in1, in2)
Return type:

BV

Parameters:
is_special: bool
is_unary: bool
opcode: OpCode
class angr.engines.pcode.behavior.OpBehaviorIntLessEqual

Bases: OpBehavior

Behavior for the INT_LESSEQUAL operation.

__init__()
evaluate_binary(size_out, size_in, in1, in2)
Return type:

BV

Parameters:
is_special: bool
is_unary: bool
opcode: OpCode
class angr.engines.pcode.behavior.OpBehaviorIntZext

Bases: OpBehavior

Behavior for the INT_ZEXT operation.

__init__()
evaluate_unary(size_out, size_in, in1)
Return type:

BV

Parameters:
is_special: bool
is_unary: bool
opcode: OpCode
class angr.engines.pcode.behavior.OpBehaviorIntSext

Bases: OpBehavior

Behavior for the INT_SEXT operation.

__init__()
evaluate_unary(size_out, size_in, in1)
Return type:

BV

Parameters:
is_special: bool
is_unary: bool
opcode: OpCode
class angr.engines.pcode.behavior.OpBehaviorIntAdd

Bases: OpBehavior

Behavior for the INT_ADD operation.

__init__()
evaluate_binary(size_out, size_in, in1, in2)
Return type:

BV

Parameters:
is_special: bool
is_unary: bool
opcode: OpCode
class angr.engines.pcode.behavior.OpBehaviorIntSub

Bases: OpBehavior

Behavior for the INT_SUB operation.

__init__()
evaluate_binary(size_out, size_in, in1, in2)
Return type:

BV

Parameters:
is_special: bool
is_unary: bool
opcode: OpCode
class angr.engines.pcode.behavior.OpBehaviorIntCarry

Bases: OpBehavior

Behavior for the INT_CARRY operation.

__init__()
evaluate_binary(size_out, size_in, in1, in2)
Return type:

BV

Parameters:
is_special: bool
is_unary: bool
opcode: OpCode
class angr.engines.pcode.behavior.OpBehaviorIntScarry

Bases: OpBehavior

Behavior for the INT_SCARRY operation.

__init__()
evaluate_binary(size_out, size_in, in1, in2)
Return type:

BV

Parameters:
is_special: bool
is_unary: bool
opcode: OpCode
class angr.engines.pcode.behavior.OpBehaviorIntSborrow

Bases: OpBehavior

Behavior for the INT_SBORROW operation.

__init__()
evaluate_binary(size_out, size_in, in1, in2)
Return type:

BV

Parameters:
is_special: bool
is_unary: bool
opcode: OpCode
class angr.engines.pcode.behavior.OpBehaviorInt2Comp

Bases: OpBehavior

Behavior for the INT_2COMP operation.

__init__()
evaluate_unary(size_out, size_in, in1)
Return type:

BV

Parameters:
is_special: bool
is_unary: bool
opcode: OpCode
class angr.engines.pcode.behavior.OpBehaviorIntNegate

Bases: OpBehavior

Behavior for the INT_NEGATE operation.

__init__()
evaluate_unary(size_out, size_in, in1)
Return type:

BV

Parameters:
is_special: bool
is_unary: bool
opcode: OpCode
class angr.engines.pcode.behavior.OpBehaviorIntXor

Bases: OpBehavior

Behavior for the INT_XOR operation.

__init__()
evaluate_binary(size_out, size_in, in1, in2)
Return type:

BV

Parameters:
is_special: bool
is_unary: bool
opcode: OpCode
class angr.engines.pcode.behavior.OpBehaviorIntAnd

Bases: OpBehavior

Behavior for the INT_AND operation.

__init__()
evaluate_binary(size_out, size_in, in1, in2)
Return type:

BV

Parameters:
is_special: bool
is_unary: bool
opcode: OpCode
class angr.engines.pcode.behavior.OpBehaviorIntOr

Bases: OpBehavior

Behavior for the INT_OR operation.

__init__()
evaluate_binary(size_out, size_in, in1, in2)
Return type:

BV

Parameters:
is_special: bool
is_unary: bool
opcode: OpCode
class angr.engines.pcode.behavior.OpBehaviorIntLeft

Bases: OpBehavior

Behavior for the INT_LEFT operation.

__init__()
evaluate_binary(size_out, size_in, in1, in2)
Return type:

BV

Parameters:
is_special: bool
is_unary: bool
opcode: OpCode
class angr.engines.pcode.behavior.OpBehaviorIntRight

Bases: OpBehavior

Behavior for the INT_RIGHT operation.

__init__()
evaluate_binary(size_out, size_in, in1, in2)
Return type:

BV

Parameters:
is_special: bool
is_unary: bool
opcode: OpCode
class angr.engines.pcode.behavior.OpBehaviorIntSright

Bases: OpBehavior

Behavior for the INT_SRIGHT operation.

__init__()
evaluate_binary(size_out, size_in, in1, in2)
Return type:

BV

Parameters:
is_special: bool
is_unary: bool
opcode: OpCode
class angr.engines.pcode.behavior.OpBehaviorIntMult

Bases: OpBehavior

Behavior for the INT_MULT operation.

__init__()
evaluate_binary(size_out, size_in, in1, in2)
Return type:

BV

Parameters:
is_special: bool
is_unary: bool
opcode: OpCode
class angr.engines.pcode.behavior.OpBehaviorIntDiv

Bases: OpBehavior

Behavior for the INT_DIV operation.

__init__()
evaluate_binary(size_out, size_in, in1, in2)
Return type:

BV

Parameters:
is_special: bool
is_unary: bool
opcode: OpCode
class angr.engines.pcode.behavior.OpBehaviorIntSdiv

Bases: OpBehavior

Behavior for the INT_SDIV operation.

__init__()
evaluate_binary(size_out, size_in, in1, in2)
Return type:

BV

Parameters:
is_special: bool
is_unary: bool
opcode: OpCode
class angr.engines.pcode.behavior.OpBehaviorIntRem

Bases: OpBehavior

Behavior for the INT_REM operation.

__init__()
evaluate_binary(size_out, size_in, in1, in2)
Return type:

BV

Parameters:
is_special: bool
is_unary: bool
opcode: OpCode
class angr.engines.pcode.behavior.OpBehaviorIntSrem

Bases: OpBehavior

Behavior for the INT_SREM operation.

__init__()
evaluate_binary(size_out, size_in, in1, in2)
Return type:

BV

Parameters:
is_special: bool
is_unary: bool
opcode: OpCode
class angr.engines.pcode.behavior.OpBehaviorBoolNegate

Bases: OpBehavior

Behavior for the BOOL_NEGATE operation.

__init__()
evaluate_unary(size_out, size_in, in1)
Return type:

BV

Parameters:
is_special: bool
is_unary: bool
opcode: OpCode
class angr.engines.pcode.behavior.OpBehaviorBoolXor

Bases: OpBehavior

Behavior for the BOOL_XOR operation.

__init__()
evaluate_binary(size_out, size_in, in1, in2)
Return type:

BV

Parameters:
is_special: bool
is_unary: bool
opcode: OpCode
class angr.engines.pcode.behavior.OpBehaviorBoolAnd

Bases: OpBehavior

Behavior for the BOOL_AND operation.

__init__()
evaluate_binary(size_out, size_in, in1, in2)
Return type:

BV

Parameters:
is_special: bool
is_unary: bool
opcode: OpCode
class angr.engines.pcode.behavior.OpBehaviorBoolOr

Bases: OpBehavior

Behavior for the BOOL_OR operation.

__init__()
evaluate_binary(size_out, size_in, in1, in2)
Return type:

BV

Parameters:
is_special: bool
is_unary: bool
opcode: OpCode
class angr.engines.pcode.behavior.OpBehaviorFloatEqual

Bases: OpBehavior

Behavior for the FLOAT_EQUAL operation.

__init__()
is_special: bool
is_unary: bool
opcode: OpCode
class angr.engines.pcode.behavior.OpBehaviorFloatNotEqual

Bases: OpBehavior

Behavior for the FLOAT_NOTEQUAL operation.

__init__()
is_special: bool
is_unary: bool
opcode: OpCode
class angr.engines.pcode.behavior.OpBehaviorFloatLess

Bases: OpBehavior

Behavior for the FLOAT_LESS operation.

__init__()
is_special: bool
is_unary: bool
opcode: OpCode
class angr.engines.pcode.behavior.OpBehaviorFloatLessEqual

Bases: OpBehavior

Behavior for the FLOAT_LESSEQUAL operation.

__init__()
is_special: bool
is_unary: bool
opcode: OpCode
class angr.engines.pcode.behavior.OpBehaviorFloatNan

Bases: OpBehavior

Behavior for the FLOAT_NAN operation.

__init__()
is_special: bool
is_unary: bool
opcode: OpCode
class angr.engines.pcode.behavior.OpBehaviorFloatAdd

Bases: OpBehavior

Behavior for the FLOAT_ADD operation.

__init__()
is_special: bool
is_unary: bool
opcode: OpCode
class angr.engines.pcode.behavior.OpBehaviorFloatDiv

Bases: OpBehavior

Behavior for the FLOAT_DIV operation.

__init__()
is_special: bool
is_unary: bool
opcode: OpCode
class angr.engines.pcode.behavior.OpBehaviorFloatMult

Bases: OpBehavior

Behavior for the FLOAT_MULT operation.

__init__()
is_special: bool
is_unary: bool
opcode: OpCode
class angr.engines.pcode.behavior.OpBehaviorFloatSub

Bases: OpBehavior

Behavior for the FLOAT_SUB operation.

__init__()
is_special: bool
is_unary: bool
opcode: OpCode
class angr.engines.pcode.behavior.OpBehaviorFloatNeg

Bases: OpBehavior

Behavior for the FLOAT_NEG operation.

__init__()
is_special: bool
is_unary: bool
opcode: OpCode
class angr.engines.pcode.behavior.OpBehaviorFloatAbs

Bases: OpBehavior

Behavior for the FLOAT_ABS operation.

__init__()
is_special: bool
is_unary: bool
opcode: OpCode
class angr.engines.pcode.behavior.OpBehaviorFloatSqrt

Bases: OpBehavior

Behavior for the FLOAT_SQRT operation.

__init__()
is_special: bool
is_unary: bool
opcode: OpCode
class angr.engines.pcode.behavior.OpBehaviorFloatInt2Float

Bases: OpBehavior

Behavior for the FLOAT_INT2FLOAT operation.

__init__()
is_special: bool
is_unary: bool
opcode: OpCode
class angr.engines.pcode.behavior.OpBehaviorFloatFloat2Float

Bases: OpBehavior

Behavior for the FLOAT_FLOAT2FLOAT operation.

__init__()
is_special: bool
is_unary: bool
opcode: OpCode
class angr.engines.pcode.behavior.OpBehaviorFloatTrunc

Bases: OpBehavior

Behavior for the FLOAT_TRUNC operation.

__init__()
is_special: bool
is_unary: bool
opcode: OpCode
class angr.engines.pcode.behavior.OpBehaviorFloatCeil

Bases: OpBehavior

Behavior for the FLOAT_CEIL operation.

__init__()
is_special: bool
is_unary: bool
opcode: OpCode
class angr.engines.pcode.behavior.OpBehaviorFloatFloor

Bases: OpBehavior

Behavior for the FLOAT_FLOOR operation.

__init__()
is_special: bool
is_unary: bool
opcode: OpCode
class angr.engines.pcode.behavior.OpBehaviorFloatRound

Bases: OpBehavior

Behavior for the FLOAT_ROUND operation.

__init__()
is_special: bool
is_unary: bool
opcode: OpCode
class angr.engines.pcode.behavior.OpBehaviorPiece

Bases: OpBehavior

Behavior for the PIECE operation.

__init__()
is_special: bool
is_unary: bool
opcode: OpCode
class angr.engines.pcode.behavior.OpBehaviorSubpiece

Bases: OpBehavior

Behavior for the SUBPIECE operation.

__init__()
evaluate_binary(size_out, size_in, in1, in2)
Return type:

BV

Parameters:
is_special: bool
is_unary: bool
opcode: OpCode
class angr.engines.pcode.behavior.OpBehaviorPopcount

Bases: OpBehavior

Behavior for the POPCOUNT operation.

__init__()
evaluate_unary(size_out, size_in, in1)
Return type:

BV

Parameters:
is_special: bool
is_unary: bool
opcode: OpCode
class angr.engines.pcode.behavior.OpBehaviorLzcount

Bases: OpBehavior

Behavior for the LZCOUNT operation.

__init__()
evaluate_unary(size_out, size_in, in1)
Return type:

BV

Parameters:
is_special: bool
is_unary: bool
opcode: OpCode
class angr.engines.pcode.behavior.BehaviorFactory

Bases: object

Returns the behavior object for a given opcode.

__init__()
get_behavior_for_opcode(opcode)
Return type:

OpBehavior

Parameters:

opcode (OpCode)