binaryninja-api icon indicating copy to clipboard operation
binaryninja-api copied to clipboard

Incorrect possible value calculated as sum of unsigned ranges

Open negasora opened this issue 1 year ago • 0 comments

On 4.1.5182-dev

a.txt

image

>>> current_il_instruction.get_possible_reg_values(bv.arch.get_reg_index('rax'))
<unsigned ranges: [<range: 0x0 to 0x1c, step 0x4>]>
>>> current_il_instruction.get_possible_reg_values(bv.arch.get_reg_index('rdx'))
<unsigned ranges: [<range: 0x0 to 0x7>]>
>>> current_il_instruction.get_possible_reg_values_after(bv.arch.get_reg_index('rax'))
<unsigned ranges: [<range: 0x0 to 0x3>]>

The result should be <unsigned ranges: [<range: 0x0 to 0x23>]>

This looks like it's because rax_3#5 is internally UndeterminedValue but you can hover and see we know the correct value for it. Setting the value of rax_3#5 manually to {0 : 0x1c : 4} fixes this.

negasora avatar Apr 26 '24 22:04 negasora