binaryninja-api
binaryninja-api copied to clipboard
"Invalid Instruction" tags are cleared on reanalysis
Version and Platform (required):
- Binary Ninja Version: 2.5.3145-dev
- OS: macOS
- OS Version: 12.0.1
Bug Description: Certain "invalid instruction" tags are created when the arch fails to disassemble an instruction, but reanalyzing the function deletes them and does not recreate them.
Steps To Reproduce: Please provide all steps required to reproduce the behavior:
- Open /System/Library/Kernels/kernel.release.t6000
- Observe Invalid Instruction tags
Expected Behavior: I expected the tags to persist.
Screenshots:
Additional Information: Possible cause: invalid instruction tags are only created when analyzing basic blocks. Function reanalysis clears all auto tags. Basic blocks are not analyzed on subsequent reanalyses unless the file contents change, so the invalid instruction tags are cleared and never recreated.
Possible solutions:
- Reanalyze basic blocks when functions are reanalyzed, so the tags are created again
- Have a set of preserved tags for reanalysis
- Have a set of preserved tag types reanalysis
- Have a tagtypetype for them specifically to facilitate 2 or 3
- Only remove tags of certain types when clearing auto analysis data
Related to https://github.com/Vector35/binaryninja-api/issues/3435. The only difference is that I never see the "invalid instruction" tag show up at all.