Vector35 / binaryninja-api

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

Match selected token to according address in linear view when switching from HLIL to assembly #5674

Open mostobriv opened 3 months ago

mostobriv commented 3 months ago

What is the feature you'd like to have? Usually it's pretty helpful to click (select) on token e.g. argument of function call and change the current view from HLIL to assembly to see low-level part of it, currently afaik BN just match only IL line (or whole IL instruction) to one address in assembly, so no matter what was selected the address in assembly view only one for whole instruction, thus we need to additionally look for needed instructions

Additional Information: I think it can be easily done with plugin, but there is still no clean ways to match selected token to corresponding IL sub-expression (and according to #2722, some of the tokens just can't be matched anyhow)

xusheng6 commented 3 months ago

Related to https://github.com/Vector35/binaryninja-api/issues/2712

plafosse commented 3 months ago

I'm not quite sure I understand the request. When I select the line in HLIL on the right it shows the multiple lines that are used in that calculation on the left in the disassembly.

image
mostobriv commented 3 months ago

I've meant similar to IDA behavior, when you can click on token in decompiler and then switch to assembly view to the instruction that is matched to subexpression associated with selected token.

image image

AFAIK currently no matter which token selected if you switch (press Tab) from HLIL to assembly, the address would be on instruction which is matched to whole IL instruction not the subexpression