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

Low discoverability of both get_mlil_var_refs and get_hlil_var_refs

Open xusheng6 opened this issue 3 years ago • 1 comments

The two methods to get xrefs to variables are hard to figure out by the user. One user reached out to ask how he can get all xrefs to a variable. He said he browsed the API docs for a while and cannot find a clue. I -- the author of this code -- cannot remember the name and had to eventually read our code to figure out the name of the two functions. It is kinda problematic to be that hard to find out.

We should consider making a get_var_refs that is better to discover. It should check whether the incoming function is a HLIL function or not, and decide to use the underlying get_mlil_var_refs or get_hlil_var_refs accordingly.

xusheng6 avatar Jul 22 '22 09:07 xusheng6

We should probably move the get_mlil_var_refs to MediumLevelILFunction and rename it to get_var_refs, and the same for get_hlil_var_refs.

xusheng6 avatar Aug 08 '22 05:08 xusheng6