IHEX/SRC/TI-TXT views are fundamentally broken due to detached raw view
Version and Platform (required):
- Binary Ninja Version: 4.2.5996-dev
- OS: All
- OS Version: Any
- CPU Architecture: Any
Bug Description: The architectures don't register the new bintxt views so they are not selectable in open with options. It defaults to only allowing x86.
Steps To Reproduce: Please provide all steps required to reproduce the behavior:
- Open with options
- Select hex file
- Architectures are marked as read only
So after looking into this more, IHEX view and others (SREC, TI-TXT) are tainted by the mess that is BinaryView initialization, what I mean is that the view does not parent the raw view, and because of the raw views special role as the root view, holds data like load settings (i.e. the architecture you want to open the ihex view with).
The culprit for this detached state is: https://github.com/Vector35/binaryninja-api/blob/d041e78a06686290aaa4a465dffe3a0ae648ba02/view/bintxt/src/ihex.rs#L116
The work being done for https://github.com/Vector35/binaryninja-api/issues/133 will ultimately solve this
If this is not resolved prior to next stable then the views (IHEX, SRC and TI-TXT) will be disabled, pending further core changes tracked as apart of #133.
There was some discussion on this in slack. If you entertain a different approach to this feature, this issue is not blocked and does not require container support. These formats deal more with memory initialization. They are essentially 'binary dump' like formats and we should handle them distinctly from other BinaryViewTypes.
Given this, we should expand the existing Mapped binary view type to detect and transform these formats into a real Raw image, which is then used as the parent for a Mapped view.
Another aspect of these formats, and a reason for not trying to use containers for this, is that we should be able to export regions of memory as IHEX (or some other binary dump format) regardless of the load source type (Raw, ELF, etc.)
The high-level feature can probably be thought of as a set of "Import to Mapped View" and "Export to <Dump Format>".
This has been implemented in 4.3.6801-dev. Some new settings were added as well to control the behavior.
files.text.autoDetectFormat and files.text.mergeSegments