Comments on HLIL are frequently not placed on the correct line
As function comments are only placed on addresses HLIL comments frequently are placed on an untended instruction. To solve this we would likely need to store additional data in addition to the address in order to find the proper location to place comments.
This issue is partially mitigated by providing better HLIL address mappings.
As a workaround, it would be useful to at least be able to force comments to be displayed on a certain HLIL statement - at the moment, it's not uncommon to encounter e.g. a branch of an if-elseif-else on which no comments whatsoever can be placed in HLIL (they always show up somewhere else), which is quite frustrating.
As a workaround, it would be useful to at least be able to force comments to be displayed on a certain HLIL statement - at the moment, it's not uncommon to encounter e.g. a branch of an if-elseif-else on which no comments whatsoever can be placed in HLIL (they always show up somewhere else), which is quite frustrating.
Agree with this- things get especially bad with switch statements, placing all comments at the top of the switch
This has been improved as of 2.5.3158-dev, see https://github.com/Vector35/binaryninja-api/issues/2792#issuecomment-1006148094. There is still the problem of duplicate addresses leading to duplicate comments in HLIL, which is what this issue tracks.
Potentially related:
- https://github.com/Vector35/binaryninja-api/issues/708
- https://github.com/Vector35/binaryninja-api/issues/4464
Potentially related to this: https://github.com/Vector35/binaryninja-api/issues/3754
Comment placement code has been substantially overhauled leading to this happening far less. Expressions trees on every line of IL are walked and the original addresses checked for comments, allowing multiple addresses to contribute comments to the same line. This helps where folding has occurred.
This should minimize comments being 'lost' as movement up through the IL happens.