Vector35 / binaryninja-api

Public API, examples, documentation and issues for Binary Ninja
https://binary.ninja/
MIT License
899 stars 203 forks source link

UIDF should be settable on SSA variable def sites #4289

Closed yrp604 closed 1 year ago

yrp604 commented 1 year ago

What is the feature you'd like to have? Right now UIDF only works on MLIL var def sites. I would like it to work on MLIL SSA var def sites as well.

Is your feature request related to a problem? If you're dealing with a loop, it can be very difficult to set a variable value to be used in that loop, as the relevant defsite could be inside the loop. SSA solves this problem, but UIDF does not work with SSA variables.

Are any alternative solutions acceptable? if UIDF were functional at variable use sites, that might also work.

Additional Information:

Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "C:\Users\x\AppData\Local\Vector35\BinaryNinja\plugins\..\python\binaryninja\function.py", line 3051, in set_user_var_value
    var_defs = self.mlil.get_var_definitions(var)
  File "C:\Users\x\AppData\Local\Vector35\BinaryNinja\plugins\..\python\binaryninja\mediumlevelil.py", line 3396, in get_var_definitions
    var_data = var.to_BNVariable()
AttributeError: 'SSAVariable' object has no attribute 'to_BNVariable'
plafosse commented 1 year ago

I believe this is a duplicate or addendum to this issue: https://github.com/Vector35/binaryninja-api/issues/2160