boundary_value_analysis

This analysis looks for comparisons of a register to an immediate in order to bound the possible values of that register.

For example, in the following jump table code, AL is bounded as less than or equal to 11 due to the comparison. This boundary value can be used by the jumptable propagation to determine a max size.

cmp AL,11 ja jumptable_default lea RDI,QWORD PTR [RIP+.L_jumptable] movzx EAX,AL movsxd RAX,DWORD PTR [RDI+RAX*4] add RAX,RDI jmp RAX

flags_and_jump_pair(EA_flags:address, EA_jmp:address, CC:condition_code)

A pair of instructions that sets the flags register and then conditionally jump.

Empty on architectures where a flags register is not used.

compare_and_jump_immediate(EA_cmp:address, EA_jmp:address, CC:condition_code, Reg:register, Immediate:number)

A pair of instructions that compares a register to an immediate and then conditionally jumps.

compare_and_jump_register(EA_cmp:address, EA_jmp:address, CC:condition_code, Reg1:register, Reg2:register)

A pair of instructions that compares a register to another register and then conditionally jumps.

compare_and_jump_indirect(EA_cmp:address, EA_jmp:address, CC:condition_code, IndirectOp:operand_code, Immediate:number)

A pair of instructions that compares a memory location to an immediate and then conditionally jumps.

limit_type_map(CC:condition_code, BranchLT:limit_type, FallthroughLT:limit_type, BranchOffset:number, FallthroughOffset:number)

Map condition codes to limit types

value_reg_limit(From:address, To:address, Reg:register, Value:number, LimitType:limit_type)

An instruction at EA limits the value of Reg at some MIN or MAX value.

From: the address that creates the limit To: the address at which the limit is active

compare_and_jump_indirect_op_valid(EA_cmp:address, EA_jmp:address, EA:address, IndirectOp:operand_code, Steps:number)

Detect where indirect operand used in a comparison is unmodified afterward.

correlated_live_reg(Block:address, Reg1:register, Reg2:register, Offset:number)

Two live registers are a constant offset from each other at the end of a block.

cmp_defines(EA_jmp:address, EA_dst:address, Reg:register)

A register is compared as NE or EQ and used for a conditional jump.

no_value_reg_limit(EA_jmp:address)

Jumps where generating a value_reg_limit is not supported.

step_limit_small(Limit:unsigned)

last_value_reg_limit(From:address, To:address, Reg:register, Value:number, LimitType:limit_type, Steps:unsigned)

Basic-block propagation of value_reg_limit

From: the address that creates the limit To: the address at which the limit is active

limit_reg_op(EA:address, DstReg:register, SrcReg:register, Offset:number)

Move or arithmetic operation on a limited register